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 #ifndef V8_COMPILER_NODE_MATCHERS_H_ | 5 #ifndef V8_COMPILER_NODE_MATCHERS_H_ |
6 #define V8_COMPILER_NODE_MATCHERS_H_ | 6 #define V8_COMPILER_NODE_MATCHERS_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 Node* node() const { return node_; } | 22 Node* node() const { return node_; } |
23 const Operator* op() const { return node()->op(); } | 23 const Operator* op() const { return node()->op(); } |
24 IrOpcode::Value opcode() const { return node()->opcode(); } | 24 IrOpcode::Value opcode() const { return node()->opcode(); } |
25 | 25 |
26 bool HasProperty(Operator::Property property) const { | 26 bool HasProperty(Operator::Property property) const { |
27 return op()->HasProperty(property); | 27 return op()->HasProperty(property); |
28 } | 28 } |
29 Node* InputAt(int index) const { return node()->InputAt(index); } | 29 Node* InputAt(int index) const { return node()->InputAt(index); } |
30 | 30 |
| 31 bool IsComparison() const; |
| 32 |
31 #define DEFINE_IS_OPCODE(Opcode) \ | 33 #define DEFINE_IS_OPCODE(Opcode) \ |
32 bool Is##Opcode() const { return opcode() == IrOpcode::k##Opcode; } | 34 bool Is##Opcode() const { return opcode() == IrOpcode::k##Opcode; } |
33 ALL_OP_LIST(DEFINE_IS_OPCODE) | 35 ALL_OP_LIST(DEFINE_IS_OPCODE) |
34 #undef DEFINE_IS_OPCODE | 36 #undef DEFINE_IS_OPCODE |
35 | 37 |
36 private: | 38 private: |
37 Node* node_; | 39 Node* node_; |
38 }; | 40 }; |
39 | 41 |
40 | 42 |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 typedef BaseWithIndexAndDisplacementMatcher<Int32AddMatcher> | 511 typedef BaseWithIndexAndDisplacementMatcher<Int32AddMatcher> |
510 BaseWithIndexAndDisplacement32Matcher; | 512 BaseWithIndexAndDisplacement32Matcher; |
511 typedef BaseWithIndexAndDisplacementMatcher<Int64AddMatcher> | 513 typedef BaseWithIndexAndDisplacementMatcher<Int64AddMatcher> |
512 BaseWithIndexAndDisplacement64Matcher; | 514 BaseWithIndexAndDisplacement64Matcher; |
513 | 515 |
514 } // namespace compiler | 516 } // namespace compiler |
515 } // namespace internal | 517 } // namespace internal |
516 } // namespace v8 | 518 } // namespace v8 |
517 | 519 |
518 #endif // V8_COMPILER_NODE_MATCHERS_H_ | 520 #endif // V8_COMPILER_NODE_MATCHERS_H_ |
OLD | NEW |