* vm_insnhelper.c: refactoring.

- move all `call' related functions to the last of file.
  - make functions for respective method types in vm_call_method().
  (all functions have same function parameters)
* vm_core.h: add `opt_pc' filed in `rb_call_info_t'
  as temporal variable.
* vm_eval.c (vm_call0_body): catch up above cahnges.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2012-10-14 19:58:59 +00:00
parent fd3b0dec4a
commit 8f08e61bad
4 changed files with 793 additions and 731 deletions

View File

@ -1,3 +1,15 @@
Mon Oct 15 04:51:55 2012 Koichi Sasada <ko1@atdot.net>
* vm_insnhelper.c: refactoring.
- move all `call' related functions to the last of file.
- make functions for respective method types in vm_call_method().
(all functions have same function parameters)
* vm_core.h: add `opt_pc' filed in `rb_call_info_t'
as temporal variable.
* vm_eval.c (vm_call0_body): catch up above cahnges.
Mon Oct 15 03:51:46 2012 Koichi Sasada <ko1@atdot.net> Mon Oct 15 03:51:46 2012 Koichi Sasada <ko1@atdot.net>
* benchmark/bm_vm1_attr_ivar(_set).rb: added (for method dispatch speed). * benchmark/bm_vm1_attr_ivar(_set).rb: added (for method dispatch speed).

View File

@ -160,8 +160,10 @@ typedef struct rb_call_info_struct {
/* temporary values for method calling */ /* temporary values for method calling */
int argc; int argc;
int opt_pc;
struct rb_block_struct *blockptr; struct rb_block_struct *blockptr;
VALUE recv; VALUE recv;
VALUE (*call)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_call_info_struct *ci); VALUE (*call)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_call_info_struct *ci);
} rb_call_info_t; } rb_call_info_t;

View File

@ -78,7 +78,7 @@ vm_call0_body(rb_thread_t* th, rb_call_info_t *ci, const VALUE *argv)
*reg_cfp->sp++ = argv[i]; *reg_cfp->sp++ = argv[i];
} }
vm_setup_method(th, reg_cfp, ci); vm_call_iseq_setup(th, reg_cfp, ci);
th->cfp->flag |= VM_FRAME_FLAG_FINISH; th->cfp->flag |= VM_FRAME_FLAG_FINISH;
val = vm_exec(th); val = vm_exec(th);
break; break;
@ -115,7 +115,7 @@ vm_call0_body(rb_thread_t* th, rb_call_info_t *ci, const VALUE *argv)
break; break;
} }
case VM_METHOD_TYPE_BMETHOD: { case VM_METHOD_TYPE_BMETHOD: {
val = vm_call_bmethod(th, ci->recv, ci->argc, argv, ci->blockptr, ci->me, ci->defined_class); val = vm_call_bmethod_body(th, ci, argv);
break; break;
} }
case VM_METHOD_TYPE_ZSUPER: case VM_METHOD_TYPE_ZSUPER:

File diff suppressed because it is too large Load Diff