Bug 133994 - DFGGraph::m_doubleConstantMap will not map 0 values correctly
Summary: DFGGraph::m_doubleConstantMap will not map 0 values correctly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on: 134006
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-17 13:09 PDT by Mark Lam
Modified: 2014-06-18 11:58 PDT (History)
8 users (show)

See Also:


Attachments
the patch. (3.06 KB, patch)
2014-06-17 14:27 PDT, Mark Lam
no flags Details | Formatted Diff | Diff
patch 2: fixed build problem, and properly tested on 32-bit build. (2.92 KB, patch)
2014-06-18 08:18 PDT, Mark Lam
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>.