diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-25 16:29:26 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-25 16:29:26 +0000 |
commit | 9987d53e519cf84fe47ffbbd4f48be0bc40938c7 (patch) | |
tree | 1cbd036967f588026bf6038c39898fa20a531e4b /iseq.c | |
parent | e98f7e1eaa18c33d211e6a0cf245eaf4b175c3c7 (diff) | |
download | ruby-9987d53e519cf84fe47ffbbd4f48be0bc40938c7.tar.gz |
* yarvcore.h: add rb_thread_t#top_wrapper, top_self.
* eval_load.c (rb_load): support eval in wrapper module
(load(file, true)).
* eval.c: ditto.
* eval_jump.h: ditto.
* iseq.c: ditto.
* vm.c: ditto.
* yarvcore.c: ditto.
* insns.def: add a empty line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -107,12 +107,14 @@ prepare_iseq_build(rb_iseq_t *iseq, VALUE parent, VALUE type, VALUE block_opt, const rb_compile_option_t *option) { + rb_thread_t *th = GET_THREAD(); + iseq->name = name; iseq->defined_method_id = 0; iseq->filename = filename; iseq->iseq_mark_ary = rb_ary_new(); RBASIC(iseq->iseq_mark_ary)->klass = 0; - + iseq->type = type; iseq->arg_rest = 0; iseq->arg_block = 0; @@ -124,7 +126,7 @@ prepare_iseq_build(rb_iseq_t *iseq, /* set class nest stack */ if (type == ISEQ_TYPE_TOP) { /* toplevel is private */ - iseq->cref_stack = NEW_BLOCK(rb_cObject); + iseq->cref_stack = NEW_BLOCK(th->top_wrapper ? th->top_wrapper : rb_cObject); iseq->cref_stack->nd_file = 0; iseq->cref_stack->nd_visi = NOEX_PRIVATE; } @@ -144,17 +146,17 @@ prepare_iseq_build(rb_iseq_t *iseq, RBASIC(iseq->compile_data->mark_ary)->klass = 0; iseq->compile_data->storage_head = iseq->compile_data->storage_current = - (struct iseq_compile_data_storage *) - ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE + + (struct iseq_compile_data_storage *) + ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE + sizeof(struct iseq_compile_data_storage)); iseq->compile_data->catch_table_ary = rb_ary_new(); iseq->compile_data->storage_head->pos = 0; iseq->compile_data->storage_head->next = 0; iseq->compile_data->storage_head->size = - INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE; + INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE; iseq->compile_data->storage_head->buff = - (char *)(&iseq->compile_data->storage_head->buff + 1); + (char *)(&iseq->compile_data->storage_head->buff + 1); iseq->compile_data->option = option; if (type == ISEQ_TYPE_TOP || |