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

Side by Side Diff: src/crankshaft/hydrogen.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 | « src/compiler/js-typed-lowering.cc ('k') | src/objects.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/crankshaft/hydrogen.h" 5 #include "src/crankshaft/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/allocation-site-scopes.h" 9 #include "src/allocation-site-scopes.h"
10 #include "src/ast/ast-numbering.h" 10 #include "src/ast/ast-numbering.h"
(...skipping 11433 matching lines...) Expand 10 before | Expand all | Expand 10 after
11444 New<HCompareObjectEqAndBranch>(left, right); 11444 New<HCompareObjectEqAndBranch>(left, right);
11445 return ast_context()->ReturnControl(result, expr->id()); 11445 return ast_context()->ReturnControl(result, expr->id());
11446 } 11446 }
11447 11447
11448 if (op == Token::INSTANCEOF) { 11448 if (op == Token::INSTANCEOF) {
11449 // Check to see if the rhs of the instanceof is a known function. 11449 // Check to see if the rhs of the instanceof is a known function.
11450 if (right->IsConstant() && 11450 if (right->IsConstant() &&
11451 HConstant::cast(right)->handle(isolate())->IsJSFunction()) { 11451 HConstant::cast(right)->handle(isolate())->IsJSFunction()) {
11452 Handle<JSFunction> constructor = 11452 Handle<JSFunction> constructor =
11453 Handle<JSFunction>::cast(HConstant::cast(right)->handle(isolate())); 11453 Handle<JSFunction>::cast(HConstant::cast(right)->handle(isolate()));
11454 if (!constructor->map()->has_non_instance_prototype()) { 11454 if (constructor->IsConstructor() &&
11455 !constructor->map()->has_non_instance_prototype()) {
11455 JSFunction::EnsureHasInitialMap(constructor); 11456 JSFunction::EnsureHasInitialMap(constructor);
11456 DCHECK(constructor->has_initial_map()); 11457 DCHECK(constructor->has_initial_map());
11457 Handle<Map> initial_map(constructor->initial_map(), isolate()); 11458 Handle<Map> initial_map(constructor->initial_map(), isolate());
11458 top_info()->dependencies()->AssumeInitialMapCantChange(initial_map); 11459 top_info()->dependencies()->AssumeInitialMapCantChange(initial_map);
11459 HInstruction* prototype = 11460 HInstruction* prototype =
11460 Add<HConstant>(handle(initial_map->prototype(), isolate())); 11461 Add<HConstant>(handle(initial_map->prototype(), isolate()));
11461 HHasInPrototypeChainAndBranch* result = 11462 HHasInPrototypeChainAndBranch* result =
11462 New<HHasInPrototypeChainAndBranch>(left, prototype); 11463 New<HHasInPrototypeChainAndBranch>(left, prototype);
11463 return ast_context()->ReturnControl(result, expr->id()); 11464 return ast_context()->ReturnControl(result, expr->id());
11464 } 11465 }
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after
13619 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13620 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13620 } 13621 }
13621 13622
13622 #ifdef DEBUG 13623 #ifdef DEBUG
13623 graph_->Verify(false); // No full verify. 13624 graph_->Verify(false); // No full verify.
13624 #endif 13625 #endif
13625 } 13626 }
13626 13627
13627 } // namespace internal 13628 } // namespace internal
13628 } // namespace v8 13629 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698