diff options
author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2022-05-19 13:32:56 -0400 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 08:46:53 -0700 |
commit | 564f9503603ae261561193f69f1fbdef6a140aa1 (patch) | |
tree | 3d262af2a45e74df2098c5510ae33fe6d2e31893 /yjit/src/backend | |
parent | 99cfbdca6b7c2dd167137e7256cc861961969ffd (diff) | |
download | ruby-564f9503603ae261561193f69f1fbdef6a140aa1.tar.gz |
Make assembler methods public, sketch gen_dup with new backend
Diffstat (limited to 'yjit/src/backend')
-rw-r--r-- | yjit/src/backend/ir.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/yjit/src/backend/ir.rs b/yjit/src/backend/ir.rs index 7971f69842..d26eb289c6 100644 --- a/yjit/src/backend/ir.rs +++ b/yjit/src/backend/ir.rs @@ -311,7 +311,7 @@ pub struct Assembler impl Assembler { - fn new() -> Assembler { + pub fn new() -> Assembler { Assembler { insns: Vec::default(), live_ranges: Vec::default() @@ -348,7 +348,7 @@ impl Assembler } /// Add a comment at the current position - fn comment(&mut self, text: &str) + pub fn comment(&mut self, text: &str) { let insn = Insn { op: Op::Comment, @@ -363,7 +363,7 @@ impl Assembler } /// Add a label at the current position - fn label(&mut self, name: &str) -> Target + pub fn label(&mut self, name: &str) -> Target { let insn_idx = self.insns.len(); @@ -553,7 +553,7 @@ impl Assembler } // Optimize and compile the stored instructions - fn compile(self, cb: &mut CodeBlock) + pub fn compile(self, cb: &mut CodeBlock) { // NOTE: for arm we're going to want to split loads but also stores // This can be done in a platform-agnostic way, but the set of passes @@ -577,12 +577,12 @@ impl fmt::Debug for Assembler { impl Assembler { // Jump if not zero - fn jnz(&mut self, target: Target) + pub fn jnz(&mut self, target: Target) { self.push_insn(Op::Jnz, vec![], Some(target)); } - fn jbe(&mut self, target: Target) + pub fn jbe(&mut self, target: Target) { self.push_insn(Op::Jbe, vec![], Some(target)); } @@ -592,7 +592,7 @@ macro_rules! def_push_1_opnd { ($op_name:ident, $opcode:expr) => { impl Assembler { - fn $op_name(&mut self, opnd0: Opnd) -> Opnd + pub fn $op_name(&mut self, opnd0: Opnd) -> Opnd { self.push_insn($opcode, vec![opnd0], None) } @@ -604,7 +604,7 @@ macro_rules! def_push_2_opnd { ($op_name:ident, $opcode:expr) => { impl Assembler { - fn $op_name(&mut self, opnd0: Opnd, opnd1: Opnd) -> Opnd + pub fn $op_name(&mut self, opnd0: Opnd, opnd1: Opnd) -> Opnd { self.push_insn($opcode, vec![opnd0, opnd1], None) } @@ -616,7 +616,7 @@ macro_rules! def_push_2_opnd_no_out { ($op_name:ident, $opcode:expr) => { impl Assembler { - fn $op_name(&mut self, opnd0: Opnd, opnd1: Opnd) + pub fn $op_name(&mut self, opnd0: Opnd, opnd1: Opnd) { self.push_insn($opcode, vec![opnd0, opnd1], None); } |