Add a func_addr instruction.
Get the callable address of a function. Use for long distance calls and for creating arguments to call_indirect in general.
This commit is contained in:
@@ -178,6 +178,7 @@ pub enum InstructionData {
|
||||
sig_ref: SigRef,
|
||||
args: ValueList,
|
||||
},
|
||||
FuncAddr { opcode: Opcode, func_ref: FuncRef },
|
||||
StackLoad {
|
||||
opcode: Opcode,
|
||||
stack_slot: StackSlot,
|
||||
|
||||
@@ -306,6 +306,9 @@ impl<'a> Verifier<'a> {
|
||||
self.verify_sig_ref(inst, sig_ref)?;
|
||||
self.verify_value_list(inst, args)?;
|
||||
}
|
||||
FuncAddr { func_ref, .. } => {
|
||||
self.verify_func_ref(inst, func_ref)?;
|
||||
}
|
||||
StackLoad { stack_slot, .. } |
|
||||
StackStore { stack_slot, .. } => {
|
||||
self.verify_stack_slot(inst, stack_slot)?;
|
||||
|
||||
@@ -346,6 +346,7 @@ pub fn write_operands(
|
||||
DisplayValues(&args[1..])
|
||||
)
|
||||
}
|
||||
FuncAddr { func_ref, .. } => write!(w, " {}", func_ref),
|
||||
StackLoad { stack_slot, offset, .. } => write!(w, " {}{}", stack_slot, offset),
|
||||
StackStore {
|
||||
arg,
|
||||
|
||||
Reference in New Issue
Block a user