diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-22 06:50:42 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-22 06:50:42 +0000 |
commit | 7e5d63f48308c470b026de9b89a8e094f94363e0 (patch) | |
tree | 126449a178375b876f1a029546b5351792420f1a /vm.c | |
parent | 9438bc0c86d984838dd7fe3761520832c8e5bb14 (diff) | |
download | ruby-7e5d63f48308c470b026de9b89a8e094f94363e0.tar.gz |
* compile.c (rb_iseq_compile_node): accept NODE_IFUNC to support
custom compilation.
* compile.c (NODE_POSTEXE): compile to
"ONCE{ VMFrozenCore::core#set_postexe{...} }" with a new custom
compiler `build_postexe_iseq()'.
* vm.c (m_core_set_postexe): remove parameters (passed by a block).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 18 |
1 files changed, 3 insertions, 15 deletions
@@ -2128,21 +2128,9 @@ m_core_undef_method(VALUE self, VALUE cbase, VALUE sym) } static VALUE -m_core_set_postexe(VALUE self, VALUE block_iseqval, VALUE is_index_val) +m_core_set_postexe(VALUE self) { - int is_index = FIX2INT(is_index_val); - rb_thread_t *th = GET_THREAD(); - rb_iseq_t *iseq = rb_vm_get_ruby_level_next_cfp(th, th->cfp)->iseq; - union iseq_inline_storage_entry *is = &iseq->is_entries[is_index]; - - REWIND_CFP({ - if (is->once.done != Qtrue) { - rb_iseq_t *block_iseq; - GetISeqPtr(block_iseqval, block_iseq); - rb_set_end_proc(rb_call_end_proc, vm_make_proc_with_iseq(block_iseq)); - is->once.done = Qtrue; - } - }); + rb_set_end_proc(rb_call_end_proc, rb_block_proc()); return Qnil; } @@ -2284,7 +2272,7 @@ Init_VM(void) rb_define_method_id(klass, id_core_undef_method, m_core_undef_method, 2); rb_define_method_id(klass, id_core_define_method, m_core_define_method, 3); rb_define_method_id(klass, id_core_define_singleton_method, m_core_define_singleton_method, 3); - rb_define_method_id(klass, id_core_set_postexe, m_core_set_postexe, 2); + rb_define_method_id(klass, id_core_set_postexe, m_core_set_postexe, 0); rb_define_method_id(klass, id_core_hash_from_ary, m_core_hash_from_ary, 1); rb_define_method_id(klass, id_core_hash_merge_ary, m_core_hash_merge_ary, 2); rb_define_method_id(klass, id_core_hash_merge_ptr, m_core_hash_merge_ptr, -1); |