summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-15 19:09:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-15 19:09:25 +0000
commit5f2a4d15a7564f85c086362a1ffbf1ed5623a46b (patch)
tree8be55d7fedeb478d8c0ad61ecc0a37900bbaa17e /compile.c
parent3be63cd978a2aa37b59705e9f207d76c190f72fd (diff)
compile.c: support for TS_FUNCPTR
* compile.c (iseq_set_sequence): support for TS_FUNCPTR. * compile.c (insn_data_to_s_detail): ditto. * compile.c (iseq_build_from_ary_body): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index f65c041..9230935 100644
--- a/compile.c
+++ b/compile.c
@@ -1599,6 +1599,9 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
generated_iseq[pos + 1 + j] = (VALUE)entry;
}
break;
+ case TS_FUNCPTR:
+ generated_iseq[pos + 1 + j] = operands[j];
+ break;
default:
rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
"unknown operand type: %c", type);
@@ -5600,6 +5603,9 @@ insn_data_to_s_detail(INSN *iobj)
case TS_CDHASH: /* case/when condition cache */
rb_str_cat2(str, "<ch>");
break;
+ case TS_FUNCPTR:
+ rb_str_catf(str, "<%p>", (rb_insn_func_t)OPERAND_AT(iobj, j));
+ break;
default:{
rb_raise(rb_eSyntaxError, "unknown operand type: %c", type);
}
@@ -5943,6 +5949,9 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
iseq_add_mark_object_compile_time(iseq, map);
}
break;
+ case TS_FUNCPTR:
+ argv[j] = op;
+ break;
default:
rb_raise(rb_eSyntaxError, "unknown operand: %c", insn_op_type((VALUE)insn_id, j));
}