summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/operator-properties.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/operator-properties.cc')
-rw-r--r--deps/v8/src/compiler/operator-properties.cc56
1 files changed, 34 insertions, 22 deletions
diff --git a/deps/v8/src/compiler/operator-properties.cc b/deps/v8/src/compiler/operator-properties.cc
index 53bd16c0af..3a91fd6b58 100644
--- a/deps/v8/src/compiler/operator-properties.cc
+++ b/deps/v8/src/compiler/operator-properties.cc
@@ -20,13 +20,13 @@ bool OperatorProperties::HasContextInput(const Operator* op) {
// static
-bool OperatorProperties::HasFrameStateInput(const Operator* op) {
+int OperatorProperties::GetFrameStateInputCount(const Operator* op) {
if (!FLAG_turbo_deoptimization) {
- return false;
+ return 0;
}
switch (op->opcode()) {
case IrOpcode::kFrameState:
- return true;
+ return 1;
case IrOpcode::kJSCallRuntime: {
const CallRuntimeParameters& p = CallRuntimeParametersOf(op);
return Linkage::NeedsFrameState(p.id());
@@ -35,7 +35,7 @@ bool OperatorProperties::HasFrameStateInput(const Operator* op) {
// Strict equality cannot lazily deoptimize.
case IrOpcode::kJSStrictEqual:
case IrOpcode::kJSStrictNotEqual:
- return false;
+ return 0;
// Calls
case IrOpcode::kJSCallFunction:
@@ -51,19 +51,6 @@ bool OperatorProperties::HasFrameStateInput(const Operator* op) {
case IrOpcode::kJSLessThanOrEqual:
case IrOpcode::kJSNotEqual:
- // Binary operations
- case IrOpcode::kJSAdd:
- case IrOpcode::kJSBitwiseAnd:
- case IrOpcode::kJSBitwiseOr:
- case IrOpcode::kJSBitwiseXor:
- case IrOpcode::kJSDivide:
- case IrOpcode::kJSModulus:
- case IrOpcode::kJSMultiply:
- case IrOpcode::kJSShiftLeft:
- case IrOpcode::kJSShiftRight:
- case IrOpcode::kJSShiftRightLogical:
- case IrOpcode::kJSSubtract:
-
// Context operations
case IrOpcode::kJSCreateWithContext:
@@ -72,16 +59,40 @@ bool OperatorProperties::HasFrameStateInput(const Operator* op) {
case IrOpcode::kJSToNumber:
case IrOpcode::kJSToName:
+ // Misc operations
+ case IrOpcode::kJSStackCheck:
+
// Properties
case IrOpcode::kJSLoadNamed:
- case IrOpcode::kJSLoadProperty:
case IrOpcode::kJSStoreNamed:
- case IrOpcode::kJSStoreProperty:
+ case IrOpcode::kJSLoadProperty:
case IrOpcode::kJSDeleteProperty:
- return true;
+ return 1;
+
+ // StoreProperty provides a second frame state just before
+ // the operation. This is used to lazy-deoptimize a to-number
+ // conversion for typed arrays.
+ case IrOpcode::kJSStoreProperty:
+ return 2;
+
+ // Binary operators that can deopt in the middle the operation (e.g.,
+ // as a result of lazy deopt in ToNumber conversion) need a second frame
+ // state so that we can resume before the operation.
+ case IrOpcode::kJSMultiply:
+ case IrOpcode::kJSAdd:
+ case IrOpcode::kJSBitwiseAnd:
+ case IrOpcode::kJSBitwiseOr:
+ case IrOpcode::kJSBitwiseXor:
+ case IrOpcode::kJSDivide:
+ case IrOpcode::kJSModulus:
+ case IrOpcode::kJSShiftLeft:
+ case IrOpcode::kJSShiftRight:
+ case IrOpcode::kJSShiftRightLogical:
+ case IrOpcode::kJSSubtract:
+ return 2;
default:
- return false;
+ return 0;
}
}
@@ -100,7 +111,8 @@ bool OperatorProperties::IsBasicBlockBegin(const Operator* op) {
return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd ||
opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop ||
opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue ||
- opcode == IrOpcode::kIfFalse || opcode == IrOpcode::kIfValue ||
+ opcode == IrOpcode::kIfFalse || opcode == IrOpcode::kIfSuccess ||
+ opcode == IrOpcode::kIfException || opcode == IrOpcode::kIfValue ||
opcode == IrOpcode::kIfDefault;
}