summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2020-09-03 12:06:53 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:22 -0400
commit16c5ce863c06dd3ae5562f4ed86fb40ced670c69 (patch)
treea5153dbef5775eab4a7d28ca05fda694bdfac2ff /compile.c
parentcec197696f3edcff553373e9597130fde2d1f7be (diff)
Yeah, this actually works!
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 1e88dc242d..49263002e3 100644
--- a/compile.c
+++ b/compile.c
@@ -856,6 +856,8 @@ rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node)
return iseq_setup(iseq, ret);
}
+extern uint8_t *native_pop_code; // TODO global hack
+
static int
rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
{
@@ -868,6 +870,9 @@ rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
int insn = (int)iseq->body->iseq_encoded[i];
int len = insn_len(insn);
encoded[i] = (VALUE)table[insn];
+
+ if (insn == BIN(pop)) encoded[i] = (VALUE)native_pop_code;
+
i += len;
}
FL_SET((VALUE)iseq, ISEQ_TRANSLATED);