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

Issue 1422213002: [turbofan] Introduce simplified NumberBitwise{Or,Xor,And} operators. (Closed)

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

Description

[turbofan] Introduce simplified NumberBitwise{Or,Xor,And} operators. Currently we still (mis)used some machine operators in typed lowering (namely Word32Or, Word32Xor and Word32And). But these operators are "polymorphic" in the signedness of their inputs and output, hence the representation selection (and thereby simplified lowering) was unable to figure out whether a bitwise operation that was seen would produce an unsigned or a signed result. If such nodes also have frame state uses, the only safe choice was float64, which was not only a lot less ideal, but also the main cause of the for-in related deoptimizer loops. Adding dedicated NumberBitwiseOr, NumberBitwiseAnd and NumberBitwiseXor simplified operators not only gives us precise (and correct) typing for the bitwise operations, but also allows us to actually verify the graph properly after typed lowering. Drive-by-fix: Remove the double-to-smi magic from the Deoptimizer, which is responsible for various deopt-loops in TurboFan, and is no longer needed with the addition of the NumberBitwise operators. R=jarin@chromium.org Committed: https://crrev.com/d08f9045a1ee0062ced514dcb7f8047d505fd957 Cr-Commit-Position: refs/heads/master@{#31594}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix typo in SimplifiedLowering. #

Patch Set 3 : Implement Jaro's suggestion. #

Total comments: 2

Patch Set 4 : Use NewNumber instead of NewHeapNumber in the Deoptimizer. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -27 lines) Patch
M src/compiler/access-builder.h View 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/access-builder.cc View 2 chunks +5 lines, -4 lines 0 comments Download
M src/compiler/js-typed-lowering.cc View 1 2 3 2 chunks +10 lines, -9 lines 0 comments Download
M src/compiler/opcodes.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/representation-change.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/compiler/simplified-lowering.cc View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M src/compiler/simplified-operator.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/simplified-operator.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/typer.cc View 1 chunk +15 lines, -0 lines 0 comments Download
M src/compiler/verifier.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M src/deoptimizer.cc View 1 2 3 1 chunk +0 lines, -10 lines 0 comments Download
M test/cctest/compiler/test-js-typed-lowering.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M test/unittests/compiler/simplified-operator-unittest.cc View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (6 generated)
Benedikt Meurer
PTAL
5 years, 1 month ago (2015-10-27 08:11:14 UTC) #2
Jarin
https://codereview.chromium.org/1422213002/diff/1/src/compiler/simplified-lowering.cc File src/compiler/simplified-lowering.cc (right): https://codereview.chromium.org/1422213002/diff/1/src/compiler/simplified-lowering.cc#newcode724 src/compiler/simplified-lowering.cc:724: VisitBinop(node, kMachInt32, kMachUint32, kMachInt32); This seems wrong, why is ...
5 years, 1 month ago (2015-10-27 08:30:42 UTC) #4
Benedikt Meurer
https://codereview.chromium.org/1422213002/diff/1/src/compiler/simplified-lowering.cc File src/compiler/simplified-lowering.cc (right): https://codereview.chromium.org/1422213002/diff/1/src/compiler/simplified-lowering.cc#newcode724 src/compiler/simplified-lowering.cc:724: VisitBinop(node, kMachInt32, kMachUint32, kMachInt32); On 2015/10/27 08:30:42, Jarin wrote: ...
5 years, 1 month ago (2015-10-27 08:31:32 UTC) #5
Jarin
lgtm
5 years, 1 month ago (2015-10-27 08:33:25 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1422213002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1422213002/40001
5 years, 1 month ago (2015-10-27 08:33:36 UTC) #8
Jarin
https://codereview.chromium.org/1422213002/diff/40001/src/deoptimizer.cc File src/deoptimizer.cc (right): https://codereview.chromium.org/1422213002/diff/40001/src/deoptimizer.cc#newcode2567 src/deoptimizer.cc:2567: Handle<Object>(isolate()->factory()->NewHeapNumber(double_value())); FYI, this is not what the deoptimizer was ...
5 years, 1 month ago (2015-10-27 08:42:28 UTC) #9
Benedikt Meurer
https://codereview.chromium.org/1422213002/diff/40001/src/deoptimizer.cc File src/deoptimizer.cc (right): https://codereview.chromium.org/1422213002/diff/40001/src/deoptimizer.cc#newcode2567 src/deoptimizer.cc:2567: Handle<Object>(isolate()->factory()->NewHeapNumber(double_value())); As discussed offline, changing this back to NewNumber.
5 years, 1 month ago (2015-10-27 08:48:50 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1422213002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1422213002/60001
5 years, 1 month ago (2015-10-27 08:49:06 UTC) #14
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 1 month ago (2015-10-27 09:07:59 UTC) #15
commit-bot: I haz the power
5 years, 1 month ago (2015-10-27 09:08:25 UTC) #16
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/d08f9045a1ee0062ced514dcb7f8047d505fd957
Cr-Commit-Position: refs/heads/master@{#31594}

Powered by Google App Engine
This is Rietveld 408576698