mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Eliminate type checks in opt_lt
This commit is contained in:
parent
63e85de33a
commit
e7909467df
1 changed files with 10 additions and 4 deletions
|
@ -532,14 +532,20 @@ gen_opt_lt(jitstate_t* jit, ctx_t* ctx)
|
|||
jnz_ptr(cb, side_exit);
|
||||
|
||||
// Get the operands and destination from the stack
|
||||
int arg1_type = ctx_get_top_type(ctx);
|
||||
x86opnd_t arg1 = ctx_stack_pop(ctx, 1);
|
||||
int arg0_type = ctx_get_top_type(ctx);
|
||||
x86opnd_t arg0 = ctx_stack_pop(ctx, 1);
|
||||
|
||||
// If not fixnums, fall back
|
||||
test(cb, arg0, imm_opnd(RUBY_FIXNUM_FLAG));
|
||||
jz_ptr(cb, side_exit);
|
||||
test(cb, arg1, imm_opnd(RUBY_FIXNUM_FLAG));
|
||||
jz_ptr(cb, side_exit);
|
||||
if (arg0_type != T_FIXNUM) {
|
||||
test(cb, arg0, imm_opnd(RUBY_FIXNUM_FLAG));
|
||||
jz_ptr(cb, side_exit);
|
||||
}
|
||||
if (arg1_type != T_FIXNUM) {
|
||||
test(cb, arg1, imm_opnd(RUBY_FIXNUM_FLAG));
|
||||
jz_ptr(cb, side_exit);
|
||||
}
|
||||
|
||||
// Compare the arguments
|
||||
mov(cb, REG0, arg0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue