aboutsummaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-28 04:05:36 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-28 04:05:36 +0000
commitd50483df23383caf098c23c25c133f4eefca5917 (patch)
treed2e94e5ec61e548687a0b67d06a0662063650a31 /vm.c
parent8124d67988ea5aa995f1721446c229a83a8b356d (diff)
downloadruby-d50483df23383caf098c23c25c133f4eefca5917.tar.gz
* vm_core.h: remove rb_control_frame_t::bp (bp: base pointer).
`bp' can be calculate by `sp' (stack pointer) of previous frame. Now, `bp_check' field is remained for debug. You can eliminate this field by setting VM_DEBUG_BP_CHECK as 0. * vm_insnhelper.c (vm_base_ptr): add `vm_base_ptr(cfp). This function calculates base pointer from cfp. * vm_insnhelper.c (vm_setup_method): push `recv' value on top of value stack (before method parameters). This change is for keeping consistency with normal method dispatch. * insns.def: fix to use vm_base_ptr(). * vm.c (vm_exec): ditto. * vm_dump.c: remove `bp' related dumps. * cont.c (fiber_init): fix to check VM_DEBUG_BP_CHECK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm.c b/vm.c
index c59ef0b895..348d1349fa 100644
--- a/vm.c
+++ b/vm.c
@@ -1272,7 +1272,7 @@ vm_exec(rb_thread_t *th)
}
else if (entry->type == type) {
cfp->pc = cfp->iseq->iseq_encoded + entry->cont;
- cfp->sp = cfp->bp + entry->sp;
+ cfp->sp = vm_base_ptr(cfp) + entry->sp;
if (state != TAG_REDO) {
#if OPT_STACK_CACHING
@@ -1317,7 +1317,7 @@ vm_exec(rb_thread_t *th)
/* enter catch scope */
GetISeqPtr(catch_iseqval, catch_iseq);
- cfp->sp = cfp->bp + cont_sp;
+ cfp->sp = vm_base_ptr(cfp) + cont_sp;
cfp->pc = cfp->iseq->iseq_encoded + cont_pc;
/* push block frame */