From 58b25fdcb3bf92050296a624abc4934b83fab01c Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 20 May 2013 22:33:25 +0900 Subject: avoid unnecessary pool/syms restoration --- src/vm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/vm.c b/src/vm.c index 31fdfe816..de0afb41a 100644 --- a/src/vm.c +++ b/src/vm.c @@ -920,10 +920,12 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) if (mrb->exc) goto L_RAISE; /* pop stackpos */ ci = mrb->c->ci; - if (!MRB_PROC_CFUNC_P(ci[-1].proc)) { - irep = ci[-1].proc->body.irep; - pool = irep->pool; - syms = irep->syms; + if (!ci->target_class) { /* return from context modifying method (resume/yield) */ + if (!MRB_PROC_CFUNC_P(ci[-1].proc)) { + irep = ci[-1].proc->body.irep; + pool = irep->pool; + syms = irep->syms; + } } regs = mrb->c->stack = mrb->c->stbase + ci->stackidx; pc = ci->pc; -- cgit v1.2.3