From c55e10a9eaee956ac6fbc12d6962658a510a79ff Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sun, 12 Aug 2018 12:59:47 +0000 Subject: mjit.c: reduce the number of variables in mark_ec_units() to simplify code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mjit.c b/mjit.c index 5a087312bf..beb59d9646 100644 --- a/mjit.c +++ b/mjit.c @@ -192,22 +192,20 @@ create_unit(const rb_iseq_t *iseq) static void mark_ec_units(rb_execution_context_t *ec) { - const rb_iseq_t *iseq; const rb_control_frame_t *cfp; - rb_control_frame_t *last_cfp = ec->cfp; - const rb_control_frame_t *end_marker_cfp; - uintptr_t i, size; if (ec->vm_stack == NULL) return; - end_marker_cfp = RUBY_VM_END_CONTROL_FRAME(ec); - size = end_marker_cfp - last_cfp; - for (i = 0, cfp = end_marker_cfp - 1; i < size; i++, cfp = RUBY_VM_NEXT_CONTROL_FRAME(cfp)) { + for (cfp = RUBY_VM_END_CONTROL_FRAME(ec) - 1; ; cfp = RUBY_VM_NEXT_CONTROL_FRAME(cfp)) { + const rb_iseq_t *iseq; if (cfp->pc && (iseq = cfp->iseq) != NULL && imemo_type((VALUE) iseq) == imemo_iseq && (iseq->body->jit_unit) != NULL) { iseq->body->jit_unit->used_code_p = TRUE; } + + if (cfp == ec->cfp) + break; /* reached the most recent cfp */ } } -- cgit v1.2.3