summaryrefslogtreecommitdiff
diff options
authorJohn Hawthorn <[email protected]>2021-07-27 23:40:51 -0700
committerAlan Wu <[email protected]>2021-10-20 18:19:38 -0400
commita02002dc4f051515c0b65c17b2ed797bac454b56 (patch)
treed3cccae8ed67048dec97d7ce85c0842142a40c85
parent2e707ee66f484c11d4548011911ad17bec2063b9 (diff)
More detection of immediate constants
-rw-r--r--yjit_codegen.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/yjit_codegen.c b/yjit_codegen.c
index ebb75cbdad..388c8b1e17 100644
--- a/yjit_codegen.c
+++ b/yjit_codegen.c
@@ -128,9 +128,17 @@ jit_type_of_value(VALUE val)
return TYPE_FIXNUM;
} else if (NIL_P(val)) {
return TYPE_NIL;
+ } else if (val == Qtrue) {
+ return TYPE_TRUE;
+ } else if (val == Qfalse) {
+ return TYPE_FALSE;
+ } else if (STATIC_SYM_P(val)) {
+ return TYPE_STATIC_SYMBOL;
+ } else if (FLONUM_P(val)) {
+ return TYPE_FLONUM;
} else {
- // generic immediate
- return TYPE_IMM;
+ RUBY_ASSERT(false);
+ UNREACHABLE_RETURN(TYPE_IMM);
}
} else {
switch (BUILTIN_TYPE(val)) {