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

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 1490003003: Don't EnsureHasInitialMap on non-constructors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/compilation-dependencies.h" 6 #include "src/compilation-dependencies.h"
7 #include "src/compiler/access-builder.h" 7 #include "src/compiler/access-builder.h"
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/js-typed-lowering.h" 9 #include "src/compiler/js-typed-lowering.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 1113
1114 JSBinopReduction r(this, node); 1114 JSBinopReduction r(this, node);
1115 Node* effect = r.effect(); 1115 Node* effect = r.effect();
1116 Node* control = r.control(); 1116 Node* control = r.control();
1117 1117
1118 if (r.right_type()->IsConstant() && 1118 if (r.right_type()->IsConstant() &&
1119 r.right_type()->AsConstant()->Value()->IsJSFunction()) { 1119 r.right_type()->AsConstant()->Value()->IsJSFunction()) {
1120 Handle<JSFunction> function = 1120 Handle<JSFunction> function =
1121 Handle<JSFunction>::cast(r.right_type()->AsConstant()->Value()); 1121 Handle<JSFunction>::cast(r.right_type()->AsConstant()->Value());
1122 Handle<SharedFunctionInfo> shared(function->shared(), isolate()); 1122 Handle<SharedFunctionInfo> shared(function->shared(), isolate());
1123 if (!function->map()->has_non_instance_prototype()) { 1123 if (function->IsConstructor() &&
1124 !function->map()->has_non_instance_prototype()) {
1124 JSFunction::EnsureHasInitialMap(function); 1125 JSFunction::EnsureHasInitialMap(function);
1125 DCHECK(function->has_initial_map()); 1126 DCHECK(function->has_initial_map());
1126 Handle<Map> initial_map(function->initial_map(), isolate()); 1127 Handle<Map> initial_map(function->initial_map(), isolate());
1127 this->dependencies()->AssumeInitialMapCantChange(initial_map); 1128 this->dependencies()->AssumeInitialMapCantChange(initial_map);
1128 Node* prototype = 1129 Node* prototype =
1129 jsgraph()->Constant(handle(initial_map->prototype(), isolate())); 1130 jsgraph()->Constant(handle(initial_map->prototype(), isolate()));
1130 1131
1131 Node* if_is_smi = nullptr; 1132 Node* if_is_smi = nullptr;
1132 Node* e_is_smi = nullptr; 1133 Node* e_is_smi = nullptr;
1133 // If the left hand side is an object, no smi check is needed. 1134 // If the left hand side is an object, no smi check is needed.
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
2568 } 2569 }
2569 2570
2570 2571
2571 CompilationDependencies* JSTypedLowering::dependencies() const { 2572 CompilationDependencies* JSTypedLowering::dependencies() const {
2572 return dependencies_; 2573 return dependencies_;
2573 } 2574 }
2574 2575
2575 } // namespace compiler 2576 } // namespace compiler
2576 } // namespace internal 2577 } // namespace internal
2577 } // namespace v8 2578 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698