mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* insnhelper.ci (vm_setup_method): reorder code for branch prediction.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
343c363d5b
commit
2ca7ad139f
2 changed files with 20 additions and 16 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Sun Aug 26 06:04:13 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* insnhelper.ci (vm_setup_method): reorder code for branch prediction.
|
||||||
|
|
||||||
Sun Aug 26 05:54:49 2007 Koichi Sasada <ko1@atdot.net>
|
Sun Aug 26 05:54:49 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* insnhelper.ci (vm_call_method): fix to relaxant safe level check
|
* insnhelper.ci (vm_call_method): fix to relaxant safe level check
|
||||||
|
|
|
@ -425,7 +425,22 @@ vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp,
|
||||||
/* stack overflow check */
|
/* stack overflow check */
|
||||||
CHECK_STACK_OVERFLOW(cfp, iseq->stack_max + 0x10);
|
CHECK_STACK_OVERFLOW(cfp, iseq->stack_max + 0x10);
|
||||||
|
|
||||||
if (flag & VM_CALL_TAILCALL_BIT) {
|
if (LIKELY(!(flag & VM_CALL_TAILCALL_BIT))) {
|
||||||
|
if (0) printf("local_size: %d, arg_size: %d\n",
|
||||||
|
iseq->local_size, iseq->arg_size);
|
||||||
|
|
||||||
|
/* clear local variables */
|
||||||
|
for (i = 0; i < iseq->local_size - iseq->arg_size; i++) {
|
||||||
|
*sp++ = Qnil;
|
||||||
|
}
|
||||||
|
|
||||||
|
vm_push_frame(th, iseq,
|
||||||
|
FRAME_MAGIC_METHOD, recv, (VALUE) blockptr,
|
||||||
|
iseq->iseq_encoded + opt_pc, sp, 0, 0);
|
||||||
|
|
||||||
|
cfp->sp = rsp - 1 /* recv */;
|
||||||
|
}
|
||||||
|
else {
|
||||||
VALUE *p_rsp;
|
VALUE *p_rsp;
|
||||||
cfp = ++th->cfp; /* pop cf */
|
cfp = ++th->cfp; /* pop cf */
|
||||||
p_rsp = th->cfp->sp;
|
p_rsp = th->cfp->sp;
|
||||||
|
@ -446,21 +461,6 @@ vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp,
|
||||||
FRAME_MAGIC_METHOD, recv, (VALUE) blockptr,
|
FRAME_MAGIC_METHOD, recv, (VALUE) blockptr,
|
||||||
iseq->iseq_encoded + opt_pc, sp, 0, 0);
|
iseq->iseq_encoded + opt_pc, sp, 0, 0);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (0) printf("local_size: %d, arg_size: %d\n",
|
|
||||||
iseq->local_size, iseq->arg_size);
|
|
||||||
|
|
||||||
/* clear local variables */
|
|
||||||
for (i = 0; i < iseq->local_size - iseq->arg_size; i++) {
|
|
||||||
*sp++ = Qnil;
|
|
||||||
}
|
|
||||||
|
|
||||||
vm_push_frame(th, iseq,
|
|
||||||
FRAME_MAGIC_METHOD, recv, (VALUE) blockptr,
|
|
||||||
iseq->iseq_encoded + opt_pc, sp, 0, 0);
|
|
||||||
|
|
||||||
cfp->sp = rsp - 1 /* recv */;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline VALUE
|
static inline VALUE
|
||||||
|
|
Loading…
Add table
Reference in a new issue