mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add op-not-redefined check to opt_aref
This commit is contained in:
parent
48736599ac
commit
ddd1a5ce79
1 changed files with 10 additions and 0 deletions
|
@ -706,6 +706,16 @@ gen_opt_aref(jitstate_t* jit, ctx_t* ctx)
|
||||||
// Create a size-exit to fall back to the interpreter
|
// Create a size-exit to fall back to the interpreter
|
||||||
uint8_t* side_exit = ujit_side_exit(jit, ctx);
|
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);
|
x86opnd_t recv = ctx_stack_pop(ctx, 1);
|
||||||
mov(cb, REG0, recv);
|
mov(cb, REG0, recv);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue