diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-27 01:56:38 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-27 01:56:38 +0000 |
commit | 9c6deac2d1ea29002f4af33b9c1c15aa2d4c34b7 (patch) | |
tree | 27c26fc0361f7fd62cfdc5c8520f315bb78f7527 /vm_trace.c | |
parent | 969057c95a4d8c26cf58dd99dff3dbface11f1cd (diff) | |
download | bundler-9c6deac2d1ea29002f4af33b9c1c15aa2d4c34b7.tar.gz |
* vm_core.h: add rb_thread_t::local_storage_recursive_hash
to speed up Thread#[:__recursive_key__] access.
[Bug #10511]
* thread.c (threadptr_local_aref): add fast path for
:__recursive_data__.
* thread.c (threadptr_recursive_hash, threadptr_recursive_hash_set):
add special accessor for recursive hash.
* cont.c: store/restore local_storage_recursive_hash.
* vm.c: init and mark local_storage_recursive_hash.
* vm_trace.c (rb_threadptr_exec_event_hooks_orig): clear and restore
local_storage_recursive_hash directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vm_trace.c b/vm_trace.c index 5ee5bcaf4f..4fce3f37e3 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -329,8 +329,10 @@ rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p) trace_arg->self != rb_mRubyVMFrozenCore /* skip special methods. TODO: remove it. */) { const VALUE errinfo = th->errinfo; const int outer_state = th->state; - const VALUE old_recursive = rb_threadptr_reset_recursive_data(th); + const VALUE old_recursive = th->local_storage_recursive_hash; int state = 0; + + th->local_storage_recursive_hash = Qnil; th->state = 0; th->errinfo = Qnil; @@ -350,7 +352,7 @@ rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p) terminate: th->trace_arg = 0; th->vm->trace_running--; - rb_threadptr_restore_recursive_data(th, old_recursive); + th->local_storage_recursive_hash = old_recursive; if (state) { if (pop_p) { |