Commit 1411c762 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Pass NoContextConstant to stubs that don't need a context.

The generic implementations for typeof, strict equality and ToBoolean
don't need a context, so we can just pass the NoContextConstant (which
is Smi zero) instead, to reduce the live ranges for the context.

R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2400633002
Cr-Commit-Position: refs/heads/master@{#40027}
parent f88fe51a
......@@ -116,6 +116,8 @@ void JSGenericLowering::ReplaceWithRuntimeCall(Node* node,
}
void JSGenericLowering::LowerJSStrictEqual(Node* node) {
// The === operator doesn't need the current context.
NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant());
Callable callable = CodeFactory::StrictEqual(isolate());
node->RemoveInput(4); // control
ReplaceWithStubCall(node, callable, CallDescriptor::kNoFlags,
......@@ -123,6 +125,8 @@ void JSGenericLowering::LowerJSStrictEqual(Node* node) {
}
void JSGenericLowering::LowerJSStrictNotEqual(Node* node) {
// The !== operator doesn't need the current context.
NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant());
Callable callable = CodeFactory::StrictNotEqual(isolate());
node->RemoveInput(4); // control
ReplaceWithStubCall(node, callable, CallDescriptor::kNoFlags,
......@@ -130,6 +134,8 @@ void JSGenericLowering::LowerJSStrictNotEqual(Node* node) {
}
void JSGenericLowering::LowerJSToBoolean(Node* node) {
// The ToBoolean conversion doesn't need the current context.
NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant());
Callable callable = CodeFactory::ToBoolean(isolate());
node->AppendInput(zone(), graph()->start());
ReplaceWithStubCall(node, callable, CallDescriptor::kNoAllocate,
......@@ -137,6 +143,8 @@ void JSGenericLowering::LowerJSToBoolean(Node* node) {
}
void JSGenericLowering::LowerJSTypeOf(Node* node) {
// The typeof operator doesn't need the current context.
NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant());
Callable callable = CodeFactory::Typeof(isolate());
node->AppendInput(zone(), graph()->start());
ReplaceWithStubCall(node, callable, CallDescriptor::kNoAllocate,
......
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