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 --- vm_insnhelper.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vm_insnhelper.h') diff --git a/vm_insnhelper.h b/vm_insnhelper.h index 1c0d046587..674e6cad64 100644 --- a/vm_insnhelper.h +++ b/vm_insnhelper.h @@ -260,10 +260,10 @@ enum vm_regan_acttype { } while (0) #define NEXT_CLASS_SEQUENCE() (++ruby_vm_sequence) -#define GET_VM_STATE_VERSION() (ruby_vm_global_state_version) -#define INC_VM_STATE_VERSION() do { \ - ruby_vm_global_state_version = (ruby_vm_global_state_version + 1); \ -} while (0) +#define GET_METHOD_STATE_VERSION() (ruby_vm_method_state_version) +#define INC_METHOD_STATE_VERSION() (++ruby_vm_method_state_version) +#define GET_CONSTANT_STATE_VERSION() (ruby_vm_constant_state_version) +#define INC_CONSTANT_STATE_VERSION() (++ruby_vm_constant_state_version) static VALUE make_no_method_exception(VALUE exc, const char *format, VALUE obj, int argc, const VALUE *argv); -- cgit v1.2.3