aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/iseq.c b/iseq.c
index 469ae117c8..679bdb7a2d 100644
--- a/iseq.c
+++ b/iseq.c
@@ -183,20 +183,20 @@ static rb_iseq_location_t *
iseq_location_setup(rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name, size_t first_lineno)
{
rb_iseq_location_t *loc = &iseq->location;
- OBJ_WRITE(iseq->self, &loc->path, path);
+ RB_OBJ_WRITE(iseq->self, &loc->path, path);
if (RTEST(absolute_path) && rb_str_cmp(path, absolute_path) == 0) {
- OBJ_WRITE(iseq->self, &loc->absolute_path, path);
+ RB_OBJ_WRITE(iseq->self, &loc->absolute_path, path);
}
else {
- OBJ_WRITE(iseq->self, &loc->absolute_path, absolute_path);
+ RB_OBJ_WRITE(iseq->self, &loc->absolute_path, absolute_path);
}
- OBJ_WRITE(iseq->self, &loc->label, name);
- OBJ_WRITE(iseq->self, &loc->base_label, name);
+ RB_OBJ_WRITE(iseq->self, &loc->label, name);
+ RB_OBJ_WRITE(iseq->self, &loc->base_label, name);
loc->first_lineno = first_lineno;
return loc;
}
-#define ISEQ_SET_CREF(iseq, cref) OBJ_WRITE((iseq)->self, &(iseq)->cref_stack, (cref))
+#define ISEQ_SET_CREF(iseq, cref) RB_OBJ_WRITE((iseq)->self, &(iseq)->cref_stack, (cref))
static void
set_relation(rb_iseq_t *iseq, const VALUE parent)
@@ -208,14 +208,14 @@ set_relation(rb_iseq_t *iseq, const VALUE parent)
/* set class nest stack */
if (type == ISEQ_TYPE_TOP) {
/* toplevel is private */
- OBJ_WRITE(iseq->self, &iseq->cref_stack, NEW_CREF(rb_cObject));
+ RB_OBJ_WRITE(iseq->self, &iseq->cref_stack, NEW_CREF(rb_cObject));
iseq->cref_stack->nd_refinements = Qnil;
iseq->cref_stack->nd_visi = NOEX_PRIVATE;
if (th->top_wrapper) {
NODE *cref = NEW_CREF(th->top_wrapper);
cref->nd_refinements = Qnil;
cref->nd_visi = NOEX_PRIVATE;
- OBJ_WRITE(cref, &cref->nd_next, iseq->cref_stack);
+ RB_OBJ_WRITE(cref, &cref->nd_next, iseq->cref_stack);
ISEQ_SET_CREF(iseq, cref);
}
iseq->local_iseq = iseq;
@@ -245,7 +245,7 @@ void
rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj)
{
if (!RTEST(iseq->mark_ary)) {
- OBJ_WRITE(iseq->self, &iseq->mark_ary, rb_ary_tmp_new(3));
+ RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, rb_ary_tmp_new(3));
RBASIC_CLEAR_CLASS(iseq->mark_ary);
}
rb_ary_push(iseq->mark_ary, obj);
@@ -261,7 +261,7 @@ prepare_iseq_build(rb_iseq_t *iseq,
iseq->arg_rest = -1;
iseq->arg_block = -1;
iseq->arg_keyword = -1;
- OBJ_WRITE(iseq->self, &iseq->klass, 0);
+ RB_OBJ_WRITE(iseq->self, &iseq->klass, 0);
set_relation(iseq, parent);
name = rb_fstring(name);
@@ -271,11 +271,11 @@ prepare_iseq_build(rb_iseq_t *iseq,
iseq_location_setup(iseq, path, absolute_path, name, first_lineno);
if (iseq != iseq->local_iseq) {
- OBJ_WRITE(iseq->self, &iseq->location.base_label, iseq->local_iseq->location.label);
+ RB_OBJ_WRITE(iseq->self, &iseq->location.base_label, iseq->local_iseq->location.label);
}
iseq->defined_method_id = 0;
- OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
+ RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
/*
* iseq->special_block_builder = GC_GUARDED_PTR_REF(block_opt);
@@ -285,15 +285,15 @@ prepare_iseq_build(rb_iseq_t *iseq,
iseq->compile_data = ALLOC(struct iseq_compile_data);
MEMZERO(iseq->compile_data, struct iseq_compile_data, 1);
- OBJ_WRITE(iseq->self, &iseq->compile_data->err_info, Qnil);
- OBJ_WRITE(iseq->self, &iseq->compile_data->mark_ary, rb_ary_tmp_new(3));
+ RB_OBJ_WRITE(iseq->self, &iseq->compile_data->err_info, Qnil);
+ RB_OBJ_WRITE(iseq->self, &iseq->compile_data->mark_ary, rb_ary_tmp_new(3));
iseq->compile_data->storage_head = iseq->compile_data->storage_current =
(struct iseq_compile_data_storage *)
ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE +
sizeof(struct iseq_compile_data_storage));
- OBJ_WRITE(iseq->self, &iseq->compile_data->catch_table_ary, rb_ary_new());
+ RB_OBJ_WRITE(iseq->self, &iseq->compile_data->catch_table_ary, rb_ary_new());
iseq->compile_data->storage_head->pos = 0;
iseq->compile_data->storage_head->next = 0;
iseq->compile_data->storage_head->size =
@@ -303,12 +303,12 @@ prepare_iseq_build(rb_iseq_t *iseq,
iseq->compile_data->option = option;
iseq->compile_data->last_coverable_line = -1;
- OBJ_WRITE(iseq->self, &iseq->coverage, Qfalse);
+ RB_OBJ_WRITE(iseq->self, &iseq->coverage, Qfalse);
if (!GET_THREAD()->parse_in_eval) {
VALUE coverages = rb_get_coverages();
if (RTEST(coverages)) {
- OBJ_WRITE(iseq->self, &iseq->coverage, rb_hash_lookup(coverages, path));
- if (NIL_P(iseq->coverage)) OBJ_WRITE(iseq->self, &iseq->coverage, Qfalse);
+ RB_OBJ_WRITE(iseq->self, &iseq->coverage, rb_hash_lookup(coverages, path));
+ if (NIL_P(iseq->coverage)) RB_OBJ_WRITE(iseq->self, &iseq->coverage, Qfalse);
}
}
@@ -1923,19 +1923,19 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
iseq1->self = newiseq;
if (!iseq1->orig) {
- OBJ_WRITE(iseq1->self, &iseq1->orig, iseqval);
+ RB_OBJ_WRITE(iseq1->self, &iseq1->orig, iseqval);
}
if (iseq0->local_iseq == iseq0) {
iseq1->local_iseq = iseq1;
}
if (newcbase) {
ISEQ_SET_CREF(iseq1, NEW_CREF(newcbase));
- OBJ_WRITE(iseq1->cref_stack, &iseq1->cref_stack->nd_refinements, iseq0->cref_stack->nd_refinements);
+ RB_OBJ_WRITE(iseq1->cref_stack, &iseq1->cref_stack->nd_refinements, iseq0->cref_stack->nd_refinements);
iseq1->cref_stack->nd_visi = iseq0->cref_stack->nd_visi;
if (iseq0->cref_stack->nd_next) {
- OBJ_WRITE(iseq1->cref_stack, &iseq1->cref_stack->nd_next, iseq0->cref_stack->nd_next);
+ RB_OBJ_WRITE(iseq1->cref_stack, &iseq1->cref_stack->nd_next, iseq0->cref_stack->nd_next);
}
- OBJ_WRITE(iseq1, &iseq1->klass, newcbase);
+ RB_OBJ_WRITE(iseq1, &iseq1->klass, newcbase);
}
return newiseq;
@@ -2087,10 +2087,10 @@ rb_iseq_build_for_ruby2cext(
/* copy iseq */
MEMCPY(iseq, iseq_template, rb_iseq_t, 1); /* TODO: write barrier, *iseq = *iseq_template; */
- OBJ_WRITE(iseq->self, &iseq->location.label, rb_str_new2(name));
- OBJ_WRITE(iseq->self, &iseq->location.path, rb_str_new2(path));
+ RB_OBJ_WRITE(iseq->self, &iseq->location.label, rb_str_new2(name));
+ RB_OBJ_WRITE(iseq->self, &iseq->location.path, rb_str_new2(path));
iseq->location.first_lineno = first_lineno;
- OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
+ RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
iseq->self = iseqval;
iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);