Project

General

Profile

Misc #11447 ยป 0001-iseq-move-iseq-body-mark_ary-to-iseq-mark_ary.patch

normalperson (Eric Wong), 08/14/2015 07:29 PM

View differences:

iseq.c
RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(iseq->body->location.path));
RUBY_MARK_UNLESS_NULL(iseq->mark_ary);
if (iseq->body) {
const struct rb_iseq_constant_body *body = iseq->body;
RUBY_MARK_UNLESS_NULL(body->mark_ary);
rb_gc_mark(body->location.label);
rb_gc_mark(body->location.base_label);
rb_gc_mark(body->location.path);
......
void
rb_iseq_add_mark_object(const rb_iseq_t *iseq, VALUE obj)
{
if (!RTEST(iseq->body->mark_ary)) {
RB_OBJ_WRITE(iseq, &iseq->body->mark_ary, rb_ary_tmp_new(3));
RBASIC_CLEAR_CLASS(iseq->body->mark_ary);
if (!RTEST(iseq->mark_ary)) {
RB_OBJ_WRITE(iseq, &iseq->mark_ary, rb_ary_tmp_new(3));
RBASIC_CLEAR_CLASS(iseq->mark_ary);
}
rb_ary_push(iseq->body->mark_ary, obj);
rb_ary_push(iseq->mark_ary, obj);
}
static VALUE
......
if (iseq != iseq->body->local_iseq) {
RB_OBJ_WRITE(iseq, &iseq->body->location.base_label, iseq->body->local_iseq->body->location.label);
}
RB_OBJ_WRITE(iseq, &iseq->body->mark_ary, 0);
RB_OBJ_WRITE(iseq, &iseq->mark_ary, 0);
iseq->compile_data = ZALLOC(struct iseq_compile_data);
RB_OBJ_WRITE(iseq, &iseq->compile_data->err_info, Qnil);
vm_core.h
union iseq_inline_storage_entry *is_entries;
rb_call_info_t *callinfo_entries;
const VALUE mark_ary; /* Array: includes operands which should be GC marked */
unsigned int local_table_size;
unsigned int is_size;
......
struct iseq_compile_data *compile_data; /* used at compile time */
struct rb_iseq_constant_body *body;
struct rb_iseq_variable_body *variable_body;
VALUE dummy2;
const VALUE mark_ary; /* Array: includes operands which should be GC marked */
};
enum ruby_special_exceptions {
-
    (1-1/1)