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/operator-properties.h" | 5 #include "src/compiler/operator-properties.h" |
6 | 6 |
7 #include "src/compiler/js-operator.h" | 7 #include "src/compiler/js-operator.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/opcodes.h" | 9 #include "src/compiler/opcodes.h" |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 case IrOpcode::kJSLessThan: | 50 case IrOpcode::kJSLessThan: |
51 case IrOpcode::kJSLessThanOrEqual: | 51 case IrOpcode::kJSLessThanOrEqual: |
52 case IrOpcode::kJSNotEqual: | 52 case IrOpcode::kJSNotEqual: |
53 | 53 |
54 // Binary operations | 54 // Binary operations |
55 case IrOpcode::kJSAdd: | 55 case IrOpcode::kJSAdd: |
56 case IrOpcode::kJSBitwiseAnd: | 56 case IrOpcode::kJSBitwiseAnd: |
57 case IrOpcode::kJSBitwiseOr: | 57 case IrOpcode::kJSBitwiseOr: |
58 case IrOpcode::kJSBitwiseXor: | 58 case IrOpcode::kJSBitwiseXor: |
59 case IrOpcode::kJSDivide: | 59 case IrOpcode::kJSDivide: |
60 case IrOpcode::kJSLoadNamed: | |
61 case IrOpcode::kJSLoadProperty: | |
62 case IrOpcode::kJSModulus: | 60 case IrOpcode::kJSModulus: |
63 case IrOpcode::kJSMultiply: | 61 case IrOpcode::kJSMultiply: |
64 case IrOpcode::kJSShiftLeft: | 62 case IrOpcode::kJSShiftLeft: |
65 case IrOpcode::kJSShiftRight: | 63 case IrOpcode::kJSShiftRight: |
66 case IrOpcode::kJSShiftRightLogical: | 64 case IrOpcode::kJSShiftRightLogical: |
67 case IrOpcode::kJSStoreNamed: | |
68 case IrOpcode::kJSStoreProperty: | |
69 case IrOpcode::kJSSubtract: | 65 case IrOpcode::kJSSubtract: |
70 | 66 |
| 67 // Context operations |
| 68 case IrOpcode::kJSCreateWithContext: |
| 69 |
71 // Conversions | 70 // Conversions |
72 case IrOpcode::kJSToObject: | 71 case IrOpcode::kJSToObject: |
73 case IrOpcode::kJSToNumber: | 72 case IrOpcode::kJSToNumber: |
74 | 73 |
75 // Other | 74 // Properties |
| 75 case IrOpcode::kJSLoadNamed: |
| 76 case IrOpcode::kJSLoadProperty: |
| 77 case IrOpcode::kJSStoreNamed: |
| 78 case IrOpcode::kJSStoreProperty: |
76 case IrOpcode::kJSDeleteProperty: | 79 case IrOpcode::kJSDeleteProperty: |
77 return true; | 80 return true; |
78 | 81 |
79 default: | 82 default: |
80 return false; | 83 return false; |
81 } | 84 } |
82 } | 85 } |
83 | 86 |
84 | 87 |
85 // static | 88 // static |
86 int OperatorProperties::GetTotalInputCount(const Operator* op) { | 89 int OperatorProperties::GetTotalInputCount(const Operator* op) { |
87 return op->ValueInputCount() + GetContextInputCount(op) + | 90 return op->ValueInputCount() + GetContextInputCount(op) + |
88 GetFrameStateInputCount(op) + op->EffectInputCount() + | 91 GetFrameStateInputCount(op) + op->EffectInputCount() + |
89 op->ControlInputCount(); | 92 op->ControlInputCount(); |
90 } | 93 } |
91 | 94 |
92 | 95 |
93 // static | 96 // static |
94 bool OperatorProperties::IsBasicBlockBegin(const Operator* op) { | 97 bool OperatorProperties::IsBasicBlockBegin(const Operator* op) { |
95 Operator::Opcode const opcode = op->opcode(); | 98 Operator::Opcode const opcode = op->opcode(); |
96 return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd || | 99 return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd || |
97 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || | 100 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || |
98 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || | 101 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || |
99 opcode == IrOpcode::kIfFalse; | 102 opcode == IrOpcode::kIfFalse; |
100 } | 103 } |
101 | 104 |
102 } // namespace compiler | 105 } // namespace compiler |
103 } // namespace internal | 106 } // namespace internal |
104 } // namespace v8 | 107 } // namespace v8 |
OLD | NEW |