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) {
// 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
// not to call into arbitrary JavaScript, not to throw, and not to deoptimize
// are blacklisted here and can be called without a FrameState.
......@@ -163,13 +163,15 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
case Runtime::kToFastProperties: // TODO(conradw): Is it safe?
case Runtime::kTraceEnter:
case Runtime::kTraceExit:
return 0;
return false;
case Runtime::kInlineCall:
case Runtime::kInlineDeoptimizeNow:
case Runtime::kInlineGetPrototype:
case Runtime::kInlineNewObject:
case Runtime::kInlineRegExpConstructResult:
case Runtime::kInlineRegExpExec:
case Runtime::kInlineSubString:
case Runtime::kInlineThrowNotDateError:
case Runtime::kInlineToInteger:
case Runtime::kInlineToLength:
case Runtime::kInlineToName:
......@@ -179,10 +181,7 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
case Runtime::kInlineToPrimitive_Number:
case Runtime::kInlineToPrimitive_String:
case Runtime::kInlineToString:
return 1;
case Runtime::kInlineDeoptimizeNow:
case Runtime::kInlineThrowNotDateError:
return 2;
return true;
default:
break;
}
......@@ -190,9 +189,9 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
// Most inlined runtime functions (except the ones listed above) can be called
// without a FrameState or will be lowered by JSIntrinsicLowering internally.
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(
locations.AddParam(regloc(kContextRegister));
types.AddParam(MachineType::AnyTagged());
if (Linkage::FrameStateInputCount(function_id) == 0) {
if (!Linkage::NeedsFrameStateInput(function_id)) {
flags = static_cast<CallDescriptor::Flags>(
flags & ~CallDescriptor::kNeedsFrameState);
}
......
......@@ -368,7 +368,7 @@ class Linkage : public ZoneObject {
bool ParameterHasSecondaryLocation(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.
LinkageLocation GetOsrValueLocation(int index) const;
......
......@@ -27,7 +27,7 @@ int OperatorProperties::GetFrameStateInputCount(const Operator* op) {
return 1;
case IrOpcode::kJSCallRuntime: {
const CallRuntimeParameters& p = CallRuntimeParametersOf(op);
return Linkage::FrameStateInputCount(p.id());
return Linkage::NeedsFrameStateInput(p.id()) ? 1 : 0;
}
// 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