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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 // Compare operators that can deopt in the middle the operation (e.g., | 101 // Compare operators that can deopt in the middle the operation (e.g., |
102 // as a result of lazy deopt in ToNumber conversion) need a second frame | 102 // as a result of lazy deopt in ToNumber conversion) need a second frame |
103 // state so that we can resume before the operation. | 103 // state so that we can resume before the operation. |
104 case IrOpcode::kJSGreaterThan: | 104 case IrOpcode::kJSGreaterThan: |
105 case IrOpcode::kJSGreaterThanOrEqual: | 105 case IrOpcode::kJSGreaterThanOrEqual: |
106 case IrOpcode::kJSLessThan: | 106 case IrOpcode::kJSLessThan: |
107 case IrOpcode::kJSLessThanOrEqual: | 107 case IrOpcode::kJSLessThanOrEqual: |
108 return 2; | 108 return 2; |
109 | 109 |
| 110 // Simplified operators with type feedback. |
| 111 case IrOpcode::kSpeculativeNumberAdd: |
| 112 case IrOpcode::kSpeculativeNumberSubtract: |
| 113 // Checked conversions. |
| 114 case IrOpcode::kCheckedUint32ToInt32: |
| 115 case IrOpcode::kCheckedFloat64ToInt32: |
| 116 case IrOpcode::kCheckedTaggedToInt32: |
| 117 case IrOpcode::kCheckedTaggedToFloat64: |
| 118 return 1; |
| 119 |
110 default: | 120 default: |
111 return 0; | 121 return 0; |
112 } | 122 } |
113 } | 123 } |
114 | 124 |
115 | 125 |
116 // static | 126 // static |
117 int OperatorProperties::GetTotalInputCount(const Operator* op) { | 127 int OperatorProperties::GetTotalInputCount(const Operator* op) { |
118 return op->ValueInputCount() + GetContextInputCount(op) + | 128 return op->ValueInputCount() + GetContextInputCount(op) + |
119 GetFrameStateInputCount(op) + op->EffectInputCount() + | 129 GetFrameStateInputCount(op) + op->EffectInputCount() + |
120 op->ControlInputCount(); | 130 op->ControlInputCount(); |
121 } | 131 } |
122 | 132 |
123 | 133 |
124 // static | 134 // static |
125 bool OperatorProperties::IsBasicBlockBegin(const Operator* op) { | 135 bool OperatorProperties::IsBasicBlockBegin(const Operator* op) { |
126 Operator::Opcode const opcode = op->opcode(); | 136 Operator::Opcode const opcode = op->opcode(); |
127 return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd || | 137 return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd || |
128 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || | 138 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || |
129 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || | 139 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || |
130 opcode == IrOpcode::kIfFalse || opcode == IrOpcode::kIfSuccess || | 140 opcode == IrOpcode::kIfFalse || opcode == IrOpcode::kIfSuccess || |
131 opcode == IrOpcode::kIfException || opcode == IrOpcode::kIfValue || | 141 opcode == IrOpcode::kIfException || opcode == IrOpcode::kIfValue || |
132 opcode == IrOpcode::kIfDefault; | 142 opcode == IrOpcode::kIfDefault; |
133 } | 143 } |
134 | 144 |
135 } // namespace compiler | 145 } // namespace compiler |
136 } // namespace internal | 146 } // namespace internal |
137 } // namespace v8 | 147 } // namespace v8 |
OLD | NEW |