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

Side by Side Diff: test/unittests/compiler/int64-lowering-unittest.cc

Issue 2428583002: [wasm] Break effect cycles in the Int64Lowering. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/int64-lowering.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/int64-lowering.h" 5 #include "src/compiler/int64-lowering.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/linkage.h" 7 #include "src/compiler/linkage.h"
8 #include "src/compiler/machine-operator.h" 8 #include "src/compiler/machine-operator.h"
9 #include "src/compiler/node.h" 9 #include "src/compiler/node.h"
10 10
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 TEST_F(Int64LoweringTest, I64ReverseBytes) { 842 TEST_F(Int64LoweringTest, I64ReverseBytes) {
843 LowerGraph(graph()->NewNode(machine()->Word64ReverseBytes().placeholder(), 843 LowerGraph(graph()->NewNode(machine()->Word64ReverseBytes().placeholder(),
844 Int64Constant(value(0))), 844 Int64Constant(value(0))),
845 MachineRepresentation::kWord64); 845 MachineRepresentation::kWord64);
846 EXPECT_THAT( 846 EXPECT_THAT(
847 graph()->end()->InputAt(1), 847 graph()->end()->InputAt(1),
848 IsReturn2(IsWord32ReverseBytes(IsInt32Constant(high_word_value(0))), 848 IsReturn2(IsWord32ReverseBytes(IsInt32Constant(high_word_value(0))),
849 IsWord32ReverseBytes(IsInt32Constant(low_word_value(0))), 849 IsWord32ReverseBytes(IsInt32Constant(low_word_value(0))),
850 start(), start())); 850 start(), start()));
851 } 851 }
852
853 TEST_F(Int64LoweringTest, EffectPhiLoop) {
854 // Construct a cycle consisting of an EffectPhi, a Store, and a Load.
855 Node* eff_phi = graph()->NewNode(common()->EffectPhi(1), graph()->start(),
856 graph()->start());
857
858 StoreRepresentation store_rep(MachineRepresentation::kWord64,
859 WriteBarrierKind::kNoWriteBarrier);
860 LoadRepresentation load_rep(MachineType::Int64());
861
862 Node* load =
863 graph()->NewNode(machine()->Load(load_rep), Int64Constant(value(0)),
864 Int64Constant(value(1)), eff_phi, graph()->start());
865
866 Node* store =
867 graph()->NewNode(machine()->Store(store_rep), Int64Constant(value(0)),
868 Int64Constant(value(1)), load, load, graph()->start());
869
870 eff_phi->InsertInput(zone(), 1, store);
871 NodeProperties::ChangeOp(eff_phi,
872 common()->ResizeMergeOrPhi(eff_phi->op(), 2));
873
874 LowerGraph(load, MachineRepresentation::kWord64);
875 }
852 } // namespace compiler 876 } // namespace compiler
853 } // namespace internal 877 } // namespace internal
854 } // namespace v8 878 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/int64-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698