Bug 133994

Summary: DFGGraph::m_doubleConstantMap will not map 0 values correctly
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, commit-queue, fpizlo, ggaren, mhahnenberg, mmirman, msaboff, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 134006    
Bug Blocks:    
Attachments:
Description Flags
the patch.
none
patch 2: fixed build problem, and properly tested on 32-bit build. ggaren: review+

Description Mark Lam 2014-06-17 13:09:17 PDT
Filip noticed that m_doubleConstantsMap should not use a double as a key, because it means two unfortunate things:
- It will probably break for zero.
- It will think that -0 is the same as +0 under some circumstances, size -0==+0 even though they are distinct values (for example 1/-0 != 1/+0).

Will fix.
Comment 1 Mark Lam 2014-06-17 14:27:31 PDT
Created attachment 233260 [details]
the patch.

This patch has passed the JSC tests and the layout tests with a debug build on x86_64.
Comment 2 Alex Christensen 2014-06-17 15:28:43 PDT
Are there ever cases where different NaNs would need to map to the same value?
Comment 3 Geoffrey Garen 2014-06-17 15:39:18 PDT
Comment on attachment 233260 [details]
the patch.

r=me
Comment 4 Geoffrey Garen 2014-06-17 15:40:11 PDT
(In reply to comment #2)
> Are there ever cases where different NaNs would need to map to the same value?

In user code, there are only ever two NaNs (positive unsignaling and negative unsignaling), and they do not need (or want) to map to the same value.
Comment 5 WebKit Commit Bot 2014-06-17 16:06:17 PDT
Comment on attachment 233260 [details]
the patch.

Clearing flags on attachment: 233260

Committed r170082: <http://trac.webkit.org/changeset/170082>
Comment 6 WebKit Commit Bot 2014-06-17 16:06:22 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 WebKit Commit Bot 2014-06-17 16:59:33 PDT
Re-opened since this is blocked by bug 134006
Comment 8 Mark Lam 2014-06-18 08:18:12 PDT
Created attachment 233309 [details]
patch 2: fixed build problem, and properly tested on 32-bit build.
Comment 9 Geoffrey Garen 2014-06-18 11:04:42 PDT
Comment on attachment 233309 [details]
patch 2: fixed build problem, and properly tested on 32-bit build.

r=me
Comment 10 Mark Lam 2014-06-18 11:58:32 PDT
Thanks.  Landed in r170109: <http://trac.webkit.org/r170109>.