summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2020-09-10 14:31:45 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:23 -0400
commit566d4abee5e8e59ce6e080f28a25b7c3431c5b3b (patch)
treed18e08e5d103fb5e7194b4e241218d6c7c2163fa /compile.c
parentfe1cd076da74be8077509fab5a401060ce1c17a4 (diff)
Added shift instructions
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/compile.c b/compile.c
index 49263002e3..a1983eaecb 100644
--- a/compile.c
+++ b/compile.c
@@ -866,14 +866,20 @@ rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
unsigned int i;
VALUE *encoded = (VALUE *)iseq->body->iseq_encoded;
- for (i = 0; i < iseq->body->iseq_size; /* */ ) {
- int insn = (int)iseq->body->iseq_encoded[i];
- int len = insn_len(insn);
- encoded[i] = (VALUE)table[insn];
+ for (i = 0; i < iseq->body->iseq_size; /* */ )
+ {
+ 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;
+
+ const char* name = insn_name(insn);
+ printf("%s\n", name);
- if (insn == BIN(pop)) encoded[i] = (VALUE)native_pop_code;
- i += len;
+ i += len;
}
FL_SET((VALUE)iseq, ISEQ_TRANSLATED);
#endif