ruby-changes:68762
From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:13:28 +0900 (JST)
Subject: [ruby-changes:68762] ddd1a5ce79 (master): Add op-not-redefined check to opt_aref
https://git.ruby-lang.org/ruby.git/commit/?id=ddd1a5ce79 From ddd1a5ce790717d8606d3aba17cd1aaae266819f Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...> Date: Tue, 16 Feb 2021 12:16:00 -0500 Subject: Add op-not-redefined check to opt_aref --- ujit_codegen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ujit_codegen.c b/ujit_codegen.c index 90c1af21c4..541f74b964 100644 --- a/ujit_codegen.c +++ b/ujit_codegen.c @@ -706,6 +706,16 @@ gen_opt_aref(jitstate_t* jit, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/ujit_codegen.c#L706 // Create a size-exit to fall back to the interpreter uint8_t* side_exit = ujit_side_exit(jit, ctx); + // TODO: make a helper function for guarding on op-not-redefined + // Make sure that minus isn't redefined for integers + mov(cb, RAX, const_ptr_opnd(ruby_current_vm_ptr)); + test( + cb, + member_opnd_idx(RAX, rb_vm_t, redefined_flag, BOP_AREF), + imm_opnd(ARRAY_REDEFINED_OP_FLAG) + ); + jnz_ptr(cb, side_exit); + x86opnd_t recv = ctx_stack_pop(ctx, 1); mov(cb, REG0, recv); -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/