diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2021-03-11 20:24:48 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2021-03-11 20:24:48 +0900 |
commit | de6072a22edbaab3793cf7f976cc9e0118d0df40 (patch) | |
tree | 08c22551519d9c01b02e45c888713dbf6107f855 /vm_args.c | |
parent | 0074ea2d83230e10ab0cd769fff203c13d3c592f (diff) |
merge revision(s) abdc634f64a440afcdc7f23c9757d27aab4db8a9,083c5f08ec4e95c9b75810d46f933928327a5ab3,1ecda213668644d656eb0d60654737482447dd92,813fe4c256f89babebb8ab53821ae5eb6bb138c6: [Backport #17497]
remove unused decl
---
internal/vm.h | 6 ------
vm_args.c | 2 --
2 files changed, 8 deletions(-)
Check stack overflow in recursive glob_helper [Bug #17162]
---
dir.c | 2 ++
internal/vm.h | 1 +
vm_eval.c | 10 ++++++++++
3 files changed, 13 insertions(+)
global call-cache cache table for rb_funcall*
rb_funcall* (rb_funcall(), rb_funcallv(), ...) functions invokes
Ruby's method with given receiver. Ruby 2.7 introduced inline method
cache with static memory area. However, Ruby 3.0 reimplemented the
method cache data structures and the inline cache was removed.
Without inline cache, rb_funcall* searched methods everytime.
Most of cases per-Class Method Cache (pCMC) will be helped but
pCMC requires VM-wide locking and it hurts performance on
multi-Ractor execution, especially all Ractors calls methods
with rb_funcall*.
This patch introduced Global Call-Cache Cache Table (gccct) for
rb_funcall*. Call-Cache was introduced from Ruby 3.0 to manage
method cache entry atomically and gccct enables method-caching
without VM-wide locking. This table solves the performance issue
on multi-ractor execution.
[Bug #17497]
Ruby-level method invocation does not use gccct because it has
inline-method-cache and the table size is limited. Basically
rb_funcall* is not used frequently, so 1023 entries can be enough.
We will revisit the table size if it is not enough.
---
debug_counter.h | 3 +
vm.c | 12 +++
vm_callinfo.h | 12 ---
vm_core.h | 5 +
vm_eval.c | 288 ++++++++++++++++++++++++++++++++++++++++++--------------
vm_insnhelper.c | 11 ++-
vm_method.c | 14 ++-
7 files changed, 255 insertions(+), 90 deletions(-)
opt_equality_by_mid for rb_equal_opt
This patch improves the performance of sequential and parallel
execution of rb_equal() (and rb_eql()).
[Bug #17497]
rb_equal_opt (and rb_eql_opt) does not have own cd and it waste
a time to initialize cd. This patch introduces opt_equality_by_mid()
to check equality without cd.
Furthermore, current master uses "static" cd on rb_equal_opt
(and rb_eql_opt) and it hurts CPU caches on multi-thread execution.
Now they are gone so there are no bottleneck on parallel execution.
---
vm_insnhelper.c | 99 ++++++++++++++++++++++++++++++++++++---------------------
1 file changed, 63 insertions(+), 36 deletions(-)
Diffstat (limited to 'vm_args.c')
-rw-r--r-- | vm_args.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -710,8 +710,6 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co return opt_pc; } -void rb_backtrace_use_iseq_first_lineno_for_last_location(VALUE self); /* vm_backtrace.c */ - static void raise_argument_error(rb_execution_context_t *ec, const rb_iseq_t *iseq, const VALUE exc) { |