summaryrefslogtreecommitdiff
path: root/yjit/src
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-20 10:57:40 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-20 22:05:27 +0900
commitf55212bce939f736559709a8cd16c409772389c8 (patch)
tree93e8bd23eb1317ccbc16faf685fb9a4138470f29 /yjit/src
parent1e66d3b8532539a53cf97bcca477d0a8b4b426bc (diff)
Move "special consts" so `Qundef` and `Qnil` differ just 1 bit
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6599
Diffstat (limited to 'yjit/src')
-rw-r--r--yjit/src/codegen.rs3
-rw-r--r--yjit/src/cruby.rs4
2 files changed, 3 insertions, 4 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 66750335f3..196baf9689 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -3219,8 +3219,7 @@ fn gen_branchif(
};
// Test if any bit (outside of the Qnil bit) is on
- // RUBY_Qfalse /* ...0000 0000 */
- // RUBY_Qnil /* ...0000 1000 */
+ // See RB_TEST()
let val_type = ctx.get_opnd_type(StackOpnd(0));
let val_opnd = ctx.stack_pop(1);
diff --git a/yjit/src/cruby.rs b/yjit/src/cruby.rs
index d3e4ba4757..81db0deab3 100644
--- a/yjit/src/cruby.rs
+++ b/yjit/src/cruby.rs
@@ -597,11 +597,11 @@ where
#[allow(non_upper_case_globals)]
pub const Qfalse: VALUE = VALUE(0);
#[allow(non_upper_case_globals)]
-pub const Qnil: VALUE = VALUE(8);
+pub const Qnil: VALUE = VALUE(4);
#[allow(non_upper_case_globals)]
pub const Qtrue: VALUE = VALUE(20);
#[allow(non_upper_case_globals)]
-pub const Qundef: VALUE = VALUE(52);
+pub const Qundef: VALUE = VALUE(0x24);
#[allow(unused)]
mod manual_defs {