diff --git a/ChangeLog b/ChangeLog index f76b030f0d..b42fd82408 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Jul 31 22:50:23 2011 Kazuki Tsujimoto + + * vm.c (vm_make_env_each): don't save prev env value. + It is no longer used. [Feature #4871] [ruby-dev:43743] + + * vm.c (check_env): changed accordingly. + Sun Jul 31 20:21:36 2011 "Yuki Sonoda (Yugui)" * common.mk (ECHO1): ":" in a make variable replacement cause a syntax diff --git a/vm.c b/vm.c index 3f2b52420f..376b17c1c3 100644 --- a/vm.c +++ b/vm.c @@ -217,7 +217,6 @@ ruby_vm_run_at_exit_hooks(rb_vm_t *vm) env{ env[0] // special (block or prev env) env[1] // env object - env[2] // prev env val }; */ @@ -305,17 +304,13 @@ check_env(rb_env_t * const env) { printf("---\n"); printf("envptr: %p\n", (void *)&env->block.dfp[0]); - printf("orphan: %p\n", (void *)env->block.dfp[1]); - printf("inheap: %p\n", (void *)env->block.dfp[2]); - printf("envval: %10p ", (void *)env->block.dfp[3]); - dp(env->block.dfp[3]); - printf("penvv : %10p ", (void *)env->block.dfp[4]); - dp(env->block.dfp[4]); + printf("envval: %10p ", (void *)env->block.dfp[1]); + dp(env->block.dfp[1]); printf("lfp: %10p\n", (void *)env->block.lfp); printf("dfp: %10p\n", (void *)env->block.dfp); - if (env->block.dfp[4]) { + if (env->prev_envval) { printf(">>\n"); - check_env_value(env->block.dfp[4]); + check_env_value(env->prev_envval); printf("<<\n"); } return 1; @@ -379,7 +374,7 @@ vm_make_env_each(rb_thread_t * const th, rb_control_frame_t * const cfp, local_size = cfp->iseq->local_size; } - env->env_size = local_size + 1 + 2; + env->env_size = local_size + 1 + 1; env->local_size = local_size; env->env = ALLOC_N(VALUE, env->env_size); env->prev_envval = penvval; @@ -398,7 +393,6 @@ vm_make_env_each(rb_thread_t * const th, rb_control_frame_t * const cfp, *envptr = envval; /* GC mark */ nenvptr = &env->env[i - 1]; nenvptr[1] = envval; /* frame self */ - nenvptr[2] = penvval; /* frame prev env object */ /* reset lfp/dfp in cfp */ cfp->dfp = nenvptr;