1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm_insnhelper.c (vm_setup_method): refactoring.

Remove src_argc and use iseq->arg_size directly.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2012-09-28 08:58:22 +00:00
parent 948169c5be
commit 2adb9fd4a5
2 changed files with 11 additions and 7 deletions

View file

@ -1,3 +1,8 @@
Fri Sep 28 17:54:31 2012 Koichi Sasada <ko1@atdot.net>
* vm_insnhelper.c (vm_setup_method): refactoring.
Remove src_argc and use iseq->arg_size directly.
Fri Sep 28 17:26:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
* lib/rubygems/installer.rb (check_that_user_bin_dir_is_in_path):

View file

@ -496,16 +496,16 @@ vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp,
const rb_method_entry_t *me, VALUE defined_class)
{
int opt_pc, i;
VALUE *sp, *argv = cfp->sp - argc;
VALUE *argv = cfp->sp - argc;
rb_iseq_t *iseq = me->def->body.iseq;
VM_CALLEE_SETUP_ARG(opt_pc, th, iseq, argc, argv, &blockptr);
/* stack overflow check */
CHECK_STACK_OVERFLOW(cfp, iseq->stack_max);
sp = argv + iseq->arg_size;
if (LIKELY(!(flag & VM_CALL_TAILCALL_BIT))) {
VALUE *sp = argv + iseq->arg_size;
/* clear local variables */
for (i = 0; i < iseq->local_size - iseq->arg_size; i++) {
@ -520,19 +520,18 @@ vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp,
}
else {
VALUE *src_argv = argv;
VALUE *sp_orig;
const int src_argc = iseq->arg_size;
VALUE *sp_orig, *sp;
VALUE finish_flag = VM_FRAME_TYPE_FINISH_P(cfp) ? VM_FRAME_FLAG_FINISH : 0;
cfp = th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp); /* pop cf */
sp = sp_orig = cfp->sp;
cfp = th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp); /* pop cf */
sp_orig = sp = cfp->sp;
/* push self */
sp[0] = recv;
sp++;
/* copy arguments */
for (i=0; i < src_argc; i++) {
for (i=0; i < iseq->arg_size; i++) {
*sp++ = src_argv[i];
}