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 "test/unittests/compiler/node-test-utils.h" | 5 #include "test/unittests/compiler/node-test-utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { | 1302 bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { |
1303 return (NodeMatcher::MatchAndExplain(node, listener) && | 1303 return (NodeMatcher::MatchAndExplain(node, listener) && |
1304 PrintMatchAndExplain(OpParameter<MachineRepresentation>(node), | 1304 PrintMatchAndExplain(OpParameter<MachineRepresentation>(node), |
1305 "rep", rep_matcher_, listener)); | 1305 "rep", rep_matcher_, listener)); |
1306 } | 1306 } |
1307 | 1307 |
1308 private: | 1308 private: |
1309 const Matcher<MachineRepresentation> rep_matcher_; | 1309 const Matcher<MachineRepresentation> rep_matcher_; |
1310 }; | 1310 }; |
1311 | 1311 |
1312 class IsGuardMatcher final : public NodeMatcher { | 1312 class IsTypeGuardMatcher final : public NodeMatcher { |
1313 public: | 1313 public: |
1314 IsGuardMatcher(const Matcher<Type*>& type_matcher, | 1314 IsTypeGuardMatcher(const Matcher<Type*>& type_matcher, |
1315 const Matcher<Node*>& value_matcher, | 1315 const Matcher<Node*>& value_matcher, |
1316 const Matcher<Node*>& control_matcher) | 1316 const Matcher<Node*>& control_matcher) |
1317 : NodeMatcher(IrOpcode::kGuard), | 1317 : NodeMatcher(IrOpcode::kTypeGuard), |
1318 type_matcher_(type_matcher), | 1318 type_matcher_(type_matcher), |
1319 value_matcher_(value_matcher), | 1319 value_matcher_(value_matcher), |
1320 control_matcher_(control_matcher) {} | 1320 control_matcher_(control_matcher) {} |
1321 | 1321 |
1322 bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { | 1322 bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { |
1323 return (NodeMatcher::MatchAndExplain(node, listener) && | 1323 return (NodeMatcher::MatchAndExplain(node, listener) && |
1324 PrintMatchAndExplain(OpParameter<Type*>(node->op()), "type", | 1324 PrintMatchAndExplain(OpParameter<Type*>(node->op()), "type", |
1325 type_matcher_, listener) && | 1325 type_matcher_, listener) && |
1326 PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), | 1326 PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), |
1327 "value", value_matcher_, listener) && | 1327 "value", value_matcher_, listener) && |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 value_matchers.push_back(value2_matcher); | 2008 value_matchers.push_back(value2_matcher); |
2009 value_matchers.push_back(value3_matcher); | 2009 value_matchers.push_back(value3_matcher); |
2010 value_matchers.push_back(value4_matcher); | 2010 value_matchers.push_back(value4_matcher); |
2011 value_matchers.push_back(value5_matcher); | 2011 value_matchers.push_back(value5_matcher); |
2012 value_matchers.push_back(value6_matcher); | 2012 value_matchers.push_back(value6_matcher); |
2013 value_matchers.push_back(value7_matcher); | 2013 value_matchers.push_back(value7_matcher); |
2014 return MakeMatcher(new IsTailCallMatcher(descriptor_matcher, value_matchers, | 2014 return MakeMatcher(new IsTailCallMatcher(descriptor_matcher, value_matchers, |
2015 effect_matcher, control_matcher)); | 2015 effect_matcher, control_matcher)); |
2016 } | 2016 } |
2017 | 2017 |
2018 Matcher<Node*> IsGuard(const Matcher<Type*>& type_matcher, | 2018 Matcher<Node*> IsTypeGuard(const Matcher<Type*>& type_matcher, |
2019 const Matcher<Node*>& value_matcher, | 2019 const Matcher<Node*>& value_matcher, |
2020 const Matcher<Node*>& control_matcher) { | 2020 const Matcher<Node*>& control_matcher) { |
2021 return MakeMatcher( | 2021 return MakeMatcher( |
2022 new IsGuardMatcher(type_matcher, value_matcher, control_matcher)); | 2022 new IsTypeGuardMatcher(type_matcher, value_matcher, control_matcher)); |
2023 } | 2023 } |
2024 | 2024 |
2025 Matcher<Node*> IsReferenceEqual(const Matcher<Type*>& type_matcher, | 2025 Matcher<Node*> IsReferenceEqual(const Matcher<Type*>& type_matcher, |
2026 const Matcher<Node*>& lhs_matcher, | 2026 const Matcher<Node*>& lhs_matcher, |
2027 const Matcher<Node*>& rhs_matcher) { | 2027 const Matcher<Node*>& rhs_matcher) { |
2028 return MakeMatcher( | 2028 return MakeMatcher( |
2029 new IsReferenceEqualMatcher(type_matcher, lhs_matcher, rhs_matcher)); | 2029 new IsReferenceEqualMatcher(type_matcher, lhs_matcher, rhs_matcher)); |
2030 } | 2030 } |
2031 | 2031 |
2032 | 2032 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2261 IS_UNOP_MATCHER(ObjectIsReceiver) | 2261 IS_UNOP_MATCHER(ObjectIsReceiver) |
2262 IS_UNOP_MATCHER(ObjectIsSmi) | 2262 IS_UNOP_MATCHER(ObjectIsSmi) |
2263 IS_UNOP_MATCHER(Word32Clz) | 2263 IS_UNOP_MATCHER(Word32Clz) |
2264 IS_UNOP_MATCHER(Word32Ctz) | 2264 IS_UNOP_MATCHER(Word32Ctz) |
2265 IS_UNOP_MATCHER(Word32Popcnt) | 2265 IS_UNOP_MATCHER(Word32Popcnt) |
2266 #undef IS_UNOP_MATCHER | 2266 #undef IS_UNOP_MATCHER |
2267 | 2267 |
2268 } // namespace compiler | 2268 } // namespace compiler |
2269 } // namespace internal | 2269 } // namespace internal |
2270 } // namespace v8 | 2270 } // namespace v8 |
OLD | NEW |