summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-04 06:24:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-04 06:24:38 +0000
commitae34216021b1f627f99f8845c8376ad54ccdfa08 (patch)
tree507b2073a6687ae7788cbdc3edbef6530c98a34c
parentac44ae58c697971e14e72493da2cfdd9a4e3b458 (diff)
vm.c: trivial optimization
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--vm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/vm.c b/vm.c
index fdd6fabe4b..f333b51f67 100644
--- a/vm.c
+++ b/vm.c
@@ -1808,8 +1808,8 @@ vm_exec(rb_execution_context_t *ec, int mjit_enable_p)
_tag.retval = Qnil;
if ((state = EC_EXEC_TAG()) == TAG_NONE) {
- if (mjit_enable_p)
- result = mjit_exec(ec);
+ if (!mjit_enable_p || (result = mjit_exec(ec)) == Qundef)
+ result = vm_exec_core(ec, initial);
goto vm_loop_start; /* fallback to the VM */
}
else {
@@ -1817,9 +1817,8 @@ vm_exec(rb_execution_context_t *ec, int mjit_enable_p)
rb_ec_raised_reset(ec, RAISED_STACKOVERFLOW);
while ((result = handle_exception(ec, state, result, &initial)) == Qundef) {
/* caught a jump, exec the handler */
+ result = vm_exec_core(ec, initial);
vm_loop_start:
- if (result == Qundef)
- result = vm_exec_core(ec, initial);
VM_ASSERT(ec->tag == &_tag);
/* when caught `throw`, `tag.state` is set. */
if ((state = _tag.state) == TAG_NONE) break;