Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 1177033006: [turbofan] Remove context canonicalization hack from generic lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index da0ccb0580fee7a868ccd8f51622ce9e7b3ec78b..322654cad57371f7f5f49dc39af36d8a768b1f1a 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -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 =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698