OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |