diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-28 09:40:46 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-28 09:40:46 +0000 |
commit | 7e35c2e2d0ba1b0a0d3df190df45158044a2620d (patch) | |
tree | 9b49f0e5b8658b3e441d7de5118f25f62870bd5d /iseq.c | |
parent | f54ed7a794f5814f16ae7d070febe0f152ea319f (diff) |
merges r21088 from trunk into ruby_1_(_1.
* iseq.h, iseq.c (rb_iseq_new_main): add a type ISEQ_TYPE_MAIN.
[ruby-dev:37619]
* compile.c (rb_dvar_defined, ruby_iseq_compile): ditto.
* iseq.c (iseq_data_to_ary, iseq_load): ditto.
* compile.c (iseq_compile_each): fix to check ip->compile_data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -316,7 +316,7 @@ rb_iseq_new_main(NODE *node, VALUE filename) rb_thread_t *th = GET_THREAD(); VALUE parent = th->base_block->iseq->self; return rb_iseq_new_with_opt(node, rb_str_new2("<main>"), filename, - parent, ISEQ_TYPE_EVAL, &COMPILE_OPTION_DEFAULT); + parent, ISEQ_TYPE_MAIN, &COMPILE_OPTION_DEFAULT); } static VALUE @@ -411,6 +411,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt) st_insert(type_map, ID2SYM(rb_intern("rescue")), ISEQ_TYPE_RESCUE); st_insert(type_map, ID2SYM(rb_intern("ensure")), ISEQ_TYPE_ENSURE); st_insert(type_map, ID2SYM(rb_intern("eval")), ISEQ_TYPE_EVAL); + st_insert(type_map, ID2SYM(rb_intern("main")), ISEQ_TYPE_MAIN); st_insert(type_map, ID2SYM(rb_intern("defined_guard")), ISEQ_TYPE_DEFINED_GUARD); } @@ -1028,6 +1029,7 @@ iseq_data_to_ary(rb_iseq_t *iseq) DECL_SYMBOL(rescue); DECL_SYMBOL(ensure); DECL_SYMBOL(eval); + DECL_SYMBOL(main); DECL_SYMBOL(defined_guard); if (sym_top == 0) { @@ -1042,6 +1044,7 @@ iseq_data_to_ary(rb_iseq_t *iseq) INIT_SYMBOL(rescue); INIT_SYMBOL(ensure); INIT_SYMBOL(eval); + INIT_SYMBOL(main); INIT_SYMBOL(defined_guard); } @@ -1054,6 +1057,7 @@ iseq_data_to_ary(rb_iseq_t *iseq) case ISEQ_TYPE_RESCUE: type = sym_rescue; break; case ISEQ_TYPE_ENSURE: type = sym_ensure; break; case ISEQ_TYPE_EVAL: type = sym_eval; break; + case ISEQ_TYPE_MAIN: type = sym_main; break; case ISEQ_TYPE_DEFINED_GUARD: type = sym_defined_guard; break; default: rb_bug("unsupported iseq type"); }; |