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/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/js-operator.h" | 9 #include "src/compiler/js-operator.h" |
10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 inline bool OperatorProperties::HasControlInput(Operator* op) { | 30 inline bool OperatorProperties::HasControlInput(Operator* op) { |
31 return OperatorProperties::GetControlInputCount(op) > 0; | 31 return OperatorProperties::GetControlInputCount(op) > 0; |
32 } | 32 } |
33 | 33 |
34 inline bool OperatorProperties::HasFrameStateInput(Operator* op) { | 34 inline bool OperatorProperties::HasFrameStateInput(Operator* op) { |
35 if (!FLAG_turbo_deoptimization) { | 35 if (!FLAG_turbo_deoptimization) { |
36 return false; | 36 return false; |
37 } | 37 } |
38 | 38 |
39 switch (op->opcode()) { | 39 switch (op->opcode()) { |
40 case IrOpcode::kJSCallFunction: | |
41 case IrOpcode::kJSCallConstruct: | |
42 return true; | |
43 case IrOpcode::kJSCallRuntime: { | 40 case IrOpcode::kJSCallRuntime: { |
44 Runtime::FunctionId function = | 41 Runtime::FunctionId function = |
45 reinterpret_cast<Operator1<Runtime::FunctionId>*>(op)->parameter(); | 42 reinterpret_cast<Operator1<Runtime::FunctionId>*>(op)->parameter(); |
46 // TODO(jarin) At the moment, we only add frame state for | 43 return Linkage::NeedsFrameState(function); |
47 // few chosen runtime functions. | |
48 switch (function) { | |
49 case Runtime::kDebugBreak: | |
50 case Runtime::kDeoptimizeFunction: | |
51 case Runtime::kSetScriptBreakPoint: | |
52 case Runtime::kDebugGetLoadedScripts: | |
53 case Runtime::kStackGuard: | |
54 return true; | |
55 default: | |
56 return false; | |
57 } | |
58 UNREACHABLE(); | |
59 } | 44 } |
60 | 45 |
| 46 // Strict equality cannot lazily deoptimize. |
| 47 case IrOpcode::kJSStrictEqual: |
| 48 case IrOpcode::kJSStrictNotEqual: |
| 49 return false; |
| 50 |
| 51 // Calls |
| 52 case IrOpcode::kJSCallFunction: |
| 53 case IrOpcode::kJSCallConstruct: |
| 54 |
| 55 // Compare operations |
| 56 case IrOpcode::kJSEqual: |
| 57 case IrOpcode::kJSNotEqual: |
| 58 case IrOpcode::kJSLessThan: |
| 59 case IrOpcode::kJSGreaterThan: |
| 60 case IrOpcode::kJSLessThanOrEqual: |
| 61 case IrOpcode::kJSGreaterThanOrEqual: |
| 62 |
61 // Binary operations | 63 // Binary operations |
62 case IrOpcode::kJSBitwiseOr: | 64 case IrOpcode::kJSBitwiseOr: |
63 case IrOpcode::kJSBitwiseXor: | 65 case IrOpcode::kJSBitwiseXor: |
64 case IrOpcode::kJSBitwiseAnd: | 66 case IrOpcode::kJSBitwiseAnd: |
65 case IrOpcode::kJSShiftLeft: | 67 case IrOpcode::kJSShiftLeft: |
66 case IrOpcode::kJSShiftRight: | 68 case IrOpcode::kJSShiftRight: |
67 case IrOpcode::kJSShiftRightLogical: | 69 case IrOpcode::kJSShiftRightLogical: |
68 case IrOpcode::kJSAdd: | 70 case IrOpcode::kJSAdd: |
69 case IrOpcode::kJSSubtract: | 71 case IrOpcode::kJSSubtract: |
70 case IrOpcode::kJSMultiply: | 72 case IrOpcode::kJSMultiply: |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || | 172 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || |
171 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || | 173 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || |
172 opcode == IrOpcode::kIfFalse; | 174 opcode == IrOpcode::kIfFalse; |
173 } | 175 } |
174 | 176 |
175 } | 177 } |
176 } | 178 } |
177 } // namespace v8::internal::compiler | 179 } // namespace v8::internal::compiler |
178 | 180 |
179 #endif // V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ | 181 #endif // V8_COMPILER_OPERATOR_PROPERTIES_INL_H_ |
OLD | NEW |