diff options
author | Zack Deveau <zack.ref@gmail.com> | 2022-08-02 13:09:51 -0400 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 08:47:05 -0700 |
commit | dea42385440c7abc332d8fda04dbec0f33364baa (patch) | |
tree | 1d882ec609c14e6cd1dbbbf70d90fb60ff99fc0a /yjit | |
parent | 330c9e98506d421778c8f2581a23ba44e4663e06 (diff) | |
download | ruby-dea42385440c7abc332d8fda04dbec0f33364baa.tar.gz |
Port gen_concatstring to new backend IR (https://github.com/Shopify/ruby/pull/350)
* Port gen_concatstring to new backend IR
* Update yjit/src/codegen.rs
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Diffstat (limited to 'yjit')
-rw-r--r-- | yjit/src/codegen.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 36cdd55573..d75484a5df 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -2278,32 +2278,33 @@ fn gen_checktype( } } -/* + fn gen_concatstrings( jit: &mut JITState, ctx: &mut Context, - cb: &mut CodeBlock, + asm: &mut Assembler, _ocb: &mut OutlinedCb, ) -> CodegenStatus { let n = jit_get_arg(jit, 0); // Save the PC and SP because we are allocating - jit_prepare_routine_call(jit, ctx, cb, REG0); + jit_prepare_routine_call(jit, ctx, asm); let values_ptr = ctx.sp_opnd(-((SIZEOF_VALUE as isize) * n.as_isize())); // call rb_str_concat_literals(long n, const VALUE *strings); - mov(cb, C_ARG_REGS[0], imm_opnd(n.into())); - lea(cb, C_ARG_REGS[1], values_ptr); - call_ptr(cb, REG0, rb_str_concat_literals as *const u8); + let return_value = asm.ccall( + rb_str_concat_literals as *const u8, + vec![Opnd::UImm(n.into()), values_ptr] + ); ctx.stack_pop(n.as_usize()); let stack_ret = ctx.stack_push(Type::CString); - mov(cb, stack_ret, RAX); + asm.mov(stack_ret, return_value); KeepCompiling } -*/ + fn guard_two_fixnums(ctx: &mut Context, asm: &mut Assembler, side_exit: CodePtr) { // Get the stack operand types @@ -6015,8 +6016,8 @@ fn get_gen_fn(opcode: VALUE) -> Option<InsnGenFn> { //YARVINSN_expandarray => Some(gen_expandarray), YARVINSN_defined => Some(gen_defined), YARVINSN_checkkeyword => Some(gen_checkkeyword), - /* YARVINSN_concatstrings => Some(gen_concatstrings), + /* YARVINSN_getinstancevariable => Some(gen_getinstancevariable), YARVINSN_setinstancevariable => Some(gen_setinstancevariable), |