summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-17 15:28:37 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-17 15:28:37 (GMT)
commit2f678334738c31c52da0c8b951e2a171494121be (patch)
treeccd4cd99db8f3d10635971cfaa3d07baf7548a2c /iseq.c
parent9869ec7a7d5c1b044b2ee8df59a86653d7ad1053 (diff)
iseq.c: dump as non-trace instructions
* iseq.c (iseq_data_to_ary): when OPT_CALL_THREADED_CODE is used, iseq_encoded is overwritten by instructions with trace and the original_iseq is not stored. convert these instructions to the original instructions as external representation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/iseq.c b/iseq.c
index 5c67e1c..e58da59 100644
--- a/iseq.c
+++ b/iseq.c
@@ -2220,7 +2220,7 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
VALUE exception = rb_ary_new(); /* [[....]] */
VALUE misc = rb_hash_new();
- static VALUE insn_syms[VM_INSTRUCTION_SIZE];
+ static VALUE insn_syms[VM_INSTRUCTION_SIZE/2]; /* w/o-trace only */
struct st_table *labels_table = st_init_numtable();
DECL_SYMBOL(top);
@@ -2235,7 +2235,7 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
if (sym_top == 0) {
int i;
- for (i=0; i<VM_INSTRUCTION_SIZE; i++) {
+ for (i=0; i<numberof(insn_syms); i++) {
insn_syms[i] = ID2SYM(rb_intern(insn_name(i)));
}
INIT_SYMBOL(top);
@@ -2331,7 +2331,7 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
VALUE *nseq = seq + len - 1;
VALUE ary = rb_ary_new2(len);
- rb_ary_push(ary, insn_syms[insn]);
+ rb_ary_push(ary, insn_syms[insn%numberof(insn_syms)]);
for (j=0; j<len-1; j++, seq++) {
switch (insn_op_type(insn, j)) {
case TS_OFFSET: {