Various cranelift interpreter improvements (#6176)

* Remove the validate_address State trait method

It isn't used anywhere

* Expose the inner Function of a Frame

This is necessary to create your own interpreter that reuses most of
cranelift-interpreter. For example to use a different State
implementation.

* Support the symbol_value and tls_value instructions in the interpreter
This commit is contained in:
bjorn3
2023-04-07 17:22:13 +02:00
committed by GitHub
parent e1777710b1
commit bada17beab
4 changed files with 16 additions and 38 deletions

View File

@@ -563,15 +563,13 @@ where
Opcode::DynamicStackAddr => unimplemented!("DynamicStackSlot"),
Opcode::DynamicStackLoad => unimplemented!("DynamicStackLoad"),
Opcode::DynamicStackStore => unimplemented!("DynamicStackStore"),
Opcode::GlobalValue => {
Opcode::GlobalValue | Opcode::SymbolValue | Opcode::TlsValue => {
if let InstructionData::UnaryGlobalValue { global_value, .. } = inst {
assign_or_memtrap(state.resolve_global_value(global_value))
} else {
unreachable!()
}
}
Opcode::SymbolValue => unimplemented!("SymbolValue"),
Opcode::TlsValue => unimplemented!("TlsValue"),
Opcode::GetPinnedReg => assign(state.get_pinned_reg()),
Opcode::SetPinnedReg => {
let arg0 = arg(0)?;