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

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

Issue 492203002: Initial support for debugger frame state in Turbofan. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Another attempt to fix Win64 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
Index: src/compiler/operator-properties-inl.h
diff --git a/src/compiler/operator-properties-inl.h b/src/compiler/operator-properties-inl.h
index 72e4b6112d96a140a9c9561906f5445e5f1dba36..a65068d7fff97934a9ddf1ea26595b9e38ff0566 100644
--- a/src/compiler/operator-properties-inl.h
+++ b/src/compiler/operator-properties-inl.h
@@ -31,6 +31,33 @@ inline bool OperatorProperties::HasControlInput(Operator* op) {
return OperatorProperties::GetControlInputCount(op) > 0;
}
+inline bool OperatorProperties::HasFrameStateInput(Operator* op) {
+ if (!FLAG_turbo_deoptimization) {
+ return false;
+ }
+
+ switch (op->opcode()) {
+ case IrOpcode::kJSCallFunction:
+ return true;
+ case IrOpcode::kJSCallRuntime: {
+ Runtime::FunctionId function =
+ reinterpret_cast<Operator1<Runtime::FunctionId>*>(op)->parameter();
+ // TODO(jarin) At the moment, we only add frame state for
+ // few chosen runtime functions.
+ switch (function) {
+ case Runtime::kDebugBreak:
+ case Runtime::kDeoptimizeFunction:
+ return true;
+ default:
+ return false;
+ }
+ UNREACHABLE();
+ }
+
+ default:
+ return false;
+ }
+}
inline int OperatorProperties::GetValueInputCount(Operator* op) {
return op->InputCount();
@@ -40,6 +67,10 @@ inline int OperatorProperties::GetContextInputCount(Operator* op) {
return OperatorProperties::HasContextInput(op) ? 1 : 0;
}
+inline int OperatorProperties::GetFrameStateInputCount(Operator* op) {
+ return OperatorProperties::HasFrameStateInput(op) ? 1 : 0;
+}
+
inline int OperatorProperties::GetEffectInputCount(Operator* op) {
if (op->opcode() == IrOpcode::kEffectPhi ||
op->opcode() == IrOpcode::kFinish) {
@@ -77,7 +108,8 @@ inline int OperatorProperties::GetControlInputCount(Operator* op) {
inline int OperatorProperties::GetTotalInputCount(Operator* op) {
return GetValueInputCount(op) + GetContextInputCount(op) +
- GetEffectInputCount(op) + GetControlInputCount(op);
+ GetFrameStateInputCount(op) + GetEffectInputCount(op) +
+ GetControlInputCount(op);
}
// -----------------------------------------------------------------------------
@@ -142,8 +174,15 @@ inline bool OperatorProperties::CanLazilyDeoptimize(Operator* op) {
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;
+ // a few chosen runtime functions.
+ switch (function) {
+ case Runtime::kDebugBreak:
+ case Runtime::kDeoptimizeFunction:
+ return true;
+ default:
+ return false;
+ }
+ UNREACHABLE();
}
// JS function calls

Powered by Google App Engine
This is Rietveld 408576698