Skip to content

Commit fe357bb

Browse files
committed
reduce diff
1 parent 517430e commit fe357bb

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

imemo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ rb_imemo_mark_and_move(VALUE obj, bool reference_updating)
314314
}
315315
}
316316
else {
317-
if (vm_cc_orphan_p(cc) || vm_cc_refinement_p(cc)) {
317+
if (vm_cc_super_p(cc) || vm_cc_refinement_p(cc)) {
318318
rb_gc_mark_movable((VALUE)cc->cme_);
319319
rb_gc_mark_movable((VALUE)cc->klass);
320320
}
@@ -471,7 +471,7 @@ vm_ccs_free(struct rb_class_cc_entries *ccs, int alive, VALUE klass)
471471
}
472472
}
473473

474-
VM_ASSERT(!vm_cc_orphan_p(cc) && !vm_cc_refinement_p(cc));
474+
VM_ASSERT(!vm_cc_super_p(cc) && !vm_cc_refinement_p(cc));
475475
vm_cc_invalidate(cc);
476476
}
477477
ruby_xfree(ccs->entries);

vm_callinfo.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,12 @@ struct rb_callcache {
309309
/* VM_CALLCACHE_IVAR used for IVAR/ATTRSET/STRUCT_AREF/STRUCT_ASET methods */
310310
#define VM_CALLCACHE_IVAR IMEMO_FL_USER0
311311
#define VM_CALLCACHE_BF IMEMO_FL_USER1
312-
#define VM_CALLCACHE_ORPHAN IMEMO_FL_USER2
312+
#define VM_CALLCACHE_SUPER IMEMO_FL_USER2
313313
#define VM_CALLCACHE_REFINEMENT IMEMO_FL_USER3
314314

315315
enum vm_cc_type {
316316
cc_type_normal, // chained from ccs
317-
cc_type_orphan,
317+
cc_type_super,
318318
cc_type_refinement,
319319
};
320320

@@ -346,8 +346,8 @@ vm_cc_new(VALUE klass,
346346
switch (type) {
347347
case cc_type_normal:
348348
break;
349-
case cc_type_orphan:
350-
*(VALUE *)&cc->flags |= VM_CALLCACHE_ORPHAN;
349+
case cc_type_super:
350+
*(VALUE *)&cc->flags |= VM_CALLCACHE_SUPER;
351351
break;
352352
case cc_type_refinement:
353353
*(VALUE *)&cc->flags |= VM_CALLCACHE_REFINEMENT;
@@ -360,9 +360,9 @@ vm_cc_new(VALUE klass,
360360
}
361361

362362
static inline bool
363-
vm_cc_orphan_p(const struct rb_callcache *cc)
363+
vm_cc_super_p(const struct rb_callcache *cc)
364364
{
365-
return (cc->flags & VM_CALLCACHE_ORPHAN) != 0;
365+
return (cc->flags & VM_CALLCACHE_SUPER) != 0;
366366
}
367367

368368
static inline bool

vm_insnhelper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ vm_ccs_verify(struct rb_class_cc_entries *ccs, ID mid, VALUE klass)
20552055
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
20562056
VM_ASSERT(vm_cc_class_check(cc, klass));
20572057
VM_ASSERT(vm_cc_check_cme(cc, ccs->cme));
2058-
VM_ASSERT(!vm_cc_orphan_p(cc));
2058+
VM_ASSERT(!vm_cc_super_p(cc));
20592059
VM_ASSERT(!vm_cc_refinement_p(cc));
20602060
}
20612061
return TRUE;
@@ -4951,7 +4951,7 @@ vm_search_super_method(const rb_control_frame_t *reg_cfp, struct rb_call_data *c
49514951

49524952
if (!klass) {
49534953
/* bound instance method of module */
4954-
cc = vm_cc_new(klass, NULL, vm_call_method_missing, cc_type_orphan);
4954+
cc = vm_cc_new(klass, NULL, vm_call_method_missing, cc_type_super);
49554955
RB_OBJ_WRITE(reg_cfp->iseq, &cd->cc, cc);
49564956
}
49574957
else {
@@ -4966,7 +4966,7 @@ vm_search_super_method(const rb_control_frame_t *reg_cfp, struct rb_call_data *c
49664966
else if (cached_cme->called_id != mid) {
49674967
const rb_callable_method_entry_t *cme = rb_callable_method_entry(klass, mid);
49684968
if (cme) {
4969-
cc = vm_cc_new(klass, cme, vm_call_super_method, cc_type_orphan);
4969+
cc = vm_cc_new(klass, cme, vm_call_super_method, cc_type_super);
49704970
RB_OBJ_WRITE(reg_cfp->iseq, &cd->cc, cc);
49714971
}
49724972
else {

0 commit comments

Comments
 (0)