summaryrefslogtreecommitdiff
path: root/yjit/src/backend/x86_64
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2022-07-22 16:24:18 -0400
committerTakashi Kokubun <takashikkbn@gmail.com>2022-08-29 08:47:04 -0700
commit813df1f27aa52a3050d90dab23bc72093da00e6c (patch)
tree2a514fc12e2a224208eb43e4d080e8bdad802d39 /yjit/src/backend/x86_64
parent133ad38777db991e20a1feba1acbfe5d97cc2fa0 (diff)
Add LiveReg IR instruction to fix stats leave exit code (https://github.com/Shopify/ruby/pull/341)
It allows for reserving a specific register and prevents the register allocator from clobbering it. Without this `./miniruby --yjit-stats --yjit-callthreshold=1 -e0` was crashing because the counter incrementing code was clobbering RAX incorrectly.
Diffstat (limited to 'yjit/src/backend/x86_64')
-rw-r--r--yjit/src/backend/x86_64/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/yjit/src/backend/x86_64/mod.rs b/yjit/src/backend/x86_64/mod.rs
index 7b84e62134..5bae5c7f29 100644
--- a/yjit/src/backend/x86_64/mod.rs
+++ b/yjit/src/backend/x86_64/mod.rs
@@ -448,7 +448,8 @@ impl Assembler
Op::CSelGE => {
mov(cb, insn.out.into(), insn.opnds[0].into());
cmovl(cb, insn.out.into(), insn.opnds[1].into());
- },
+ }
+ Op::LiveReg => (), // just a reg alloc signal, no code
// We want to keep the panic here because some instructions that
// we feed to the backend could get lowered into other