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 /cont.c | |
parent | 969057c95a4d8c26cf58dd99dff3dbface11f1cd (diff) | |
download | ruby-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 'cont.c')
-rw-r--r-- | cont.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -459,6 +459,7 @@ cont_init(rb_context_t *cont, rb_thread_t *th) cont->saved_thread.machine.stack_maxsize = th->machine.stack_maxsize; cont->saved_thread.fiber = th->fiber; cont->saved_thread.local_storage = 0; + cont->saved_thread.local_storage_recursive_hash = Qnil; } static rb_context_t * @@ -563,6 +564,7 @@ cont_restore_thread(rb_context_t *cont) th->stack = sth->stack; th->stack_size = sth->stack_size; th->local_storage = sth->local_storage; + th->local_storage_recursive_hash = sth->local_storage_recursive_hash; th->fiber = (rb_fiber_t*)cont; } @@ -1208,6 +1210,7 @@ fiber_init(VALUE fibval, VALUE proc) th->cfp->me = 0; th->tag = 0; th->local_storage = st_init_numtable(); + th->local_storage_recursive_hash = Qnil; th->first_proc = proc; |