зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
3be63cd978
Коммит
5f2a4d15a7
|
@ -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));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче