mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
miniruby --zjit -e nil
runs through iseq_to_ssa
This commit is contained in:
parent
0f9557e9a7
commit
1d95139bf6
Notes:
git
2025-04-18 13:49:48 +00:00
4 changed files with 37 additions and 5 deletions
|
@ -158,7 +158,7 @@ fn to_ssa(opcodes: &Vec<RubyOpcode>) -> Function {
|
|||
result
|
||||
}
|
||||
|
||||
fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Function {
|
||||
pub fn iseq_to_ssa(iseq: *const rb_iseq_t) {
|
||||
let mut result = Function::new();
|
||||
let mut state = FrameState::new();
|
||||
let block = result.entry_block;
|
||||
|
@ -206,13 +206,14 @@ fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Function {
|
|||
YARVINSN_leave => {
|
||||
result.push_insn(block, Insn::Return { val: state.pop() });
|
||||
}
|
||||
_ => todo!(),
|
||||
_ => eprintln!("zjit: unknown opcode {opcode}"),
|
||||
}
|
||||
|
||||
// Move to the next instruction to compile
|
||||
insn_idx += insn_len(opcode as usize);
|
||||
}
|
||||
return result;
|
||||
dbg!(result);
|
||||
return;
|
||||
|
||||
fn get_arg(pc: *const VALUE, arg_idx: isize) -> VALUE {
|
||||
unsafe { *(pc.offset(arg_idx + 1)) }
|
||||
|
|
|
@ -25,7 +25,7 @@ pub extern "C" fn rb_zjit_parse_option() -> bool {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn rb_zjit_iseq_gen_entry_point(_iseq: IseqPtr, _ec: EcPtr) -> *const u8 {
|
||||
println!("compiling zjit");
|
||||
pub extern "C" fn rb_zjit_iseq_gen_entry_point(iseq: IseqPtr, _ec: EcPtr) -> *const u8 {
|
||||
ir::iseq_to_ssa(iseq);
|
||||
std::ptr::null()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue