diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-13 11:25:44 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-13 11:25:44 +0000 |
commit | 038ef3f05cbddb484c181a8614b088d99014917b (patch) | |
tree | 9ced5364385c1e3a5fee3622f0002c6a7d331bef /vm.c | |
parent | 0f6794cb2329d9abca759a2db2717ea55ba3addf (diff) |
* vm_core.h, vm_insnhelper.h: move decl. of
ruby_vm_global_state_version and related macros
from vm_core.h to vm_insnhelper.h.
* vm.c (vm_clear_all_cache): added. This function is called
when ruby_vm_global_state_version overflows.
TODO: vm_clear_all_inline_method_cache() is only place holder.
We need to implement it ASAP.
* vm_method.c (vm_clear_global_method_cache): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -36,7 +36,6 @@ VALUE rb_cThread; VALUE rb_cEnv; VALUE rb_mRubyVMFrozenCore; -VALUE ruby_vm_global_state_version = 1; VALUE ruby_vm_const_missing_count = 0; char ruby_vm_redefined_flag[BOP_LAST_]; @@ -58,6 +57,25 @@ rb_vm_change_state(void) INC_VM_STATE_VERSION(); } +static void vm_clear_global_method_cache(void); + +static void +vm_clear_all_inline_method_cache(void) +{ + /* TODO: Clear all inline cache entries in all iseqs. + How to iterate all iseqs in sweep phase? + rb_objspace_each_objects() doesn't work at sweep phase. + */ +} + +static void +vm_clear_all_cache() +{ + vm_clear_global_method_cache(); + vm_clear_all_inline_method_cache(); + ruby_vm_global_state_version = 1; +} + void rb_vm_inc_const_missing_count(void) { |