Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Issue 863633002: Use signaling NaN for holes in fixed double arrays. (Closed)

Created:
5 years, 11 months ago by Benedikt Meurer
Modified:
5 years, 11 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Use signaling NaN for holes in fixed double arrays. TEST=mjsunit,cctest,unittests R=jkummerow@chromium.org Committed: https://crrev.com/9eace97bbaab72962c0fda62e5f9011a10604d0d Cr-Commit-Position: refs/heads/master@{#26180}

Patch Set 1 #

Patch Set 2 : Fixes #

Patch Set 3 : Next bunch of fixes #

Total comments: 2

Patch Set 4 : REBASE #

Patch Set 5 : Cleanup after REBASE #

Total comments: 2

Patch Set 6 : Address Jakobs comment. #

Patch Set 7 : Fix phi? #

Total comments: 1

Patch Set 8 : Use sNaN whose upper 32bits are different from inf. #

Patch Set 9 : sNaN must not appear as return value, because Windows passes it in ST0 which truncates back to a qN… #

Patch Set 10 : Passing signaling NaNs as double is not a great idea...stupid calling convention + Intel FPU fallout #

Patch Set 11 : Restore SSE2 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+173 lines, -290 lines) Patch
M build/toolchain.gypi View 1 2 3 4 5 6 7 10 2 chunks +5 lines, -30 lines 0 comments Download
M src/arm/simulator-arm.cc View 1 2 3 4 5 6 1 chunk +7 lines, -2 lines 0 comments Download
M src/arm64/lithium-codegen-arm64.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -6 lines 0 comments Download
M src/assembler.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/assembler.cc View 3 chunks +0 lines, -8 lines 0 comments Download
M src/globals.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -5 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 6 7 8 9 4 chunks +8 lines, -12 lines 0 comments Download
M src/hydrogen-instructions.h View 1 2 3 4 5 6 7 8 9 7 chunks +20 lines, -5 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 2 3 4 5 6 7 8 9 2 chunks +26 lines, -22 lines 2 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 6 7 8 9 5 chunks +21 lines, -31 lines 0 comments Download
M src/ia32/lithium-ia32.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M src/ia32/lithium-ia32.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -3 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 2 3 4 5 6 7 3 chunks +6 lines, -27 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -5 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -5 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 8 9 4 chunks +20 lines, -27 lines 0 comments Download
M src/serialize.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 6 7 8 9 4 chunks +7 lines, -30 lines 0 comments Download
M src/x64/lithium-x64.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -8 lines 0 comments Download
M src/x64/lithium-x64.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M src/x64/macro-assembler-x64.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 1 2 3 4 5 6 7 8 9 4 chunks +9 lines, -57 lines 0 comments Download
M test/cctest/test-serialize.cc View 1 chunk +1 line, -1 line 0 comments Download
A test/mjsunit/regress/regress-undefined-nan.js View 1 2 3 4 5 6 7 8 9 1 chunk +25 lines, -0 lines 2 comments Download

Messages

Total messages: 33 (13 generated)
Benedikt Meurer
PTAL
5 years, 11 months ago (2015-01-20 13:06:40 UTC) #2
Benedikt Meurer
https://codereview.chromium.org/863633002/diff/40001/src/arm/simulator-arm.cc File src/arm/simulator-arm.cc (right): https://codereview.chromium.org/863633002/diff/40001/src/arm/simulator-arm.cc#newcode1920 src/arm/simulator-arm.cc:1920: // Default NaN value, see "NaN handling" in "IEEE ...
5 years, 11 months ago (2015-01-20 13:09:39 UTC) #3
Jakob Kummerow
LGTM with a comment. https://codereview.chromium.org/863633002/diff/40001/test/mjsunit/regress/regress-undefined-nan.js File test/mjsunit/regress/regress-undefined-nan.js (right): https://codereview.chromium.org/863633002/diff/40001/test/mjsunit/regress/regress-undefined-nan.js#newcode13 test/mjsunit/regress/regress-undefined-nan.js:13: i_view[0] = 0xFFFFFFFF; You want ...
5 years, 11 months ago (2015-01-20 13:25:38 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/863633002/100001
5 years, 11 months ago (2015-01-20 13:27:48 UTC) #6
jbramley
Out of curiosity, what's the ultimate purpose for this? I wasn't aware that any of ...
5 years, 11 months ago (2015-01-20 14:02:07 UTC) #8
Benedikt Meurer
> Out of curiosity, what's the ultimate purpose for this? I wasn't aware that any ...
5 years, 11 months ago (2015-01-20 14:04:14 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/863633002/120001
5 years, 11 months ago (2015-01-20 14:47:14 UTC) #11
jbramley
https://codereview.chromium.org/863633002/diff/80001/src/arm/simulator-arm.cc File src/arm/simulator-arm.cc (right): https://codereview.chromium.org/863633002/diff/80001/src/arm/simulator-arm.cc#newcode1922 src/arm/simulator-arm.cc:1922: const uint64_t kDefaultNaN = V8_UINT64_C(0x7FF8000000000000); We already have kFP64DefaultNaN ...
5 years, 11 months ago (2015-01-20 14:57:22 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/863633002/120001
5 years, 11 months ago (2015-01-20 15:18:30 UTC) #15
jbramley
On 2015/01/20 14:57:22, jbramley wrote: > https://codereview.chromium.org/863633002/diff/80001/src/arm/simulator-arm.cc > File src/arm/simulator-arm.cc (right): > > https://codereview.chromium.org/863633002/diff/80001/src/arm/simulator-arm.cc#newcode1922 > ...
5 years, 11 months ago (2015-01-20 15:22:54 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: v8_win_rel on tryserver.v8 (http://build.chromium.org/p/tryserver.v8/builders/v8_win_rel/builds/2426)
5 years, 11 months ago (2015-01-20 17:03:40 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/863633002/140001
5 years, 11 months ago (2015-01-20 18:58:01 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: v8_win_rel on tryserver.v8 (http://build.chromium.org/p/tryserver.v8/builders/v8_win_rel/builds/2431)
5 years, 11 months ago (2015-01-20 19:30:53 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/863633002/160001
5 years, 11 months ago (2015-01-20 20:17:21 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: v8_mac_rel on tryserver.v8 (http://build.chromium.org/p/tryserver.v8/builders/v8_mac_rel/builds/2404)
5 years, 11 months ago (2015-01-20 20:19:43 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/863633002/180001
5 years, 11 months ago (2015-01-21 08:37:50 UTC) #28
Benedikt Meurer
Committed patchset #11 (id:200001) manually as 9eace97bbaab72962c0fda62e5f9011a10604d0d (presubmit successful).
5 years, 11 months ago (2015-01-21 08:52:31 UTC) #29
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/9eace97bbaab72962c0fda62e5f9011a10604d0d Cr-Commit-Position: refs/heads/master@{#26180}
5 years, 11 months ago (2015-01-21 08:52:32 UTC) #30
Vyacheslav Egorov (Google)
DBC (there's a bug, see below) (nice sNaN idea!) https://codereview.chromium.org/863633002/diff/200001/src/hydrogen-instructions.cc File src/hydrogen-instructions.cc (right): https://codereview.chromium.org/863633002/diff/200001/src/hydrogen-instructions.cc#newcode4056 src/hydrogen-instructions.cc:4056: ...
5 years, 11 months ago (2015-01-22 02:52:20 UTC) #32
Benedikt Meurer
5 years, 11 months ago (2015-01-22 06:11:15 UTC) #33
Message was sent while issue was closed.
Thanks a lot, fixed those.

https://codereview.chromium.org/863633002/diff/200001/src/hydrogen-instructio...
File src/hydrogen-instructions.cc (right):

https://codereview.chromium.org/863633002/diff/200001/src/hydrogen-instructio...
src/hydrogen-instructions.cc:4056: switch (value()->opcode()) {
Fixed, thanks.

https://codereview.chromium.org/863633002/diff/200001/test/mjsunit/regress/re...
File test/mjsunit/regress/regress-undefined-nan.js (right):

https://codereview.chromium.org/863633002/diff/200001/test/mjsunit/regress/re...
test/mjsunit/regress/regress-undefined-nan.js:18: fixed_double_elements[0] =
f_view[0];
On 2015/01/22 02:52:20, Vyacheslav Egorov (Google) wrote:
> This regression test does not necessarily work as is on ia32. This statement
has
> to be inside an optimized function to ensure transfer through xmm registers.
> 
> If this hits runtime and uses FPU registers for transfer somewhere (e.g.
return
> value of a function call).
> 
> If I add here:
> 
> var i32 = new Int32Array(fixed_double_elements.buffer);
> assertEquals(i_view[0], i32[0]);
> assertEquals(i_view[1], i32[1]);
> 
> to verify that test tests what it wants - this fails on ia32.debug build.
> 
> Need smth like:
> 
> function opt_store() { fixed_double_elements[0] = f_view[0]; }
> 
> opt_store();
> opt_store();
> %OptimizeFunctionOnNextCall(opt_store);
> opt_store();
> 
> to fix it. 

Done.

Powered by Google App Engine
This is Rietveld 408576698