JM: Eliminate Redundant Comparison in jsop_binary()

RESOLVED WONTFIX

Status

()

--
minor
RESOLVED WONTFIX
8 years ago
5 years ago

People

(Reporter: sstangl, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
x = "cats"
x+5

(breakpoint hit at top of jsop_binary at runtime):

=> 0x7ffff1d2b1fb:	mov    0x90(%rbx),%r14
   0x7ffff1d2b202:	movabs $0xffff800000000000,%r11
   0x7ffff1d2b20c:	and    %r11,%r14
   0x7ffff1d2b20f:	mov    0x90(%rbx),%r13
   0x7ffff1d2b216:	movabs $0x7fffffffffff,%r11
   0x7ffff1d2b220:	and    %r11,%r13
   0x7ffff1d2b223:	mov    %r13,%r12
   0x7ffff1d2b226:	movabs $0xfff8800000000000,%r11
   0x7ffff1d2b230:	cmp    %r11,%r14
   0x7ffff1d2b233:	jne    0x7ffff1d2b2e5

Hits that, jumps to:

=> 0x7ffff1d2b2e5:	movabs $0xfff8000000000000,%r11
   0x7ffff1d2b2ef:	cmp    %r11,%r14
   0x7ffff1d2b2f2:	jae    0x7ffff1d2b372

The "movabs" and "cmp" have no effect and can be safely eliminated. On x86/ARM, this results in the elimination of a single 'cmp' per double/slow path.

We need to first verify that ARM does not reset processor flags on a branch. (Though it would be very silly if that were the case.)
(In reply to comment #0)
> We need to first verify that ARM does not reset processor flags on a branch.
> (Though it would be very silly if that were the case.)

This is fine on ARM. Branches don't touch flags.
Blocks: 578225

Comment 2

5 years ago
JM was removed.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.