diff options
| author | Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> | 2022-07-20 14:50:00 -0400 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 08:47:02 -0700 |
| commit | f833d75bee13ecb485db1591898cb871b24a2991 (patch) | |
| tree | 42a7084ceb61a2be4b1d5e2e86b4e843cf985da9 /yjit/src/backend | |
| parent | f5f58d82834cf84fe15dd1b28754923404a9fc75 (diff) | |
Refactor YJIT branches to use PosMarker (https://github.com/Shopify/ruby/pull/333)
* Refactor defer_compilation to use PosMarker
* Port gen_direct_jump() to use PosMarker
* Port gen_branch, branchunless
* Port over gen_jump()
* Port over branchif and branchnil
* Fix use od record_boundary_patch_point in jump_to_next_insn
Diffstat (limited to 'yjit/src/backend')
| -rw-r--r-- | yjit/src/backend/arm64/mod.rs | 3 | ||||
| -rw-r--r-- | yjit/src/backend/ir.rs | 2 | ||||
| -rw-r--r-- | yjit/src/backend/x86_64/mod.rs | 8 |
3 files changed, 13 insertions, 0 deletions
diff --git a/yjit/src/backend/arm64/mod.rs b/yjit/src/backend/arm64/mod.rs index c5ddbea7c1..35026a520b 100644 --- a/yjit/src/backend/arm64/mod.rs +++ b/yjit/src/backend/arm64/mod.rs @@ -637,6 +637,9 @@ impl Assembler Op::Je => { emit_conditional_jump::<{Condition::EQ}>(cb, insn.target.unwrap()); }, + Op::Jne => { + emit_conditional_jump::<{Condition::NE}>(cb, insn.target.unwrap()); + }, Op::Jbe => { emit_conditional_jump::<{Condition::LS}>(cb, insn.target.unwrap()); }, diff --git a/yjit/src/backend/ir.rs b/yjit/src/backend/ir.rs index 8d58da88f2..c55a8f609b 100644 --- a/yjit/src/backend/ir.rs +++ b/yjit/src/backend/ir.rs @@ -102,6 +102,7 @@ pub enum Op // Low-level conditional jump instructions Jbe, Je, + Jne, Jz, Jnz, Jo, @@ -883,6 +884,7 @@ macro_rules! def_push_2_opnd_no_out { def_push_1_opnd_no_out!(jmp_opnd, Op::JmpOpnd); def_push_jcc!(jmp, Op::Jmp); def_push_jcc!(je, Op::Je); +def_push_jcc!(jne, Op::Jne); def_push_jcc!(jbe, Op::Jbe); def_push_jcc!(jz, Op::Jz); def_push_jcc!(jnz, Op::Jnz); diff --git a/yjit/src/backend/x86_64/mod.rs b/yjit/src/backend/x86_64/mod.rs index 2fb7e39346..2efe920ddf 100644 --- a/yjit/src/backend/x86_64/mod.rs +++ b/yjit/src/backend/x86_64/mod.rs @@ -367,6 +367,14 @@ impl Assembler } } + Op::Jne => { + match insn.target.unwrap() { + Target::CodePtr(code_ptr) => jne_ptr(cb, code_ptr), + Target::Label(label_idx) => jne_label(cb, label_idx), + _ => unreachable!() + } + } + Op::Jbe => { match insn.target.unwrap() { Target::CodePtr(code_ptr) => jbe_ptr(cb, code_ptr), |
