1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Check only symbol flag bits (#6301)

* Check only symbol flag bits

* Check all 4 bits
This commit is contained in:
Takashi Kokubun 2022-08-29 18:05:06 -07:00 committed by GitHub
parent 737402e938
commit ddca3482ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2022-08-30 10:05:38 +09:00
Merged-By: maximecb <maximecb@ruby-lang.org>

View file

@ -3454,7 +3454,8 @@ fn jit_guard_known_klass(
asm.comment("guard object is static symbol");
assert!(RUBY_SPECIAL_SHIFT == 8);
asm.cmp(obj_opnd, Opnd::UImm(RUBY_SYMBOL_FLAG as u64));
let flag_bits = asm.and(obj_opnd, Opnd::UImm(0xf));
asm.cmp(flag_bits, Opnd::UImm(RUBY_SYMBOL_FLAG as u64));
jit_chain_guard(JCC_JNE, jit, ctx, asm, ocb, max_chain_depth, side_exit);
ctx.upgrade_opnd_type(insn_opnd, Type::ImmSymbol);
}