Skip to content

Commit 3034217

Browse files
committed
VirtualMachine::{run_frame_full => run_frame}
1 parent 50e6146 commit 3034217

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

vm/src/builtins/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl PyFunction {
314314
(true, false) => Ok(PyGenerator::new(frame, self.name()).into_pyobject(vm)),
315315
(false, true) => Ok(PyCoroutine::new(frame, self.name()).into_pyobject(vm)),
316316
(true, true) => Ok(PyAsyncGen::new(frame, self.name()).into_pyobject(vm)),
317-
(false, false) => vm.run_frame_full(frame),
317+
(false, false) => vm.run_frame(frame),
318318
}
319319
}
320320

vm/src/vm/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl VirtualMachine {
273273

274274
pub fn run_code_obj(&self, code: PyRef<PyCode>, scope: Scope) -> PyResult {
275275
let frame = Frame::new(code, scope, self.builtins.dict(), &[], self).into_ref(self);
276-
self.run_frame_full(frame)
276+
self.run_frame(frame)
277277
}
278278

279279
#[cold]
@@ -297,8 +297,8 @@ impl VirtualMachine {
297297
}
298298

299299
#[inline(always)]
300-
pub fn run_frame_full(&self, frame: FrameRef) -> PyResult {
301-
match self.run_frame(frame)? {
300+
pub fn run_frame(&self, frame: FrameRef) -> PyResult {
301+
match self.with_frame(frame, |f| f.run(self))? {
302302
ExecutionResult::Return(value) => Ok(value),
303303
_ => panic!("Got unexpected result from function"),
304304
}
@@ -333,10 +333,6 @@ impl VirtualMachine {
333333
})
334334
}
335335

336-
pub fn run_frame(&self, frame: FrameRef) -> PyResult<ExecutionResult> {
337-
self.with_frame(frame, |f| f.run(self))
338-
}
339-
340336
// To be called right before raising the recursion depth.
341337
fn check_recursive_call(&self, _where: &str) -> PyResult<()> {
342338
if self.recursion_depth.get() >= self.recursion_limit.get() {

0 commit comments

Comments
 (0)