summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-22 10:55:02 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-22 10:55:02 +0000
commit0d775f2a3c402310b71a581e368f347c52af78e5 (patch)
treebc30b3a636d69901ca2742534704d7acd0daefef /compile.c
parent2f5897e6b67d78d65c1aa3c9c16c0dfb65c38416 (diff)
* vm_core.h: separate rb_iseq_body into rb_iseq_constant_body and
rb_iseq_variable_body (rb_iseq_t::variable_body). rb_iseq_variable_body can be modified after compilation. * compile.c: use rb_iseq_t::variable_body. * iseq.c: ditto. * thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/compile.c b/compile.c
index 1011e54..f570a6d 100644
--- a/compile.c
+++ b/compile.c
@@ -225,9 +225,9 @@ r_value(VALUE value)
#define ADD_TRACE(seq, line, event) \
do { \
- if ((event) == RUBY_EVENT_LINE && iseq->body->coverage && \
+ if ((event) == RUBY_EVENT_LINE && iseq->variable_body->coverage && \
(line) != iseq->compile_data->last_coverable_line) { \
- RARRAY_ASET(iseq->body->coverage, (line) - 1, INT2FIX(0)); \
+ RARRAY_ASET(iseq->variable_body->coverage, (line) - 1, INT2FIX(0)); \
iseq->compile_data->last_coverable_line = (line); \
ADD_INSN1((seq), (line), trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \
@@ -608,26 +608,26 @@ rb_vm_insn_addr2insn(const void *addr) /* cold path */
VALUE *
rb_iseq_original_iseq(const rb_iseq_t *iseq) /* cold path */
{
- if (iseq->body->iseq) return iseq->body->iseq;
+ if (iseq->variable_body->iseq) return iseq->variable_body->iseq;
- iseq->body->iseq = ALLOC_N(VALUE, iseq->body->iseq_size);
+ iseq->variable_body->iseq = ALLOC_N(VALUE, iseq->body->iseq_size);
- MEMCPY(iseq->body->iseq, iseq->body->iseq_encoded, VALUE, iseq->body->iseq_size);
+ MEMCPY(iseq->variable_body->iseq, iseq->body->iseq_encoded, VALUE, iseq->body->iseq_size);
#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
{
unsigned int i;
for (i = 0; i < iseq->body->iseq_size; /* */ ) {
- const void *addr = (const void *)iseq->body->iseq[i];
+ const void *addr = (const void *)iseq->variable_body->iseq[i];
const int insn = rb_vm_insn_addr2insn(addr);
- iseq->body->iseq[i] = insn;
+ iseq->variable_body->iseq[i] = insn;
i += insn_len(insn);
}
}
#endif
- return iseq->body->iseq;
+ return iseq->variable_body->iseq;
}
/*********************************************/
@@ -5299,7 +5299,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
rb_num_t cnt;
VALUE key;
- cnt = local_iseq->body->flip_cnt++ + VM_SVAR_FLIPFLOP_START;
+ cnt = local_iseq->variable_body->flip_cnt++ + VM_SVAR_FLIPFLOP_START;
key = INT2FIX(cnt);
ADD_INSN2(ret, line, getspecial, key, INT2FIX(0));