diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-20 22:33:25 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-20 22:33:25 +0900 |
| commit | 58b25fdcb3bf92050296a624abc4934b83fab01c (patch) | |
| tree | c639a65d5a92326ea519803cc2e73efb1a39a2bd /src/vm.c | |
| parent | 7320139fd91ce86a6e58d56a25e04136b87bbd9a (diff) | |
| download | mruby-58b25fdcb3bf92050296a624abc4934b83fab01c.tar.gz mruby-58b25fdcb3bf92050296a624abc4934b83fab01c.zip | |
avoid unnecessary pool/syms restoration
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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; |
