Bug 31151 - Fix branchDouble behaviour on ARM THUMB2 JIT.
Summary: Fix branchDouble behaviour on ARM THUMB2 JIT.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-04 20:51 PST by Gavin Barraclough
Modified: 2009-11-04 21:02 PST (History)
2 users (show)

See Also:


Attachments
The patch (3.77 KB, patch)
2009-11-04 20:54 PST, Gavin Barraclough
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2009-11-04 20:51:18 PST
The ARMv7 JIT is currently using ARMv7Assembler::ConditionEQ to branch for DoubleEqualOrUnordered, however this is incorrect – ConditionEQ won't branch on unordered operands.
Similarly, DoubleLessThanOrUnordered & DoubleLessThanOrEqualOrUnordered use ARMv7Assembler::ConditionLO & ARMv7Assembler::ConditionLS, whereas they should be using ARMv7Assembler::ConditionLT & ARMv7Assembler::ConditionLE.

As a consequence, the JIT may currently incorrectly branch on double comparisons to NaN, for example, "if (Number.NaN < 0) print("Oh noes it isn't!");"

Fix these, and fill out the missing DoubleConditions.
Comment 1 Gavin Barraclough 2009-11-04 20:54:13 PST
Created attachment 42541 [details]
The patch
Comment 2 Gavin Barraclough 2009-11-04 21:02:22 PST
Sending        JavaScriptCore/ChangeLog
Sending        JavaScriptCore/assembler/MacroAssemblerARMv7.h
Transmitting file data ..
Committed revision 50541.