Commit d06591a2 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Remove context canonicalization hack from generic lowering.

This hack doesn't help currently, since it only applies to asm.js where
we do function context specialization and there we already have a
canonicalized context (and the CodeGenerator materializes that from the
frame).

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29025}
parent a12f1191
......@@ -535,17 +535,9 @@ bool JSGenericLowering::TryLowerDirectJSCall(Node* node) {
Type* ok_receiver = Type::Union(Type::Undefined(), Type::Receiver(), zone());
if (!NodeProperties::GetBounds(receiver).upper->Is(ok_receiver)) return false;
int index = NodeProperties::FirstContextIndex(node);
// TODO(titzer): total hack to share function context constants.
// Remove this when the JSGraph canonicalizes heap constants.
Node* context = node->InputAt(index);
HeapObjectMatcher<Context> context_const(context);
if (!context_const.HasValue() ||
*(context_const.Value().handle()) != function->context()) {
context = jsgraph()->HeapConstant(Handle<Context>(function->context()));
}
node->ReplaceInput(index, context);
// Update to the function context.
NodeProperties::ReplaceContextInput(
node, jsgraph()->HeapConstant(Handle<Context>(function->context())));
CallDescriptor::Flags flags = FlagsForNode(node);
if (is_strict(p.language_mode())) flags |= CallDescriptor::kSupportsTailCalls;
CallDescriptor* desc =
......
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