Commit a7ff6165 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Remove eager frame state from runtime calls.

This removes the frame state input representing the before-state from
nodes having the {JSCallRuntime} operator. These frame states can by now
be found via checkpoints in the graph. It also makes the predicate for
runtime function ids (i.e. {Linkage::NeedsFrameStateInput}) binary.

R=jarin@chromium.org
BUG=v8:5021

Review-Url: https://codereview.chromium.org/2018353004
Cr-Commit-Position: refs/heads/master@{#36679}
parent 31392d70
...@@ -131,7 +131,7 @@ CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { ...@@ -131,7 +131,7 @@ CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) {
// static // static
int Linkage::FrameStateInputCount(Runtime::FunctionId function) { bool Linkage::NeedsFrameStateInput(Runtime::FunctionId function) {
// Most runtime functions need a FrameState. A few chosen ones that we know // Most runtime functions need a FrameState. A few chosen ones that we know
// not to call into arbitrary JavaScript, not to throw, and not to deoptimize // not to call into arbitrary JavaScript, not to throw, and not to deoptimize
// are blacklisted here and can be called without a FrameState. // are blacklisted here and can be called without a FrameState.
...@@ -163,13 +163,15 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) { ...@@ -163,13 +163,15 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
case Runtime::kToFastProperties: // TODO(conradw): Is it safe? case Runtime::kToFastProperties: // TODO(conradw): Is it safe?
case Runtime::kTraceEnter: case Runtime::kTraceEnter:
case Runtime::kTraceExit: case Runtime::kTraceExit:
return 0; return false;
case Runtime::kInlineCall: case Runtime::kInlineCall:
case Runtime::kInlineDeoptimizeNow:
case Runtime::kInlineGetPrototype: case Runtime::kInlineGetPrototype:
case Runtime::kInlineNewObject: case Runtime::kInlineNewObject:
case Runtime::kInlineRegExpConstructResult: case Runtime::kInlineRegExpConstructResult:
case Runtime::kInlineRegExpExec: case Runtime::kInlineRegExpExec:
case Runtime::kInlineSubString: case Runtime::kInlineSubString:
case Runtime::kInlineThrowNotDateError:
case Runtime::kInlineToInteger: case Runtime::kInlineToInteger:
case Runtime::kInlineToLength: case Runtime::kInlineToLength:
case Runtime::kInlineToName: case Runtime::kInlineToName:
...@@ -179,10 +181,7 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) { ...@@ -179,10 +181,7 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
case Runtime::kInlineToPrimitive_Number: case Runtime::kInlineToPrimitive_Number:
case Runtime::kInlineToPrimitive_String: case Runtime::kInlineToPrimitive_String:
case Runtime::kInlineToString: case Runtime::kInlineToString:
return 1; return true;
case Runtime::kInlineDeoptimizeNow:
case Runtime::kInlineThrowNotDateError:
return 2;
default: default:
break; break;
} }
...@@ -190,9 +189,9 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) { ...@@ -190,9 +189,9 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
// Most inlined runtime functions (except the ones listed above) can be called // Most inlined runtime functions (except the ones listed above) can be called
// without a FrameState or will be lowered by JSIntrinsicLowering internally. // without a FrameState or will be lowered by JSIntrinsicLowering internally.
const Runtime::Function* const f = Runtime::FunctionForId(function); const Runtime::Function* const f = Runtime::FunctionForId(function);
if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return 0; if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return false;
return 1; return true;
} }
...@@ -255,7 +254,7 @@ CallDescriptor* Linkage::GetRuntimeCallDescriptor( ...@@ -255,7 +254,7 @@ CallDescriptor* Linkage::GetRuntimeCallDescriptor(
locations.AddParam(regloc(kContextRegister)); locations.AddParam(regloc(kContextRegister));
types.AddParam(MachineType::AnyTagged()); types.AddParam(MachineType::AnyTagged());
if (Linkage::FrameStateInputCount(function_id) == 0) { if (!Linkage::NeedsFrameStateInput(function_id)) {
flags = static_cast<CallDescriptor::Flags>( flags = static_cast<CallDescriptor::Flags>(
flags & ~CallDescriptor::kNeedsFrameState); flags & ~CallDescriptor::kNeedsFrameState);
} }
......
...@@ -368,7 +368,7 @@ class Linkage : public ZoneObject { ...@@ -368,7 +368,7 @@ class Linkage : public ZoneObject {
bool ParameterHasSecondaryLocation(int index) const; bool ParameterHasSecondaryLocation(int index) const;
LinkageLocation GetParameterSecondaryLocation(int index) const; LinkageLocation GetParameterSecondaryLocation(int index) const;
static int FrameStateInputCount(Runtime::FunctionId function); static bool NeedsFrameStateInput(Runtime::FunctionId function);
// Get the location where an incoming OSR value is stored. // Get the location where an incoming OSR value is stored.
LinkageLocation GetOsrValueLocation(int index) const; LinkageLocation GetOsrValueLocation(int index) const;
......
...@@ -27,7 +27,7 @@ int OperatorProperties::GetFrameStateInputCount(const Operator* op) { ...@@ -27,7 +27,7 @@ int OperatorProperties::GetFrameStateInputCount(const Operator* op) {
return 1; return 1;
case IrOpcode::kJSCallRuntime: { case IrOpcode::kJSCallRuntime: {
const CallRuntimeParameters& p = CallRuntimeParametersOf(op); const CallRuntimeParameters& p = CallRuntimeParametersOf(op);
return Linkage::FrameStateInputCount(p.id()); return Linkage::NeedsFrameStateInput(p.id()) ? 1 : 0;
} }
// Strict equality cannot lazily deoptimize. // Strict equality cannot lazily deoptimize.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment