diff options
author | Maxime Chevalier-Boisvert <[email protected]> | 2025-02-06 14:16:46 -0500 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2025-04-18 21:52:56 +0900 |
commit | d1b4bd4acac9df0e5fcc6097a44bc096fe1e69ac (patch) | |
tree | 9bd6be7774302cdf2bb11e8c3c70ea49d7c8e5c1 | |
parent | 2b9570a24c88bb592760c40fd755d5fb6053c674 (diff) |
Move RubyOpcode
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
-rw-r--r-- | zjit/src/ir.rs | 24 | ||||
-rw-r--r-- | zjit/src/lib.rs | 1 |
2 files changed, 13 insertions, 12 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs index 1e6154d520..29f737e65a 100644 --- a/zjit/src/ir.rs +++ b/zjit/src/ir.rs @@ -26,8 +26,10 @@ struct BranchEdge { enum Insn { // SSA block parameter. Also used for function parameters in the function's entry block. Param { idx: usize }, + StringCopy { val: Opnd }, StringIntern { val: Opnd }, + AllocArray { count: usize }, ArraySet { idx: usize, val: Opnd }, @@ -79,17 +81,6 @@ impl Function { } } -enum RubyOpcode { - Putnil, - Putobject(VALUE), - Putstring(VALUE), - Intern, - Setlocal(usize), - Getlocal(usize), - Newarray(usize), - Leave, -} - struct FrameState { // TODO: // Ruby bytecode instruction pointer @@ -131,6 +122,17 @@ impl FrameState { } } +// TODO: get rid of this, currently used for testing only +enum RubyOpcode { + Putnil, + Putobject(VALUE), + Putstring(VALUE), + Intern, + Setlocal(usize), + Getlocal(usize), + Newarray(usize), + Leave, +} fn to_ssa(opcodes: &Vec<RubyOpcode>) -> Function { let mut result = Function::new(); let mut state = FrameState::new(); diff --git a/zjit/src/lib.rs b/zjit/src/lib.rs index 1210401623..2a7dc40c75 100644 --- a/zjit/src/lib.rs +++ b/zjit/src/lib.rs @@ -1,6 +1,5 @@ #![allow(dead_code)] -mod asm; mod codegen; mod cruby; mod ir; |