OLD | NEW |
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/simplified-operator.h" | 5 #include "src/compiler/simplified-operator.h" |
6 | 6 |
7 #include "src/compiler/operator-properties-inl.h" | 7 #include "src/compiler/operator-properties-inl.h" |
8 #include "src/test/test-utils.h" | 8 #include "src/test/test-utils.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 // ----------------------------------------------------------------------------- | 14 // ----------------------------------------------------------------------------- |
15 // Pure operators. | 15 // Pure operators. |
16 | 16 |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 struct PureOperator { | 20 struct PureOperator { |
21 const Operator* (SimplifiedOperatorBuilder::*constructor)() const; | 21 const Operator* (SimplifiedOperatorBuilder::*constructor)(); |
22 IrOpcode::Value opcode; | 22 IrOpcode::Value opcode; |
23 Operator::Properties properties; | 23 Operator::Properties properties; |
24 int value_input_count; | 24 int value_input_count; |
25 }; | 25 }; |
26 | 26 |
27 | 27 |
28 std::ostream& operator<<(std::ostream& os, const PureOperator& pop) { | 28 std::ostream& operator<<(std::ostream& os, const PureOperator& pop) { |
29 return os << IrOpcode::Mnemonic(pop.opcode); | 29 return os << IrOpcode::Mnemonic(pop.opcode); |
30 } | 30 } |
31 | 31 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 const Operator* op = (simplified.*pop.constructor)(); | 108 const Operator* op = (simplified.*pop.constructor)(); |
109 EXPECT_EQ(pop.properties, op->properties() & pop.properties); | 109 EXPECT_EQ(pop.properties, op->properties() & pop.properties); |
110 } | 110 } |
111 | 111 |
112 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, SimplifiedPureOperatorTest, | 112 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, SimplifiedPureOperatorTest, |
113 ::testing::ValuesIn(kPureOperators)); | 113 ::testing::ValuesIn(kPureOperators)); |
114 | 114 |
115 } // namespace compiler | 115 } // namespace compiler |
116 } // namespace internal | 116 } // namespace internal |
117 } // namespace v8 | 117 } // namespace v8 |
OLD | NEW |