aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-02 07:52:12 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-02 07:52:12 +0000
commit7afefea564bc6520962c9eaa457d85c19b64d13c (patch)
tree6c47b202124e1e32b07ef52c2830ddae9ca5d596 /iseq.c
parente917af64014746de9658e1a9ddb3fd134520c0e6 (diff)
downloadruby-7afefea564bc6520962c9eaa457d85c19b64d13c.tar.gz
* iseq.h: introduce ISEQ_COMPILE_DATA() macro.
* compile.c, iseq.c: use ISEQ_COMPILE_DATA(). * vm_core.h: rename compile_data field to support this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/iseq.c b/iseq.c
index cc7110ae14..269ca8a15c 100644
--- a/iseq.c
+++ b/iseq.c
@@ -91,7 +91,7 @@ rb_iseq_free(const rb_iseq_t *iseq)
ruby_xfree((void *)iseq->body->param.keyword->default_values);
ruby_xfree((void *)iseq->body->param.keyword);
}
- compile_data_free(iseq->compile_data);
+ compile_data_free(ISEQ_COMPILE_DATA(iseq));
ruby_xfree(iseq->variable_body->iseq);
ruby_xfree(iseq->variable_body);
ruby_xfree(iseq->body);
@@ -120,8 +120,8 @@ rb_iseq_mark(const rb_iseq_t *iseq)
RUBY_MARK_UNLESS_NULL(iseq->variable_body->coverage);
}
- if (iseq->compile_data != 0) {
- const struct iseq_compile_data *const compile_data = iseq->compile_data;
+ if (ISEQ_COMPILE_DATA(iseq) != 0) {
+ const struct iseq_compile_data *const compile_data = ISEQ_COMPILE_DATA(iseq);
RUBY_MARK_UNLESS_NULL(compile_data->mark_ary);
RUBY_MARK_UNLESS_NULL(compile_data->err_info);
@@ -199,7 +199,7 @@ iseq_memsize(const rb_iseq_t *iseq)
}
}
- compile_data = iseq->compile_data;
+ compile_data = ISEQ_COMPILE_DATA(iseq);
if (compile_data) {
struct iseq_compile_data_storage *cur;
@@ -294,22 +294,22 @@ prepare_iseq_build(rb_iseq_t *iseq,
}
RB_OBJ_WRITE(iseq, &iseq->body->mark_ary, 0);
- iseq->compile_data = ZALLOC(struct iseq_compile_data);
- RB_OBJ_WRITE(iseq, &iseq->compile_data->err_info, Qnil);
- RB_OBJ_WRITE(iseq, &iseq->compile_data->mark_ary, rb_ary_tmp_new(3));
+ ISEQ_COMPILE_DATA(iseq) = ZALLOC(struct iseq_compile_data);
+ RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, Qnil);
+ RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->mark_ary, rb_ary_tmp_new(3));
- iseq->compile_data->storage_head = iseq->compile_data->storage_current =
+ ISEQ_COMPILE_DATA(iseq)->storage_head = ISEQ_COMPILE_DATA(iseq)->storage_current =
(struct iseq_compile_data_storage *)
ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE +
SIZEOF_ISEQ_COMPILE_DATA_STORAGE);
- RB_OBJ_WRITE(iseq, &iseq->compile_data->catch_table_ary, rb_ary_tmp_new(3));
- iseq->compile_data->storage_head->pos = 0;
- iseq->compile_data->storage_head->next = 0;
- iseq->compile_data->storage_head->size =
+ RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, rb_ary_tmp_new(3));
+ ISEQ_COMPILE_DATA(iseq)->storage_head->pos = 0;
+ ISEQ_COMPILE_DATA(iseq)->storage_head->next = 0;
+ ISEQ_COMPILE_DATA(iseq)->storage_head->size =
INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE;
- iseq->compile_data->option = option;
- iseq->compile_data->last_coverable_line = -1;
+ ISEQ_COMPILE_DATA(iseq)->option = option;
+ ISEQ_COMPILE_DATA(iseq)->last_coverable_line = -1;
RB_OBJ_WRITE(iseq, &iseq->variable_body->coverage, Qfalse);
@@ -327,9 +327,9 @@ prepare_iseq_build(rb_iseq_t *iseq,
static VALUE
cleanup_iseq_build(rb_iseq_t *iseq)
{
- struct iseq_compile_data *data = iseq->compile_data;
+ struct iseq_compile_data *data = ISEQ_COMPILE_DATA(iseq);
VALUE err = data->err_info;
- iseq->compile_data = 0;
+ ISEQ_COMPILE_DATA(iseq) = 0;
compile_data_free(data);
if (RTEST(err)) {