Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: src/compiler/operator-properties-inl.h

Issue 450103004: Reland "More lazy deoptimization in Turbofan (binops, loads/stores)" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add missing deopts (still with invalid bailout id) Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/linkage-impl.h ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/operator-properties-inl.h
diff --git a/src/compiler/operator-properties-inl.h b/src/compiler/operator-properties-inl.h
index fc9149dedb9c8f3a91c7ac27f33eadcf9f00d48d..42833fdeb417027543f0ed87ff293663d2b2c259 100644
--- a/src/compiler/operator-properties-inl.h
+++ b/src/compiler/operator-properties-inl.h
@@ -7,6 +7,7 @@
#include "src/v8.h"
+#include "src/compiler/js-operator.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator-properties.h"
@@ -59,6 +60,10 @@ inline int OperatorProperties::GetControlInputCount(Operator* op) {
#undef OPCODE_CASE
return static_cast<ControlOperator*>(op)->ControlInputCount();
default:
+ // If a node can lazily deoptimize, it needs control dependency.
+ if (CanLazilyDeoptimize(op)) {
+ return 1;
+ }
// Operators that have write effects must have a control
// dependency. Effect dependencies only ensure the correct order of
// write/read operations without consideration of control flow. Without an
@@ -130,17 +135,52 @@ inline bool OperatorProperties::IsScheduleRoot(Operator* op) {
}
inline bool OperatorProperties::CanLazilyDeoptimize(Operator* op) {
- if (op->opcode() == IrOpcode::kCall) {
- CallOperator* call_op = reinterpret_cast<CallOperator*>(op);
- CallDescriptor* descriptor = call_op->parameter();
- return descriptor->CanLazilyDeoptimize();
+ // TODO(jarin) This function allows turning on lazy deoptimization
+ // incrementally. It will change as we turn on lazy deopt for
+ // more nodes.
+
+ if (!FLAG_turbo_deoptimization) {
+ return false;
}
- if (op->opcode() == IrOpcode::kJSCallRuntime) {
- // TODO(jarin) At the moment, we only support lazy deoptimization for
- // the %DeoptimizeFunction runtime function.
- Runtime::FunctionId function =
- reinterpret_cast<Operator1<Runtime::FunctionId>*>(op)->parameter();
- return function == Runtime::kDeoptimizeFunction;
+
+ switch (op->opcode()) {
+ case IrOpcode::kCall: {
+ CallOperator* call_op = reinterpret_cast<CallOperator*>(op);
+ CallDescriptor* descriptor = call_op->parameter();
+ return descriptor->CanLazilyDeoptimize();
+ }
+ case IrOpcode::kJSCallRuntime: {
+ Runtime::FunctionId function =
+ reinterpret_cast<Operator1<Runtime::FunctionId>*>(op)->parameter();
+ // TODO(jarin) At the moment, we only support lazy deoptimization for
+ // the %DeoptimizeFunction runtime function.
+ return function == Runtime::kDeoptimizeFunction;
+ }
+
+ // JS function calls
+ case IrOpcode::kJSCallFunction:
+ case IrOpcode::kJSCallConstruct:
+
+ // Binary operations
+ case IrOpcode::kJSBitwiseOr:
+ case IrOpcode::kJSBitwiseXor:
+ case IrOpcode::kJSBitwiseAnd:
+ case IrOpcode::kJSShiftLeft:
+ case IrOpcode::kJSShiftRight:
+ case IrOpcode::kJSShiftRightLogical:
+ case IrOpcode::kJSAdd:
+ case IrOpcode::kJSSubtract:
+ case IrOpcode::kJSMultiply:
+ case IrOpcode::kJSDivide:
+ case IrOpcode::kJSModulus:
+ case IrOpcode::kJSLoadProperty:
+ case IrOpcode::kJSStoreProperty:
+ case IrOpcode::kJSLoadNamed:
+ case IrOpcode::kJSStoreNamed:
+ return true;
+
+ default:
+ return false;
}
return false;
}
« no previous file with comments | « src/compiler/linkage-impl.h ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698