ruby-changes:73239
From: Takashi <ko1@a...>
Date: Tue, 30 Aug 2022 01:03:29 +0900 (JST)
Subject: [ruby-changes:73239] 1446e22aeb (master): Port setglobal to the new backend (https://github.com/Shopify/ruby/pull/347)
https://git.ruby-lang.org/ruby.git/commit/?id=1446e22aeb From 1446e22aeba09c55227c56b9c2f6cb90facc9512 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Mon, 1 Aug 2022 10:16:01 -0700 Subject: Port setglobal to the new backend (https://github.com/Shopify/ruby/pull/347) --- yjit/src/codegen.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 93d835d7f1..940ffed3df 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -5298,30 +5298,30 @@ fn gen_getglobal( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L5298 KeepCompiling } -/* fn gen_setglobal( jit: &mut JITState, ctx: &mut Context, - cb: &mut CodeBlock, + asm: &mut Assembler, _ocb: &mut OutlinedCb, ) -> CodegenStatus { let gid = jit_get_arg(jit, 0); // Save the PC and SP because we might make a Ruby call for // Kernel#set_trace_var - jit_prepare_routine_call(jit, ctx, cb, REG0); - - mov(cb, C_ARG_REGS[0], imm_opnd(gid.as_i64())); - - let val = ctx.stack_pop(1); - - mov(cb, C_ARG_REGS[1], val); + jit_prepare_routine_call(jit, ctx, asm); - call_ptr(cb, REG0, rb_gvar_set as *const u8); + asm.ccall( + rb_gvar_set as *const u8, + vec![ + gid.into(), + ctx.stack_pop(1), + ], + ); KeepCompiling } +/* fn gen_anytostring( jit: &mut JITState, ctx: &mut Context, @@ -6028,8 +6028,8 @@ fn get_gen_fn(opcode: VALUE) -> Option<InsnGenFn> { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L6028 YARVINSN_leave => Some(gen_leave), YARVINSN_getglobal => Some(gen_getglobal), - /* YARVINSN_setglobal => Some(gen_setglobal), + /* YARVINSN_anytostring => Some(gen_anytostring), YARVINSN_objtostring => Some(gen_objtostring), YARVINSN_intern => Some(gen_intern), -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/