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

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

Issue 1965293002: [turbofan] Unify function prototype constant folding. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « src/compiler/js-native-context-specialization.cc ('k') | src/compiler/typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index f11b8cd927061b3ec3ef7cd022d0986c63dba79a..cbcd32e229a2a8be1035f17b31ce2c6dac01f517 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -936,27 +936,6 @@ Reduction JSTypedLowering::ReduceJSLoadNamed(Node* node) {
ReplaceWithValue(node, value, effect);
return Replace(value);
}
- // Optimize "prototype" property of functions.
- if (name.is_identical_to(factory()->prototype_string()) &&
- receiver_type->IsConstant() &&
- receiver_type->AsConstant()->Value()->IsJSFunction()) {
- // TODO(turbofan): This lowering might not kick in if we ever lower
- // the C++ accessor for "prototype" in an earlier optimization pass.
- Handle<JSFunction> function =
- Handle<JSFunction>::cast(receiver_type->AsConstant()->Value());
- if (function->has_initial_map()) {
- // We need to add a code dependency on the initial map of the {function}
- // in order to be notified about changes to the "prototype" of {function},
- // so it doesn't make sense to continue unless deoptimization is enabled.
- if (!(flags() & kDeoptimizationEnabled)) return NoChange();
- Handle<Map> initial_map(function->initial_map(), isolate());
- dependencies()->AssumeInitialMapCantChange(initial_map);
- Node* value =
- jsgraph()->Constant(handle(initial_map->prototype(), isolate()));
- ReplaceWithValue(node, value);
- return Replace(value);
- }
- }
return NoChange();
}
« no previous file with comments | « src/compiler/js-native-context-specialization.cc ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698