Commit 277091ba authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Always load context from target when lowering to direct call.

There's no benefit in embedding the context as a constant for direct
calls. In fact it seems to be cheaper both size and execution wise to
just always load the context from the target.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1506763002

Cr-Commit-Position: refs/heads/master@{#32640}
parent fc0a1a70
......@@ -1943,8 +1943,10 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) {
// See ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList ).
if (IsClassConstructor(shared->kind())) return NoChange();
// Grab the context from the {function}.
Node* context = jsgraph()->Constant(handle(function->context(), isolate()));
// Load the context from the {target}.
Node* context = effect = graph()->NewNode(
simplified()->LoadField(AccessBuilder::ForJSFunctionContext()), target,
effect, control);
NodeProperties::ReplaceContextInput(node, context);
// Check if we need to convert the {receiver}.
......@@ -1953,10 +1955,12 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) {
receiver = effect =
graph()->NewNode(javascript()->ConvertReceiver(convert_mode),
receiver, context, frame_state, effect, control);
NodeProperties::ReplaceEffectInput(node, effect);
NodeProperties::ReplaceValueInput(node, receiver, 1);
}
// Update the effect dependency for the {node}.
NodeProperties::ReplaceEffectInput(node, effect);
// Remove the eager bailout frame state.
NodeProperties::RemoveFrameStateInput(node, 1);
......
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