From 5f2a4d15a7564f85c086362a1ffbf1ed5623a46b Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 15 Dec 2014 19:09:25 +0000 Subject: [PATCH] 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 --- compile.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compile.c b/compile.c index f65c041529..9230935819 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, ""); 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)); }