diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-06 12:24:58 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-06 12:24:58 +0000 |
commit | d84f9b16946bca06ce0557ebe99152d7d445c9ec (patch) | |
tree | 8141a5d835d1e5638231aced09a08c74ff8fadae /vm_core.h | |
parent | e0f5a6ab4850e2745d5cb6fb081eb81dc024d2d4 (diff) |
* fix namespace issue on singleton class expressions. [Bug #10943]
* vm_core.h, method.h: remove rb_iseq_t::cref_stack. CREF is stored
to rb_method_definition_t::body.iseq_body.cref.
* vm_insnhelper.c: modify SVAR usage.
When calling ISEQ type method, push CREF information onto method
frame, SVAR located place. Before this fix, SVAR is simply nil.
After this patch, CREF (or NULL == Qfalse for not iseq methods)
is stored at the method invocation.
When SVAR is requierd, then put NODE_IF onto SVAR location,
and NDOE_IF::nd_reserved points CREF itself.
* vm.c (vm_cref_new, vm_cref_dump, vm_cref_new_toplevel): added.
* vm_insnhelper.c (vm_push_frame): accept CREF.
* method.h, vm_method.c (rb_add_method_iseq): added. This function
accepts iseq and CREF.
* class.c (clone_method): use rb_add_method_iseq().
* gc.c (mark_method_entry): mark method_entry::body.iseq_body.cref.
* iseq.c: remove CREF related codes.
* insns.def (getinlinecache/setinlinecache): CREF should be cache key
because a different CREF has a different namespace.
* node.c (rb_gc_mark_node): mark NODE_IF::nd_reserved for SVAR.
* proc.c: catch up changes.
* struct.c: ditto.
* insns.def: ditto.
* vm_args.c (raise_argument_error): ditto.
* vm_eval.c: ditto.
* test/ruby/test_class.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -117,6 +117,7 @@ typedef struct rb_compile_option_struct rb_compile_option_t; struct iseq_inline_cache_entry { rb_serial_t ic_serial; + NODE *ic_cref; union { size_t index; VALUE value; @@ -322,17 +323,6 @@ struct rb_iseq_struct { VALUE self; const VALUE orig; /* non-NULL if its data have origin */ - - /* block inlining */ - /* - * NODE *node; - * void *special_block_builder; - * void *cached_special_block_builder; - * VALUE cached_special_block; - */ - - /* klass/module nest information stack (cref) */ - NODE * const cref_stack; const VALUE klass; /* misc */ @@ -416,7 +406,6 @@ typedef struct rb_vm_struct { /* object management */ VALUE mark_object_ary; - const VALUE special_exceptions[ruby_special_error_count]; /* load */ |