diff options
author | Takashi Kokubun <[email protected]> | 2025-02-12 15:10:58 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2025-04-18 21:52:58 +0900 |
commit | e543b6a0309b465d95327d26b6a3e908377c24a3 () | |
tree | 55ba7008ad175b111c46f073868158d59b251b71 /zjit/src/lib.rs | |
parent | 5f3ebd44de96a352c7b353c647afedd6af81171f (diff) |
Start compiling the actual IR
Notes: Merged: https://.com/ruby/ruby/pull/13131
-rw-r--r-- | zjit/src/lib.rs | 31 |
1 files changed, 8 insertions, 23 deletions
@@ -13,7 +13,7 @@ mod backend; mod disasm; mod options; -use codegen::gen_leave; use options::get_option; use state::ZJITState; use crate::cruby::*; @@ -78,15 +78,11 @@ fn rb_bug_panic_hook() { /// Generate JIT code for a given ISEQ, which takes EC and CFP as its arguments. #[no_mangle] pub extern "C" fn rb_zjit_iseq_gen_entry_point(iseq: IseqPtr, _ec: EcPtr) -> *const u8 { // Compile ISEQ into SSA IR - let _ssa = match ir::iseq_to_ssa(iseq) { - Ok(ssa) => { - if get_option!(dump_ssa) { - print!("SSA:\n{}", ir::FunctionPrinter::from(&ssa)); - //println!("{:#?}", ssa); - } - ssa - }, Err(err) => { if get_option!(dump_ssa) { eprintln!("zjit: to_ssa: {:?}", err); @@ -97,19 +93,8 @@ pub extern "C" fn rb_zjit_iseq_gen_entry_point(iseq: IseqPtr, _ec: EcPtr) -> *co // Compile SSA IR into machine code (TODO) let cb = ZJITState::get_code_block(); - let start_ptr = cb.get_write_ptr(); - gen_leave(cb); - - #[cfg(feature = "disasm")] - if get_option!(dump_disasm) { - let end_ptr = cb.get_write_ptr(); - let disasm = disasm::disasm_addr_range(start_ptr.raw_ptr(cb) as usize, end_ptr.raw_ptr(cb) as usize); - println!("{}", disasm); - } - - if false { - start_ptr.raw_ptr(cb) - } else { - std::ptr::null() } } |