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/js-operator.h" | 10 #include "src/compiler/js-operator.h" |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 | 1292 |
1293 | 1293 |
1294 class IsLoadContextMatcher final : public NodeMatcher { | 1294 class IsLoadContextMatcher final : public NodeMatcher { |
1295 public: | 1295 public: |
1296 IsLoadContextMatcher(const Matcher<ContextAccess>& access_matcher, | 1296 IsLoadContextMatcher(const Matcher<ContextAccess>& access_matcher, |
1297 const Matcher<Node*>& context_matcher) | 1297 const Matcher<Node*>& context_matcher) |
1298 : NodeMatcher(IrOpcode::kJSLoadContext), | 1298 : NodeMatcher(IrOpcode::kJSLoadContext), |
1299 access_matcher_(access_matcher), | 1299 access_matcher_(access_matcher), |
1300 context_matcher_(context_matcher) {} | 1300 context_matcher_(context_matcher) {} |
1301 | 1301 |
| 1302 void DescribeTo(std::ostream* os) const final { |
| 1303 NodeMatcher::DescribeTo(os); |
| 1304 *os << " whose access ("; |
| 1305 access_matcher_.DescribeTo(os); |
| 1306 *os << ") and context ("; |
| 1307 context_matcher_.DescribeTo(os); |
| 1308 *os << ")"; |
| 1309 } |
| 1310 |
1302 bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { | 1311 bool MatchAndExplain(Node* node, MatchResultListener* listener) const final { |
1303 return (NodeMatcher::MatchAndExplain(node, listener) && | 1312 return (NodeMatcher::MatchAndExplain(node, listener) && |
1304 PrintMatchAndExplain(OpParameter<ContextAccess>(node), "access", | 1313 PrintMatchAndExplain(OpParameter<ContextAccess>(node), "access", |
1305 access_matcher_, listener) && | 1314 access_matcher_, listener) && |
1306 PrintMatchAndExplain(NodeProperties::GetContextInput(node), | 1315 PrintMatchAndExplain(NodeProperties::GetContextInput(node), |
1307 "context", context_matcher_, listener)); | 1316 "context", context_matcher_, listener)); |
1308 } | 1317 } |
1309 | 1318 |
1310 private: | 1319 private: |
1311 const Matcher<ContextAccess> access_matcher_; | 1320 const Matcher<ContextAccess> access_matcher_; |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 IS_UNOP_MATCHER(NumberToInt32) | 1849 IS_UNOP_MATCHER(NumberToInt32) |
1841 IS_UNOP_MATCHER(NumberToUint32) | 1850 IS_UNOP_MATCHER(NumberToUint32) |
1842 IS_UNOP_MATCHER(ObjectIsSmi) | 1851 IS_UNOP_MATCHER(ObjectIsSmi) |
1843 IS_UNOP_MATCHER(ObjectIsNonNegativeSmi) | 1852 IS_UNOP_MATCHER(ObjectIsNonNegativeSmi) |
1844 IS_UNOP_MATCHER(Word32Clz) | 1853 IS_UNOP_MATCHER(Word32Clz) |
1845 #undef IS_UNOP_MATCHER | 1854 #undef IS_UNOP_MATCHER |
1846 | 1855 |
1847 } // namespace compiler | 1856 } // namespace compiler |
1848 } // namespace internal | 1857 } // namespace internal |
1849 } // namespace v8 | 1858 } // namespace v8 |
OLD | NEW |