x64: Migrate trapif and trapff to ISLE (#4545)
https://github.com/bytecodealliance/wasmtime/pull/4545
This commit is contained in:
@@ -144,6 +144,11 @@ macro_rules! isle_prelude_methods {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn mark_value_used(&mut self, val: Value) {
|
||||
self.lower_ctx.increment_lowered_uses(val);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn put_in_reg(&mut self, val: Value) -> Reg {
|
||||
self.lower_ctx.put_value_in_regs(val).only_reg().unwrap()
|
||||
|
||||
@@ -141,6 +141,8 @@ pub trait LowerCtx {
|
||||
/// Resolves a particular input of an instruction to the `Value` that it is
|
||||
/// represented with.
|
||||
fn input_as_value(&self, ir_inst: Inst, idx: usize) -> Value;
|
||||
/// Increment the reference count for the Value, ensuring that it gets lowered.
|
||||
fn increment_lowered_uses(&mut self, val: Value);
|
||||
/// Put the `idx`th input into register(s) and return the assigned register.
|
||||
fn put_input_in_regs(&mut self, ir_inst: Inst, idx: usize) -> ValueRegs<Reg>;
|
||||
/// Put the given value into register(s) and return the assigned register.
|
||||
@@ -1362,6 +1364,10 @@ impl<'func, I: VCodeInst> LowerCtx for Lower<'func, I> {
|
||||
NonRegInput { inst, constant }
|
||||
}
|
||||
|
||||
fn increment_lowered_uses(&mut self, val: Value) {
|
||||
self.value_lowered_uses[val] += 1
|
||||
}
|
||||
|
||||
fn put_input_in_regs(&mut self, ir_inst: Inst, idx: usize) -> ValueRegs<Reg> {
|
||||
let val = self.f.dfg.inst_args(ir_inst)[idx];
|
||||
self.put_value_in_regs(val)
|
||||
|
||||
Reference in New Issue
Block a user