Move stack access methods in the Machine implementations out of the enforce_ method group.
This commit is contained in:
parent
d41f8bf5fd
commit
cbd922288e
2 changed files with 28 additions and 28 deletions
|
@ -190,20 +190,6 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
fn stack(
|
|
||||||
ecx: &'a InterpCx<'mir, 'tcx, Self>,
|
|
||||||
) -> &'a [Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>] {
|
|
||||||
&ecx.machine.stack
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
fn stack_mut(
|
|
||||||
ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
|
|
||||||
) -> &'a mut Vec<Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>> {
|
|
||||||
&mut ecx.machine.stack
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
|
fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
|
||||||
false // for now, we don't enforce validity
|
false // for now, we don't enforce validity
|
||||||
|
@ -367,6 +353,20 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
|
||||||
Ok(frame)
|
Ok(frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn stack(
|
||||||
|
ecx: &'a InterpCx<'mir, 'tcx, Self>,
|
||||||
|
) -> &'a [Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>] {
|
||||||
|
&ecx.machine.stack
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn stack_mut(
|
||||||
|
ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
|
||||||
|
) -> &'a mut Vec<Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>> {
|
||||||
|
&mut ecx.machine.stack
|
||||||
|
}
|
||||||
|
|
||||||
fn before_access_global(
|
fn before_access_global(
|
||||||
memory_extra: &MemoryExtra,
|
memory_extra: &MemoryExtra,
|
||||||
alloc_id: AllocId,
|
alloc_id: AllocId,
|
||||||
|
|
|
@ -187,20 +187,6 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx>
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
fn stack(
|
|
||||||
ecx: &'a InterpCx<'mir, 'tcx, Self>,
|
|
||||||
) -> &'a [Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>] {
|
|
||||||
&ecx.machine.stack
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
fn stack_mut(
|
|
||||||
ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
|
|
||||||
) -> &'a mut Vec<Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>> {
|
|
||||||
&mut ecx.machine.stack
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
|
fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
|
||||||
false
|
false
|
||||||
|
@ -319,6 +305,20 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx>
|
||||||
) -> InterpResult<'tcx, Frame<'mir, 'tcx>> {
|
) -> InterpResult<'tcx, Frame<'mir, 'tcx>> {
|
||||||
Ok(frame)
|
Ok(frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn stack(
|
||||||
|
ecx: &'a InterpCx<'mir, 'tcx, Self>,
|
||||||
|
) -> &'a [Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>] {
|
||||||
|
&ecx.machine.stack
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn stack_mut(
|
||||||
|
ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
|
||||||
|
) -> &'a mut Vec<Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>> {
|
||||||
|
&mut ecx.machine.stack
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finds optimization opportunities on the MIR.
|
/// Finds optimization opportunities on the MIR.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue