ruby-changes:73195
From: Maxime <ko1@a...>
Date: Tue, 30 Aug 2022 01:00:12 +0900 (JST)
Subject: [ruby-changes:73195] 85872eecdd (master): Port over newrange
https://git.ruby-lang.org/ruby.git/commit/?id=85872eecdd From 85872eecddf0e5a13ba2218bb2068e99d5ce1313 Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...> Date: Wed, 20 Jul 2022 16:43:19 -0400 Subject: Port over newrange --- yjit/src/codegen.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index d1965d3be3..611c42c562 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -1253,32 +1253,38 @@ fn gen_splatarray( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L1253 KeepCompiling } +*/ // new range initialized from top 2 values fn gen_newrange( jit: &mut JITState, ctx: &mut Context, - cb: &mut CodeBlock, + asm: &mut Assembler, _ocb: &mut OutlinedCb, ) -> CodegenStatus { let flag = jit_get_arg(jit, 0); // rb_range_new() allocates and can raise - jit_prepare_routine_call(jit, ctx, cb, REG0); + jit_prepare_routine_call(jit, ctx, asm); // val = rb_range_new(low, high, (int)flag); - mov(cb, C_ARG_REGS[0], ctx.stack_opnd(1)); - mov(cb, C_ARG_REGS[1], ctx.stack_opnd(0)); - mov(cb, C_ARG_REGS[2], uimm_opnd(flag.into())); - call_ptr(cb, REG0, rb_range_new as *const u8); + let range_opnd = asm.ccall( + rb_range_new as *const u8, + vec![ + ctx.stack_opnd(1), + ctx.stack_opnd(0), + flag.into() + ] + ); ctx.stack_pop(2); let stack_ret = ctx.stack_push(Type::UnknownHeap); - mov(cb, stack_ret, RAX); + asm.mov(stack_ret, range_opnd); KeepCompiling } +/* fn guard_object_is_heap( cb: &mut CodeBlock, object_opnd: X86Opnd, @@ -5995,8 +6001,8 @@ fn get_gen_fn(opcode: VALUE) -> Option<InsnGenFn> { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L6001 YARVINSN_opt_str_freeze => Some(gen_opt_str_freeze), YARVINSN_opt_str_uminus => Some(gen_opt_str_uminus), YARVINSN_splatarray => Some(gen_splatarray), - YARVINSN_newrange => Some(gen_newrange), */ + YARVINSN_newrange => Some(gen_newrange), YARVINSN_putstring => Some(gen_putstring), /* YARVINSN_expandarray => Some(gen_expandarray), -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/