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

Side by Side Diff: test/unittests/compiler/machine-operator-unittest.cc

Issue 1333353005: [turbofan] Limit the load/store machine types to the ones we actually use. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | « test/unittests/compiler/machine-operator-reducer-unittest.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/machine-operator.h" 5 #include "src/compiler/machine-operator.h"
6 #include "src/compiler/opcodes.h" 6 #include "src/compiler/opcodes.h"
7 #include "src/compiler/operator.h" 7 #include "src/compiler/operator.h"
8 #include "src/compiler/operator-properties.h" 8 #include "src/compiler/operator-properties.h"
9 #include "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 14 matching lines...) Expand all
25 private: 25 private:
26 typedef ::testing::WithParamInterface< ::testing::tuple<MachineType, T> > B; 26 typedef ::testing::WithParamInterface< ::testing::tuple<MachineType, T> > B;
27 }; 27 };
28 28
29 29
30 namespace { 30 namespace {
31 31
32 const MachineType kMachineReps[] = {kRepWord32, kRepWord64}; 32 const MachineType kMachineReps[] = {kRepWord32, kRepWord64};
33 33
34 34
35 const MachineType kMachineTypes[] = { 35 const MachineType kMachineTypesForAccess[] = {
36 kMachFloat32, kMachFloat64, kMachInt8, kMachUint8, kMachInt16, 36 kMachFloat32, kMachFloat64, kMachInt8, kMachUint8, kMachInt16,
37 kMachUint16, kMachInt32, kMachUint32, kMachInt64, kMachUint64, 37 kMachUint16, kMachInt32, kMachUint32, kMachInt64, kMachUint64,
38 kMachPtr, kMachAnyTagged, kRepBit, kRepWord8, kRepWord16, 38 kMachPtr, kMachAnyTagged, kMachPtr};
39 kRepWord32, kRepWord64, kRepFloat32, kRepFloat64, kRepTagged};
40 39
41 } // namespace 40 } // namespace
42 41
43 42
44 // ----------------------------------------------------------------------------- 43 // -----------------------------------------------------------------------------
45 // Load operator. 44 // Load operator.
46 45
47 46
48 typedef MachineOperatorTestWithParam<LoadRepresentation> 47 typedef MachineOperatorTestWithParam<LoadRepresentation>
49 MachineLoadOperatorTest; 48 MachineLoadOperatorTest;
(...skipping 27 matching lines...) Expand all
77 } 76 }
78 77
79 78
80 TEST_P(MachineLoadOperatorTest, ParameterIsCorrect) { 79 TEST_P(MachineLoadOperatorTest, ParameterIsCorrect) {
81 MachineOperatorBuilder machine(zone(), type()); 80 MachineOperatorBuilder machine(zone(), type());
82 EXPECT_EQ(GetParam(), 81 EXPECT_EQ(GetParam(),
83 OpParameter<LoadRepresentation>(machine.Load(GetParam()))); 82 OpParameter<LoadRepresentation>(machine.Load(GetParam())));
84 } 83 }
85 84
86 85
87 INSTANTIATE_TEST_CASE_P(MachineOperatorTest, MachineLoadOperatorTest, 86 INSTANTIATE_TEST_CASE_P(
88 ::testing::Combine(::testing::ValuesIn(kMachineReps), 87 MachineOperatorTest, MachineLoadOperatorTest,
89 ::testing::ValuesIn(kMachineTypes))); 88 ::testing::Combine(::testing::ValuesIn(kMachineReps),
89 ::testing::ValuesIn(kMachineTypesForAccess)));
90 90
91 91
92 // ----------------------------------------------------------------------------- 92 // -----------------------------------------------------------------------------
93 // Store operator. 93 // Store operator.
94 94
95 95
96 class MachineStoreOperatorTest 96 class MachineStoreOperatorTest
97 : public MachineOperatorTestWithParam< 97 : public MachineOperatorTestWithParam<
98 ::testing::tuple<MachineType, WriteBarrierKind> > { 98 ::testing::tuple<MachineType, WriteBarrierKind> > {
99 protected: 99 protected:
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 MachineOperatorBuilder machine(zone(), type()); 139 MachineOperatorBuilder machine(zone(), type());
140 EXPECT_EQ(GetParam(), 140 EXPECT_EQ(GetParam(),
141 OpParameter<StoreRepresentation>(machine.Store(GetParam()))); 141 OpParameter<StoreRepresentation>(machine.Store(GetParam())));
142 } 142 }
143 143
144 144
145 INSTANTIATE_TEST_CASE_P( 145 INSTANTIATE_TEST_CASE_P(
146 MachineOperatorTest, MachineStoreOperatorTest, 146 MachineOperatorTest, MachineStoreOperatorTest,
147 ::testing::Combine( 147 ::testing::Combine(
148 ::testing::ValuesIn(kMachineReps), 148 ::testing::ValuesIn(kMachineReps),
149 ::testing::Combine(::testing::ValuesIn(kMachineTypes), 149 ::testing::Combine(::testing::ValuesIn(kMachineTypesForAccess),
150 ::testing::Values(kNoWriteBarrier, 150 ::testing::Values(kNoWriteBarrier,
151 kFullWriteBarrier)))); 151 kFullWriteBarrier))));
152 #endif 152 #endif
153 153
154 // ----------------------------------------------------------------------------- 154 // -----------------------------------------------------------------------------
155 // Pure operators. 155 // Pure operators.
156 156
157 namespace { 157 namespace {
158 158
159 struct PureOperator { 159 struct PureOperator {
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 EXPECT_EQ(machine.Uint64Div(), machine.UintDiv()); 394 EXPECT_EQ(machine.Uint64Div(), machine.UintDiv());
395 EXPECT_EQ(machine.Int64Mod(), machine.IntMod()); 395 EXPECT_EQ(machine.Int64Mod(), machine.IntMod());
396 EXPECT_EQ(machine.Uint64Mod(), machine.UintMod()); 396 EXPECT_EQ(machine.Uint64Mod(), machine.UintMod());
397 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan()); 397 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan());
398 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual()); 398 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual());
399 } 399 }
400 400
401 } // namespace compiler 401 } // namespace compiler
402 } // namespace internal 402 } // namespace internal
403 } // namespace v8 403 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/machine-operator-reducer-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698