diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-26 06:14:44 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-26 06:14:44 +0000 |
commit | 931574010102b4bd9db6cfb17b840e28b26030e6 (patch) | |
tree | 39b4acd08cfce1f46c50c6d8409c0b22a248f7c0 /vm.c | |
parent | 8bfcdf323f1843237140e9f119496b93557eaefd (diff) | |
download | ruby-931574010102b4bd9db6cfb17b840e28b26030e6.tar.gz |
* cont.c (rb_fiber_s_new): revert initializing VM stack.
* yarvcore.c (th_init2): ditto.
* vm.c, vm.h: fix to stop using Qundef on VM stack. According to
this change, VM stack should not include Qundef value.
* insns.def (putundef): removed.
* compile.c (iseq_compile_each): ditto.
* eval.c (eval): fix spacing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -190,7 +190,7 @@ vm_make_env_each(rb_thread_t *th, rb_control_frame_t *cfp, VALUE *nenvptr; int i, local_size; - if (ENV_IN_HEAP_P(envptr)) { + if (ENV_IN_HEAP_P(th, envptr)) { return ENV_VAL(envptr); } @@ -198,7 +198,7 @@ vm_make_env_each(rb_thread_t *th, rb_control_frame_t *cfp, VALUE *penvptr = GC_GUARDED_PTR_REF(*envptr); rb_control_frame_t *pcfp = cfp; - if (ENV_IN_HEAP_P(penvptr)) { + if (ENV_IN_HEAP_P(th, penvptr)) { penvval = ENV_VAL(penvptr); } else { @@ -227,7 +227,7 @@ vm_make_env_each(rb_thread_t *th, rb_control_frame_t *cfp, local_size = cfp->iseq->local_size; } - env->env_size = local_size + 1 + 4; + env->env_size = local_size + 1 + 2; env->local_size = local_size; env->env = ALLOC_N(VALUE, env->env_size); env->prev_envval = penvval; @@ -243,10 +243,8 @@ vm_make_env_each(rb_thread_t *th, rb_control_frame_t *cfp, *envptr = envval; /* GC mark */ nenvptr = &env->env[i - 1]; - nenvptr[1] = Qfalse; /* frame is not orphan */ - nenvptr[2] = Qundef; /* frame is in heap */ - nenvptr[3] = envval; /* frame self */ - nenvptr[4] = penvval; /* frame prev env object */ + nenvptr[1] = envval; /* frame self */ + nenvptr[2] = penvval; /* frame prev env object */ /* reset lfp/dfp in cfp */ cfp->dfp = nenvptr; @@ -296,7 +294,7 @@ collect_local_variables_in_env(rb_env_t *env, VALUE ary) int vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *dfp, VALUE ary) { - if (ENV_IN_HEAP_P(dfp)) { + if (ENV_IN_HEAP_P(th, dfp)) { rb_env_t *env; GetEnvPtr(ENV_VAL(dfp), env); collect_local_variables_in_env(env, ary); @@ -313,6 +311,7 @@ vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp) VALUE envval; envval = vm_make_env_each(th, cfp, cfp->dfp, cfp->lfp); + if (PROCDEBUG) { check_env_value(envval); } |