minor changes
This commit is contained in:
+5
-6
@@ -143,6 +143,7 @@ pub struct Vm<'gc> {
|
||||
pub(crate) stack: Vec<Value<'gc>>,
|
||||
pub(crate) call_stack: Vec<CallFrame<'gc>>,
|
||||
pub(crate) call_depth: usize,
|
||||
#[allow(dead_code)]
|
||||
#[collect(require_static)]
|
||||
pub(crate) error_context: Vec<ErrorFrame>,
|
||||
|
||||
@@ -332,10 +333,7 @@ impl<'gc> Vm<'gc> {
|
||||
reader: &mut BytecodeReader<'_>,
|
||||
mc: &Mutation<'gc>,
|
||||
) -> Option<StepResult> {
|
||||
let val = self.peek_stack(depth);
|
||||
let Some(thunk) = val.as_gc::<Thunk>() else {
|
||||
return None;
|
||||
};
|
||||
let thunk = self.peek_stack(depth).as_gc::<Thunk>()?;
|
||||
let mut state = thunk.borrow_mut(mc);
|
||||
match *state {
|
||||
ThunkState::Pending { ip, env, with_env } => {
|
||||
@@ -425,6 +423,8 @@ impl Vm<'_> {
|
||||
}
|
||||
|
||||
impl<'gc> Vm<'gc> {
|
||||
const DEFAULT_FUEL_AMOUNT: u32 = 1024;
|
||||
|
||||
#[inline(always)]
|
||||
fn dispatch_batch<C: VmContext>(
|
||||
&mut self,
|
||||
@@ -461,10 +461,9 @@ impl<'gc> Vm<'gc> {
|
||||
mc: &Mutation<'gc>,
|
||||
) -> Action {
|
||||
use fix_codegen::Op::*;
|
||||
const DEFAULT_FUEL_AMOUNT: usize = 1024;
|
||||
|
||||
let mut reader = BytecodeReader::new(bytecode, pc);
|
||||
let mut fuel = DEFAULT_FUEL_AMOUNT;
|
||||
let mut fuel = Self::DEFAULT_FUEL_AMOUNT;
|
||||
|
||||
loop {
|
||||
if fuel == 0 {
|
||||
|
||||
Reference in New Issue
Block a user