OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_OPERATOR_PROPERTIES_INL_H_ | 5 #ifndef V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ |
6 #define V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ | 6 #define V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
| 10 #include "src/compiler/js-operator.h" |
10 #include "src/compiler/opcodes.h" | 11 #include "src/compiler/opcodes.h" |
11 #include "src/compiler/operator-properties.h" | 12 #include "src/compiler/operator-properties.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 namespace compiler { | 16 namespace compiler { |
16 | 17 |
17 inline bool OperatorProperties::HasValueInput(Operator* op) { | 18 inline bool OperatorProperties::HasValueInput(Operator* op) { |
18 return OperatorProperties::GetValueInputCount(op) > 0; | 19 return OperatorProperties::GetValueInputCount(op) > 0; |
19 } | 20 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 opcode == IrOpcode::kPhi; | 124 opcode == IrOpcode::kPhi; |
124 } | 125 } |
125 | 126 |
126 inline bool OperatorProperties::IsScheduleRoot(Operator* op) { | 127 inline bool OperatorProperties::IsScheduleRoot(Operator* op) { |
127 uint8_t opcode = op->opcode(); | 128 uint8_t opcode = op->opcode(); |
128 return opcode == IrOpcode::kEnd || opcode == IrOpcode::kEffectPhi || | 129 return opcode == IrOpcode::kEnd || opcode == IrOpcode::kEffectPhi || |
129 opcode == IrOpcode::kPhi; | 130 opcode == IrOpcode::kPhi; |
130 } | 131 } |
131 | 132 |
132 inline bool OperatorProperties::CanLazilyDeoptimize(Operator* op) { | 133 inline bool OperatorProperties::CanLazilyDeoptimize(Operator* op) { |
| 134 // TODO(jarin) This function allows turning on lazy deoptimization |
| 135 // incrementally. It will change as we turn on lazy deopt for |
| 136 // more nodes. |
| 137 |
| 138 if (!FLAG_turbo_deoptimization) { |
| 139 return false; |
| 140 } |
| 141 |
133 if (op->opcode() == IrOpcode::kCall) { | 142 if (op->opcode() == IrOpcode::kCall) { |
134 CallOperator* call_op = reinterpret_cast<CallOperator*>(op); | 143 CallOperator* call_op = reinterpret_cast<CallOperator*>(op); |
135 CallDescriptor* descriptor = call_op->parameter(); | 144 CallDescriptor* descriptor = call_op->parameter(); |
136 return descriptor->CanLazilyDeoptimize(); | 145 return descriptor->CanLazilyDeoptimize(); |
137 } | 146 } |
138 if (op->opcode() == IrOpcode::kJSCallRuntime) { | 147 if (op->opcode() == IrOpcode::kJSCallRuntime) { |
139 // TODO(jarin) At the moment, we only support lazy deoptimization for | 148 // TODO(jarin) At the moment, we only support lazy deoptimization for |
140 // the %DeoptimizeFunction runtime function. | 149 // the %DeoptimizeFunction runtime function. |
141 Runtime::FunctionId function = | 150 Runtime::FunctionId function = |
142 reinterpret_cast<Operator1<Runtime::FunctionId>*>(op)->parameter(); | 151 reinterpret_cast<Operator1<Runtime::FunctionId>*>(op)->parameter(); |
143 return function == Runtime::kDeoptimizeFunction; | 152 return function == Runtime::kDeoptimizeFunction; |
144 } | 153 } |
| 154 if (op->opcode() == IrOpcode::kJSCallFunction) { |
| 155 CallParameters p = |
| 156 reinterpret_cast<Operator1<CallParameters>*>(op)->parameter(); |
| 157 return p.can_deoptimize == CallDescriptor::kCanDeoptimize; |
| 158 } |
145 return false; | 159 return false; |
146 } | 160 } |
147 } | 161 } |
148 } | 162 } |
149 } // namespace v8::internal::compiler | 163 } // namespace v8::internal::compiler |
150 | 164 |
151 #endif // V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ | 165 #endif // V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ |
OLD | NEW |