feat(vm): execute Dynamic instructions and exact costs for PLN-0176 step 21
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::resource_budget::BudgetVec;
|
||||
mod dynamic;
|
||||
mod gc;
|
||||
mod loader;
|
||||
mod runtime;
|
||||
@@ -1358,13 +1359,12 @@ impl VirtualMachine {
|
||||
self.push_trap(value, opcode, start_pc as u32)?;
|
||||
}
|
||||
}
|
||||
OpCode::DynPack
|
||||
| OpCode::DynUnpack
|
||||
| OpCode::DynCanUnpack
|
||||
| OpCode::RefIsExact
|
||||
| OpCode::RefImplements
|
||||
| OpCode::RefToTrait
|
||||
| OpCode::RefCast => {
|
||||
OpCode::DynPack | OpCode::DynUnpack | OpCode::DynCanUnpack => {
|
||||
self.cycles += opcode.cycles();
|
||||
let target = instr.imm_u32().unwrap();
|
||||
return self.execute_dynamic(opcode, target, start_pc as u32);
|
||||
}
|
||||
OpCode::RefIsExact | OpCode::RefImplements | OpCode::RefToTrait | OpCode::RefCast => {
|
||||
// Slot-only ProgramImage cannot authorize typed instructions. The
|
||||
// v1 image/verifier integration supplies their execution context.
|
||||
self.cycles += opcode.cycles();
|
||||
|
||||
Reference in New Issue
Block a user