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/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "src/hydrogen-mark-unreachable.h" | 28 #include "src/hydrogen-mark-unreachable.h" |
29 #include "src/hydrogen-osr.h" | 29 #include "src/hydrogen-osr.h" |
30 #include "src/hydrogen-range-analysis.h" | 30 #include "src/hydrogen-range-analysis.h" |
31 #include "src/hydrogen-redundant-phi.h" | 31 #include "src/hydrogen-redundant-phi.h" |
32 #include "src/hydrogen-removable-simulates.h" | 32 #include "src/hydrogen-removable-simulates.h" |
33 #include "src/hydrogen-representation-changes.h" | 33 #include "src/hydrogen-representation-changes.h" |
34 #include "src/hydrogen-sce.h" | 34 #include "src/hydrogen-sce.h" |
35 #include "src/hydrogen-store-elimination.h" | 35 #include "src/hydrogen-store-elimination.h" |
36 #include "src/hydrogen-uint32-analysis.h" | 36 #include "src/hydrogen-uint32-analysis.h" |
37 #include "src/ic/call-optimization.h" | 37 #include "src/ic/call-optimization.h" |
| 38 #include "src/ic/ic.h" |
38 // GetRootConstructor | 39 // GetRootConstructor |
39 #include "src/ic/ic-inl.h" | 40 #include "src/ic/ic-inl.h" |
40 #include "src/lithium-allocator.h" | 41 #include "src/lithium-allocator.h" |
41 #include "src/parser.h" | 42 #include "src/parser.h" |
42 #include "src/runtime.h" | 43 #include "src/runtime.h" |
43 #include "src/scopeinfo.h" | 44 #include "src/scopeinfo.h" |
44 #include "src/scopes.h" | 45 #include "src/scopes.h" |
45 #include "src/typing.h" | 46 #include "src/typing.h" |
46 | 47 |
47 #if V8_TARGET_ARCH_IA32 | 48 #if V8_TARGET_ARCH_IA32 |
(...skipping 4455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4503 if (!scope->arguments()->IsStackAllocated()) { | 4504 if (!scope->arguments()->IsStackAllocated()) { |
4504 return Bailout(kContextAllocatedArguments); | 4505 return Bailout(kContextAllocatedArguments); |
4505 } | 4506 } |
4506 | 4507 |
4507 environment()->Bind(scope->arguments(), | 4508 environment()->Bind(scope->arguments(), |
4508 graph()->GetArgumentsObject()); | 4509 graph()->GetArgumentsObject()); |
4509 } | 4510 } |
4510 } | 4511 } |
4511 | 4512 |
4512 | 4513 |
| 4514 Type* HOptimizedGraphBuilder::ToType(Handle<Map> map) { |
| 4515 return IC::MapToType<Type>(map, zone()); |
| 4516 } |
| 4517 |
| 4518 |
4513 void HOptimizedGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { | 4519 void HOptimizedGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { |
4514 for (int i = 0; i < statements->length(); i++) { | 4520 for (int i = 0; i < statements->length(); i++) { |
4515 Statement* stmt = statements->at(i); | 4521 Statement* stmt = statements->at(i); |
4516 CHECK_ALIVE(Visit(stmt)); | 4522 CHECK_ALIVE(Visit(stmt)); |
4517 if (stmt->IsJump()) break; | 4523 if (stmt->IsJump()) break; |
4518 } | 4524 } |
4519 } | 4525 } |
4520 | 4526 |
4521 | 4527 |
4522 void HOptimizedGraphBuilder::VisitBlock(Block* stmt) { | 4528 void HOptimizedGraphBuilder::VisitBlock(Block* stmt) { |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6386 SmallMapList** t, | 6392 SmallMapList** t, |
6387 Zone* zone) { | 6393 Zone* zone) { |
6388 SmallMapList* types = expr->GetReceiverTypes(); | 6394 SmallMapList* types = expr->GetReceiverTypes(); |
6389 *t = types; | 6395 *t = types; |
6390 bool monomorphic = expr->IsMonomorphic(); | 6396 bool monomorphic = expr->IsMonomorphic(); |
6391 if (types != NULL && receiver->HasMonomorphicJSObjectType()) { | 6397 if (types != NULL && receiver->HasMonomorphicJSObjectType()) { |
6392 Map* root_map = receiver->GetMonomorphicJSObjectMap()->FindRootMap(); | 6398 Map* root_map = receiver->GetMonomorphicJSObjectMap()->FindRootMap(); |
6393 types->FilterForPossibleTransitions(root_map); | 6399 types->FilterForPossibleTransitions(root_map); |
6394 monomorphic = types->length() == 1; | 6400 monomorphic = types->length() == 1; |
6395 } | 6401 } |
6396 return monomorphic && CanInlinePropertyAccess( | 6402 return monomorphic && |
6397 IC::MapToType<Type>(types->first(), zone)); | 6403 CanInlinePropertyAccess(IC::MapToType<Type>(types->first(), zone)); |
6398 } | 6404 } |
6399 | 6405 |
6400 | 6406 |
6401 static bool AreStringTypes(SmallMapList* types) { | 6407 static bool AreStringTypes(SmallMapList* types) { |
6402 for (int i = 0; i < types->length(); i++) { | 6408 for (int i = 0; i < types->length(); i++) { |
6403 if (types->at(i)->instance_type() >= FIRST_NONSTRING_TYPE) return false; | 6409 if (types->at(i)->instance_type() >= FIRST_NONSTRING_TYPE) return false; |
6404 } | 6410 } |
6405 return true; | 6411 return true; |
6406 } | 6412 } |
6407 | 6413 |
(...skipping 6083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12491 if (ShouldProduceTraceOutput()) { | 12497 if (ShouldProduceTraceOutput()) { |
12492 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12498 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12493 } | 12499 } |
12494 | 12500 |
12495 #ifdef DEBUG | 12501 #ifdef DEBUG |
12496 graph_->Verify(false); // No full verify. | 12502 graph_->Verify(false); // No full verify. |
12497 #endif | 12503 #endif |
12498 } | 12504 } |
12499 | 12505 |
12500 } } // namespace v8::internal | 12506 } } // namespace v8::internal |
OLD | NEW |