From 7fafa8f376a4be7ba6ed7f9ea9c549847fae0d79 Mon Sep 17 00:00:00 2001 From: charliesome Date: Tue, 29 Oct 2013 00:52:38 +0000 Subject: * insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: split ruby_vm_global_state_version into two separate counters - one for the global method state and one for the global constant state. This means changes to constants do not affect method caches, and changes to methods do not affect constant caches. In particular, this means inclusions of modules containing constants no longer globally invalidate the method cache. * class.c, eval.c, include/ruby/intern.h, insns.def, vm.c, vm_method.c: rename rb_clear_cache_by_class to rb_clear_method_cache_by_class * class.c, include/ruby/intern.h, variable.c, vm_method.c: add rb_clear_constant_cache * compile.c, vm_core.h, vm_insnhelper.c: rename vmstat field in rb_call_info_struct to method_state * vm_method.c: rename vmstat field in struct cache_entry to method_state git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- insns.def | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'insns.def') diff --git a/insns.def b/insns.def index 740ff5dfa7..fcd8c2c503 100644 --- a/insns.def +++ b/insns.def @@ -218,7 +218,6 @@ setconstant { vm_check_if_namespace(cbase); rb_const_set(cbase, id, val); - rb_clear_cache_by_class(cbase); } /** @@ -974,8 +973,6 @@ defineclass class_iseq->iseq_encoded, GET_SP(), class_iseq->local_size, 0, class_iseq->stack_max); RESTORE_REGS(); - - rb_clear_cache_by_class(klass); NEXT_INSN(); } @@ -1186,7 +1183,7 @@ getinlinecache () (VALUE val) { - if (ic->ic_vmstat == GET_VM_STATE_VERSION()) { + if (ic->ic_vmstat == GET_CONSTANT_STATE_VERSION()) { val = ic->ic_value.value; JUMP(dst); } @@ -1211,7 +1208,7 @@ setinlinecache rb_iseq_add_mark_object(GET_ISEQ(), val); } ic->ic_value.value = val; - ic->ic_vmstat = GET_VM_STATE_VERSION() - ruby_vm_const_missing_count; + ic->ic_vmstat = GET_CONSTANT_STATE_VERSION() - ruby_vm_const_missing_count; ruby_vm_const_missing_count = 0; } -- cgit v1.2.3