summaryrefslogtreecommitdiff
path: root/tool/ruby_vm/loaders
diff options
context:
space:
mode:
author卜部昌平 <[email protected]>2019-10-07 12:59:57 +0900
committer卜部昌平 <[email protected]>2019-11-07 17:41:30 +0900
commitd45a013a1a3bcc860e6f7f303220b3297e2abdbc (patch)
tree9dd459d6b41542cdfcd75cede71a96e06981e3e0 /tool/ruby_vm/loaders
parent3c252651e1ee28d015dbe1648dfdf0140232b733 (diff)
extend rb_call_cache
Prior to this changeset, majority of inline cache mishits resulted into the same method entry when rb_callable_method_entry() resolves a method search. Let's not call the function at the first place on such situations. In doing so we extend the struct rb_call_cache from 44 bytes (in case of 64 bit machine) to 64 bytes, and fill the gap with secondary class serial(s). Call cache's class serials now behavies as a LRU cache. Calculating ------------------------------------- ours 2.7 2.6 vm2_poly_same_method 2.339M 1.744M 1.369M i/s - 6.000M times in 2.565086s 3.441329s 4.381386s Comparison: vm2_poly_same_method ours: 2339103.0 i/s 2.7: 1743512.3 i/s - 1.34x slower 2.6: 1369429.8 i/s - 1.71x slower
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2583
Diffstat (limited to 'tool/ruby_vm/loaders')
-rw-r--r--tool/ruby_vm/loaders/insns_def.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/ruby_vm/loaders/insns_def.rb b/tool/ruby_vm/loaders/insns_def.rb
index a29d13a661..47e4ba29f5 100644
--- a/tool/ruby_vm/loaders/insns_def.rb
+++ b/tool/ruby_vm/loaders/insns_def.rb
@@ -21,7 +21,7 @@ grammar = %r'
(?<keyword> typedef | extern | static | auto | register |
struct | union | enum ){0}
(?<C> (?: \g<block> | [^{}]+ )* ){0}
- (?<block> \{ \g<ws>* ^ \g<C> $ \g<ws>* \} ){0}
+ (?<block> \{ \g<ws>* \g<C> \g<ws>* \} ){0}
(?<ws> \g<comment> | \s ){0}
(?<ident> [_a-zA-Z] [0-9_a-zA-Z]* ){0}
(?<type> (?: \g<keyword> \g<ws>+ )* \g<ident> ){0}