Project

General

Profile

Feature #16282 ยป 0001-Wrap-call-data-with-an-IMEMO-object.patch

tenderlovemaking (Aaron Patterson), 10/29/2019 12:13 AM

View differences:

ext/objspace/objspace.c
imemo_type_ids[8] = rb_intern("imemo_tmpbuf");
imemo_type_ids[9] = rb_intern("imemo_ast");
imemo_type_ids[10] = rb_intern("imemo_parser_strterm");
imemo_type_ids[11] = rb_intern("imemo_call_data");
}
rb_objspace_each_objects(count_imemo_objects_i, (void *)hash);
ext/objspace/objspace_dump.c
TYPE_STR(tmpbuf);
TYPE_STR(ast);
TYPE_STR(parser_strterm);
TYPE_STR(call_data);
default:
return "unknown";
#undef TYPE_STR
gc.c
case imemo_ifunc:
case imemo_memo:
case imemo_parser_strterm:
case imemo_call_data:
break;
default:
/* unreachable */
......
case imemo_parser_strterm:
RB_DEBUG_COUNTER_INC(obj_imemo_parser_strterm);
break;
case imemo_call_data:
RB_DEBUG_COUNTER_INC(obj_imemo_call_data);
break;
default:
/* unreachable */
break;
......
case imemo_parser_strterm:
rb_strterm_mark(obj);
return;
case imemo_call_data:
return;
#if VM_CHECK_MODE > 0
default:
VM_UNREACHABLE(gc_mark_imemo);
......
break;
case imemo_parser_strterm:
case imemo_tmpbuf:
case imemo_call_data:
break;
default:
rb_bug("not reachable %d", imemo_type(obj));
internal.h
imemo_iseq = 7,
imemo_tmpbuf = 8,
imemo_ast = 9,
imemo_parser_strterm = 10
imemo_parser_strterm = 10,
imemo_call_data = 11
};
#define IMEMO_MASK 0x0f
......
struct rb_call_cache cc;
struct rb_call_info ci;
};
VALUE rb_funcallv_with_cc(struct rb_call_data*, VALUE, ID, int, const VALUE*)
#if GCC_VERSION_SINCE(3, 3, 0) && defined(__OPTIMIZE__)
__attribute__((__visibility__("default"), __nonnull__(1)))
# define rb_funcallv(recv, mid, argc, argv) \
__extension__({ \
static struct rb_call_data rb_funcallv_data = { { 0, }, { 0, }, }; \
static VALUE wrapper = 0; \
if (!wrapper) { \
wrapper = rb_imemo_new(imemo_call_data, 0, 0, 0, (VALUE)&rb_funcallv_data); \
rb_gc_register_mark_object(wrapper); \
} \
rb_funcallv_with_cc(&rb_funcallv_data, recv, mid, argc, argv); \
})
#endif
    (1-1/1)