summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-05-29 15:20:57 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-09 09:52:46 +0900
commit77293cef91a9aa424c086ae05f03211d9a8a87d3 (patch)
tree2aa46363231bbd9ec07a086d07695e1a44b63b8e /iseq.c
parent3928c151a63b273ff10feb43906d6590c6592d1a (diff)
vm_ci_markable: added
CIs are created on-the-fly, which increases GC pressure. However they include no references to other objects, and those on-the-fly CIs tend to be short lived. Why not skip allocation of them. In doing so we need to add a flag denotes the CI object does not reside inside of objspace.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3179
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/iseq.c b/iseq.c
index fe33afc1a6..90fb6702f3 100644
--- a/iseq.c
+++ b/iseq.c
@@ -325,9 +325,13 @@ rb_iseq_mark(const rb_iseq_t *iseq)
if (body->call_data) {
struct rb_call_data *cds = (struct rb_call_data *)body->call_data;
for (unsigned int i=0; i<body->ci_size; i++) {
- rb_gc_mark_movable((VALUE)cds[i].ci);
+ const struct rb_callinfo *ci = cds[i].ci;
const struct rb_callcache *cc = cds[i].cc;
- if (cc && vm_cc_markable(cds[i].cc)) {
+
+ if (vm_ci_markable(ci)) {
+ rb_gc_mark_movable((VALUE)ci);
+ }
+ if (cc && vm_cc_markable(cc)) {
rb_gc_mark_movable((VALUE)cc);
// TODO: check enable
}