ruby-changes:52113
From: k0kubun <ko1@a...>
Date: Sun, 12 Aug 2018 21:59:54 +0900 (JST)
Subject: [ruby-changes:52113] k0kubun:r64321 (trunk): mjit.c: reduce the number of variables
k0kubun 2018-08-12 21:59:47 +0900 (Sun, 12 Aug 2018) New Revision: 64321 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64321 Log: mjit.c: reduce the number of variables in mark_ec_units() to simplify code. Modified files: trunk/mjit.c Index: mjit.c =================================================================== --- mjit.c (revision 64320) +++ mjit.c (revision 64321) @@ -192,22 +192,20 @@ create_unit(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/mjit.c#L192 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 */ } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/