summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-30 18:04:35 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-30 18:04:35 +0000
commit6a69ad4df1719516a2da8b95872d3a44deae026c (patch)
tree805550c7516a6296d4d0a660c4e374b045e9c54b /compile.c
parenteb9aaa4c4fdaee9225e1843a71b5cdefaf179db6 (diff)
* yarvcore.h: some refactoring on rb_iseq_t.
rename some variable names, add comments, etc. * compile.c, iseq.c, proc.c, vm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/compile.c b/compile.c
index 72323e0c1f..8c77572751 100644
--- a/compile.c
+++ b/compile.c
@@ -227,10 +227,10 @@ iseq_translate_direct_threaded_code(rb_iseq_t *iseq)
#endif
int i;
- iseq->iseq_encoded = ALLOC_N(VALUE, iseq->size);
- MEMCPY(iseq->iseq_encoded, iseq->iseq, VALUE, iseq->size);
+ iseq->iseq_encoded = ALLOC_N(VALUE, iseq->iseq_size);
+ MEMCPY(iseq->iseq_encoded, iseq->iseq, VALUE, iseq->iseq_size);
- for (i = 0; i < iseq->size; /* */ ) {
+ for (i = 0; i < iseq->iseq_size; /* */ ) {
int insn = iseq->iseq_encoded[i];
int len = insn_len(insn);
iseq->iseq_encoded[i] = (VALUE)table[insn];
@@ -950,7 +950,7 @@ set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
LABEL *lobj;
INSN *iobj;
- struct insn_info_struct *insn_info_tbl;
+ struct insn_info_struct *insn_info_table;
LINK_ELEMENT *list;
VALUE *generated_iseq;
@@ -992,7 +992,7 @@ set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
/* make instruction sequence */
generated_iseq = ALLOC_N(VALUE, pos);
- insn_info_tbl = ALLOC_N(struct insn_info_struct, k);
+ insn_info_table = ALLOC_N(struct insn_info_struct, k);
list = FIRST_ELEMENT(anchor);
k = pos = sp = 0;
@@ -1122,8 +1122,8 @@ set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
return 0;
}
}
- insn_info_tbl[k].line_no = iobj->line_no;
- insn_info_tbl[k].position = pos;
+ insn_info_table[k].line_no = iobj->line_no;
+ insn_info_table[k].position = pos;
pos += len;
k++;
break;
@@ -1146,13 +1146,12 @@ set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
list = list->next;
}
- {
- iseq->iseq = (void *)generated_iseq;
- iseq->size = pos;
- iseq->insn_info_tbl = insn_info_tbl;
- iseq->insn_info_size = k;
- iseq->stack_max = stack_max;
- }
+ iseq->iseq = (void *)generated_iseq;
+ iseq->iseq_size = pos;
+ iseq->insn_info_table = insn_info_table;
+ iseq->insn_info_size = k;
+ iseq->stack_max = stack_max;
+
return COMPILE_OK;
}