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 "test/unittests/test-utils.h" | 8 #include "test/unittests/test-utils.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 | 32 |
33 const PureOperator kPureOperators[] = { | 33 const PureOperator kPureOperators[] = { |
34 #define PURE(Name, properties, input_count) \ | 34 #define PURE(Name, properties, input_count) \ |
35 { \ | 35 { \ |
36 &SimplifiedOperatorBuilder::Name, IrOpcode::k##Name, \ | 36 &SimplifiedOperatorBuilder::Name, IrOpcode::k##Name, \ |
37 Operator::kPure | properties, input_count \ | 37 Operator::kPure | properties, input_count \ |
38 } | 38 } |
39 PURE(BooleanNot, Operator::kNoProperties, 1), | 39 PURE(BooleanNot, Operator::kNoProperties, 1), |
| 40 PURE(BooleanToNumber, Operator::kNoProperties, 1), |
40 PURE(NumberEqual, Operator::kCommutative, 2), | 41 PURE(NumberEqual, Operator::kCommutative, 2), |
41 PURE(NumberLessThan, Operator::kNoProperties, 2), | 42 PURE(NumberLessThan, Operator::kNoProperties, 2), |
42 PURE(NumberLessThanOrEqual, Operator::kNoProperties, 2), | 43 PURE(NumberLessThanOrEqual, Operator::kNoProperties, 2), |
43 PURE(NumberAdd, Operator::kCommutative, 2), | 44 PURE(NumberAdd, Operator::kCommutative, 2), |
44 PURE(NumberSubtract, Operator::kNoProperties, 2), | 45 PURE(NumberSubtract, Operator::kNoProperties, 2), |
45 PURE(NumberMultiply, Operator::kCommutative, 2), | 46 PURE(NumberMultiply, Operator::kCommutative, 2), |
46 PURE(NumberDivide, Operator::kNoProperties, 2), | 47 PURE(NumberDivide, Operator::kNoProperties, 2), |
47 PURE(NumberModulus, Operator::kNoProperties, 2), | 48 PURE(NumberModulus, Operator::kNoProperties, 2), |
48 PURE(NumberToInt32, Operator::kNoProperties, 1), | 49 PURE(NumberToInt32, Operator::kNoProperties, 1), |
49 PURE(NumberToUint32, Operator::kNoProperties, 1), | 50 PURE(NumberToUint32, Operator::kNoProperties, 1), |
50 PURE(StringEqual, Operator::kCommutative, 2), | 51 PURE(StringEqual, Operator::kCommutative, 2), |
51 PURE(StringLessThan, Operator::kNoProperties, 2), | 52 PURE(StringLessThan, Operator::kNoProperties, 2), |
52 PURE(StringLessThanOrEqual, Operator::kNoProperties, 2), | 53 PURE(StringLessThanOrEqual, Operator::kNoProperties, 2), |
53 PURE(StringAdd, Operator::kNoProperties, 2), | 54 PURE(StringAdd, Operator::kNoProperties, 2), |
54 PURE(ChangeTaggedToInt32, Operator::kNoProperties, 1), | 55 PURE(ChangeTaggedToInt32, Operator::kNoProperties, 1), |
55 PURE(ChangeTaggedToUint32, Operator::kNoProperties, 1), | 56 PURE(ChangeTaggedToUint32, Operator::kNoProperties, 1), |
56 PURE(ChangeTaggedToFloat64, Operator::kNoProperties, 1), | 57 PURE(ChangeTaggedToFloat64, Operator::kNoProperties, 1), |
57 PURE(ChangeInt32ToTagged, Operator::kNoProperties, 1), | 58 PURE(ChangeInt32ToTagged, Operator::kNoProperties, 1), |
58 PURE(ChangeUint32ToTagged, Operator::kNoProperties, 1), | 59 PURE(ChangeUint32ToTagged, Operator::kNoProperties, 1), |
59 PURE(ChangeFloat64ToTagged, Operator::kNoProperties, 1), | 60 PURE(ChangeFloat64ToTagged, Operator::kNoProperties, 1), |
60 PURE(ChangeBoolToBit, Operator::kNoProperties, 1), | 61 PURE(ChangeBoolToBit, Operator::kNoProperties, 1), |
61 PURE(ChangeBitToBool, Operator::kNoProperties, 1) | 62 PURE(ChangeBitToBool, Operator::kNoProperties, 1), |
| 63 PURE(ObjectIsSmi, Operator::kNoProperties, 1), |
| 64 PURE(ObjectIsNonNegativeSmi, Operator::kNoProperties, 1) |
62 #undef PURE | 65 #undef PURE |
63 }; | 66 }; |
64 | 67 |
65 } // namespace | 68 } // namespace |
66 | 69 |
67 | 70 |
68 class SimplifiedPureOperatorTest | 71 class SimplifiedPureOperatorTest |
69 : public TestWithZone, | 72 : public TestWithZone, |
70 public ::testing::WithParamInterface<PureOperator> {}; | 73 public ::testing::WithParamInterface<PureOperator> {}; |
71 | 74 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 } | 276 } |
274 | 277 |
275 | 278 |
276 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, | 279 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, |
277 SimplifiedElementAccessOperatorTest, | 280 SimplifiedElementAccessOperatorTest, |
278 ::testing::ValuesIn(kElementAccesses)); | 281 ::testing::ValuesIn(kElementAccesses)); |
279 | 282 |
280 } // namespace compiler | 283 } // namespace compiler |
281 } // namespace internal | 284 } // namespace internal |
282 } // namespace v8 | 285 } // namespace v8 |
OLD | NEW |