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/graph-unittest.h" | 5 #include "src/compiler/graph-unittest.h" |
6 | 6 |
7 #include <ostream> // NOLINT(readability/streams) | 7 #include <ostream> // NOLINT(readability/streams) |
8 | 8 |
9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
10 | 10 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 private: | 324 private: |
325 const Matcher<MachineType> type_matcher_; | 325 const Matcher<MachineType> type_matcher_; |
326 const Matcher<Node*> value0_matcher_; | 326 const Matcher<Node*> value0_matcher_; |
327 const Matcher<Node*> value1_matcher_; | 327 const Matcher<Node*> value1_matcher_; |
328 const Matcher<Node*> control_matcher_; | 328 const Matcher<Node*> control_matcher_; |
329 }; | 329 }; |
330 | 330 |
331 | 331 |
332 class IsProjectionMatcher FINAL : public NodeMatcher { | 332 class IsProjectionMatcher FINAL : public NodeMatcher { |
333 public: | 333 public: |
334 IsProjectionMatcher(const Matcher<int32_t>& index_matcher, | 334 IsProjectionMatcher(const Matcher<size_t>& index_matcher, |
335 const Matcher<Node*>& base_matcher) | 335 const Matcher<Node*>& base_matcher) |
336 : NodeMatcher(IrOpcode::kProjection), | 336 : NodeMatcher(IrOpcode::kProjection), |
337 index_matcher_(index_matcher), | 337 index_matcher_(index_matcher), |
338 base_matcher_(base_matcher) {} | 338 base_matcher_(base_matcher) {} |
339 | 339 |
340 virtual void DescribeTo(std::ostream* os) const OVERRIDE { | 340 virtual void DescribeTo(std::ostream* os) const OVERRIDE { |
341 NodeMatcher::DescribeTo(os); | 341 NodeMatcher::DescribeTo(os); |
342 *os << " whose index ("; | 342 *os << " whose index ("; |
343 index_matcher_.DescribeTo(os); | 343 index_matcher_.DescribeTo(os); |
344 *os << ") and base ("; | 344 *os << ") and base ("; |
345 base_matcher_.DescribeTo(os); | 345 base_matcher_.DescribeTo(os); |
346 *os << ")"; | 346 *os << ")"; |
347 } | 347 } |
348 | 348 |
349 virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const | 349 virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const |
350 OVERRIDE { | 350 OVERRIDE { |
351 return (NodeMatcher::MatchAndExplain(node, listener) && | 351 return (NodeMatcher::MatchAndExplain(node, listener) && |
352 PrintMatchAndExplain(OpParameter<int32_t>(node), "index", | 352 PrintMatchAndExplain(OpParameter<size_t>(node), "index", |
353 index_matcher_, listener) && | 353 index_matcher_, listener) && |
354 PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "base", | 354 PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "base", |
355 base_matcher_, listener)); | 355 base_matcher_, listener)); |
356 } | 356 } |
357 | 357 |
358 private: | 358 private: |
359 const Matcher<int32_t> index_matcher_; | 359 const Matcher<size_t> index_matcher_; |
360 const Matcher<Node*> base_matcher_; | 360 const Matcher<Node*> base_matcher_; |
361 }; | 361 }; |
362 | 362 |
363 | 363 |
364 class IsCallMatcher FINAL : public NodeMatcher { | 364 class IsCallMatcher FINAL : public NodeMatcher { |
365 public: | 365 public: |
366 IsCallMatcher(const Matcher<CallDescriptor*>& descriptor_matcher, | 366 IsCallMatcher(const Matcher<CallDescriptor*>& descriptor_matcher, |
367 const Matcher<Node*>& value0_matcher, | 367 const Matcher<Node*>& value0_matcher, |
368 const Matcher<Node*>& value1_matcher, | 368 const Matcher<Node*>& value1_matcher, |
369 const Matcher<Node*>& value2_matcher, | 369 const Matcher<Node*>& value2_matcher, |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 | 678 |
679 Matcher<Node*> IsPhi(const Matcher<MachineType>& type_matcher, | 679 Matcher<Node*> IsPhi(const Matcher<MachineType>& type_matcher, |
680 const Matcher<Node*>& value0_matcher, | 680 const Matcher<Node*>& value0_matcher, |
681 const Matcher<Node*>& value1_matcher, | 681 const Matcher<Node*>& value1_matcher, |
682 const Matcher<Node*>& merge_matcher) { | 682 const Matcher<Node*>& merge_matcher) { |
683 return MakeMatcher(new IsPhiMatcher(type_matcher, value0_matcher, | 683 return MakeMatcher(new IsPhiMatcher(type_matcher, value0_matcher, |
684 value1_matcher, merge_matcher)); | 684 value1_matcher, merge_matcher)); |
685 } | 685 } |
686 | 686 |
687 | 687 |
688 Matcher<Node*> IsProjection(const Matcher<int32_t>& index_matcher, | 688 Matcher<Node*> IsProjection(const Matcher<size_t>& index_matcher, |
689 const Matcher<Node*>& base_matcher) { | 689 const Matcher<Node*>& base_matcher) { |
690 return MakeMatcher(new IsProjectionMatcher(index_matcher, base_matcher)); | 690 return MakeMatcher(new IsProjectionMatcher(index_matcher, base_matcher)); |
691 } | 691 } |
692 | 692 |
693 | 693 |
694 Matcher<Node*> IsCall(const Matcher<CallDescriptor*>& descriptor_matcher, | 694 Matcher<Node*> IsCall(const Matcher<CallDescriptor*>& descriptor_matcher, |
695 const Matcher<Node*>& value0_matcher, | 695 const Matcher<Node*>& value0_matcher, |
696 const Matcher<Node*>& value1_matcher, | 696 const Matcher<Node*>& value1_matcher, |
697 const Matcher<Node*>& value2_matcher, | 697 const Matcher<Node*>& value2_matcher, |
698 const Matcher<Node*>& value3_matcher, | 698 const Matcher<Node*>& value3_matcher, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 IS_UNOP_MATCHER(ChangeInt32ToInt64) | 756 IS_UNOP_MATCHER(ChangeInt32ToInt64) |
757 IS_UNOP_MATCHER(ChangeUint32ToFloat64) | 757 IS_UNOP_MATCHER(ChangeUint32ToFloat64) |
758 IS_UNOP_MATCHER(ChangeUint32ToUint64) | 758 IS_UNOP_MATCHER(ChangeUint32ToUint64) |
759 IS_UNOP_MATCHER(TruncateFloat64ToInt32) | 759 IS_UNOP_MATCHER(TruncateFloat64ToInt32) |
760 IS_UNOP_MATCHER(TruncateInt64ToInt32) | 760 IS_UNOP_MATCHER(TruncateInt64ToInt32) |
761 #undef IS_UNOP_MATCHER | 761 #undef IS_UNOP_MATCHER |
762 | 762 |
763 } // namespace compiler | 763 } // namespace compiler |
764 } // namespace internal | 764 } // namespace internal |
765 } // namespace v8 | 765 } // namespace v8 |
OLD | NEW |