summaryrefslogtreecommitdiff
path: root/yjit.c
diff options
context:
space:
mode:
Diffstat (limited to 'yjit.c')
-rw-r--r--yjit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/yjit.c b/yjit.c
index d5071cb952..cf6d81092f 100644
--- a/yjit.c
+++ b/yjit.c
@@ -871,6 +871,19 @@ rb_yjit_fix_mod_fix(VALUE recv, VALUE obj)
return rb_fix_mod_fix(recv, obj);
}
+// Return non-zero when `obj` is an array and its last item is a
+// `ruby2_keywords` hash. We don't support this kind of splat.
+size_t
+rb_yjit_ruby2_keywords_splat_p(VALUE obj)
+{
+ if (!RB_TYPE_P(obj, T_ARRAY)) return 0;
+ long len = RARRAY_LEN(obj);
+ if (len == 0) return 0;
+ VALUE last = RARRAY_AREF(obj, len - 1);
+ if (!RB_TYPE_P(last, T_HASH)) return 0;
+ return FL_TEST_RAW(last, RHASH_PASS_AS_KEYWORDS);
+}
+
// Print the Ruby source location of some ISEQ for debugging purposes
void
rb_yjit_dump_iseq_loc(const rb_iseq_t *iseq, uint32_t insn_idx)