Runs the VM for a period of time controlled by the `fuel` parameter. Returns `Ok(false)` if the method has exhausted its fuel, but there is more work to do, and returns `Ok(true)` if no more progress can be made.
(&mut self, fuel: &mut Fuel)
| 1158 | // Returns `Ok(false)` if the method has exhausted its fuel, but there is more work to |
| 1159 | // do, and returns `Ok(true)` if no more progress can be made. |
| 1160 | pub(super) fn step(&mut self, fuel: &mut Fuel) -> Result<Option<ReturnValue>, VmError> { |
| 1161 | loop { |
| 1162 | if let Some(result) = self.dispatch_next(0)? { |
| 1163 | return Ok(Some(ReturnValue::from(result))); |
| 1164 | } |
| 1165 | const FUEL_PER_STEP: i32 = 1; |
| 1166 | fuel.consume(FUEL_PER_STEP); |
| 1167 | |
| 1168 | if !fuel.should_continue() { |
| 1169 | return Ok(None); |
| 1170 | } |
| 1171 | } |
| 1172 | } |
| 1173 | |
| 1174 | fn capture_upvalue(&mut self, slot: usize) -> GcRefLock<'gc, UpvalueObj<'gc>> { |
| 1175 | let mut prev_upvalue = None; |
no test coverage detected