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

Unified Diff: src/compiler/typer.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-typed-lowering.cc ('k') | test/unittests/compiler/js-typed-lowering-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typer.cc
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
index d95d3dbf7c9cfe11747e84b9b3a6727b535353ec..4349eeab378d41fee88a014d986870aab4d30e8d 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -1347,34 +1347,6 @@ Type* Typer::Visitor::TypeJSLoadProperty(Node* node) {
Type* Typer::Visitor::TypeJSLoadNamed(Node* node) {
- Factory* const f = isolate()->factory();
- Handle<Name> name = NamedAccessOf(node->op()).name();
- if (name.is_identical_to(f->prototype_string())) {
- Type* receiver = Operand(node, 0);
- if (receiver->Is(Type::None())) return Type::None();
- if (receiver->IsConstant() &&
- receiver->AsConstant()->Value()->IsJSFunction()) {
- Handle<JSFunction> function =
- Handle<JSFunction>::cast(receiver->AsConstant()->Value());
- if (function->has_prototype()) {
- // We need to add a code dependency on the initial map of the {function}
- // in order to be notified about changes to "prototype" of {function},
- // so we can only infer a constant type if deoptimization is enabled.
- if (flags() & kDeoptimizationEnabled) {
- JSFunction::EnsureHasInitialMap(function);
- Handle<Map> initial_map(function->initial_map(), isolate());
- dependencies()->AssumeInitialMapCantChange(initial_map);
- return Type::Constant(handle(initial_map->prototype(), isolate()),
- zone());
- }
- }
- } else if (receiver->IsClass() &&
- receiver->AsClass()->Map()->IsJSFunctionMap()) {
- Handle<Map> map = receiver->AsClass()->Map();
- return map->has_non_instance_prototype() ? Type::Primitive()
- : Type::Receiver();
- }
- }
return Type::Any();
}
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | test/unittests/compiler/js-typed-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698