| 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/typing.h" | 5 #include "src/typing.h" |
| 6 | 6 |
| 7 #include "src/frames.h" | 7 #include "src/frames.h" |
| 8 #include "src/frames-inl.h" | 8 #include "src/frames-inl.h" |
| 9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
| 10 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move | 10 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 TypeFeedbackId id = expr->AssignmentFeedbackId(); | 437 TypeFeedbackId id = expr->AssignmentFeedbackId(); |
| 438 expr->set_is_uninitialized(oracle()->StoreIsUninitialized(id)); | 438 expr->set_is_uninitialized(oracle()->StoreIsUninitialized(id)); |
| 439 if (!expr->IsUninitialized()) { | 439 if (!expr->IsUninitialized()) { |
| 440 if (prop->key()->IsPropertyName()) { | 440 if (prop->key()->IsPropertyName()) { |
| 441 Literal* lit_key = prop->key()->AsLiteral(); | 441 Literal* lit_key = prop->key()->AsLiteral(); |
| 442 DCHECK(lit_key != NULL && lit_key->value()->IsString()); | 442 DCHECK(lit_key != NULL && lit_key->value()->IsString()); |
| 443 Handle<String> name = Handle<String>::cast(lit_key->value()); | 443 Handle<String> name = Handle<String>::cast(lit_key->value()); |
| 444 oracle()->AssignmentReceiverTypes(id, name, expr->GetReceiverTypes()); | 444 oracle()->AssignmentReceiverTypes(id, name, expr->GetReceiverTypes()); |
| 445 } else { | 445 } else { |
| 446 KeyedAccessStoreMode store_mode; | 446 KeyedAccessStoreMode store_mode; |
| 447 oracle()->KeyedAssignmentReceiverTypes( | 447 IcCheckType key_type; |
| 448 id, expr->GetReceiverTypes(), &store_mode); | 448 oracle()->KeyedAssignmentReceiverTypes(id, expr->GetReceiverTypes(), |
| 449 &store_mode, &key_type); |
| 449 expr->set_store_mode(store_mode); | 450 expr->set_store_mode(store_mode); |
| 451 expr->set_key_type(key_type); |
| 450 } | 452 } |
| 451 } | 453 } |
| 452 } | 454 } |
| 453 | 455 |
| 454 Expression* rhs = | 456 Expression* rhs = |
| 455 expr->is_compound() ? expr->binary_operation() : expr->value(); | 457 expr->is_compound() ? expr->binary_operation() : expr->value(); |
| 456 RECURSE(Visit(expr->target())); | 458 RECURSE(Visit(expr->target())); |
| 457 RECURSE(Visit(rhs)); | 459 RECURSE(Visit(rhs)); |
| 458 NarrowType(expr, rhs->bounds()); | 460 NarrowType(expr, rhs->bounds()); |
| 459 | 461 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 break; | 582 break; |
| 581 default: | 583 default: |
| 582 UNREACHABLE(); | 584 UNREACHABLE(); |
| 583 } | 585 } |
| 584 } | 586 } |
| 585 | 587 |
| 586 | 588 |
| 587 void AstTyper::VisitCountOperation(CountOperation* expr) { | 589 void AstTyper::VisitCountOperation(CountOperation* expr) { |
| 588 // Collect type feedback. | 590 // Collect type feedback. |
| 589 TypeFeedbackId store_id = expr->CountStoreFeedbackId(); | 591 TypeFeedbackId store_id = expr->CountStoreFeedbackId(); |
| 590 expr->set_store_mode(oracle()->GetStoreMode(store_id)); | 592 KeyedAccessStoreMode store_mode; |
| 593 IcCheckType key_type; |
| 594 oracle()->GetStoreModeAndKeyType(store_id, &store_mode, &key_type); |
| 595 expr->set_store_mode(store_mode); |
| 596 expr->set_key_type(key_type); |
| 591 oracle()->CountReceiverTypes(store_id, expr->GetReceiverTypes()); | 597 oracle()->CountReceiverTypes(store_id, expr->GetReceiverTypes()); |
| 592 expr->set_type(oracle()->CountType(expr->CountBinOpFeedbackId())); | 598 expr->set_type(oracle()->CountType(expr->CountBinOpFeedbackId())); |
| 593 // TODO(rossberg): merge the count type with the generic expression type. | 599 // TODO(rossberg): merge the count type with the generic expression type. |
| 594 | 600 |
| 595 RECURSE(Visit(expr->expression())); | 601 RECURSE(Visit(expr->expression())); |
| 596 | 602 |
| 597 NarrowType(expr, Bounds(Type::SignedSmall(zone()), Type::Number(zone()))); | 603 NarrowType(expr, Bounds(Type::SignedSmall(zone()), Type::Number(zone()))); |
| 598 | 604 |
| 599 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 605 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
| 600 if (proxy != NULL && proxy->var()->IsStackAllocated()) { | 606 if (proxy != NULL && proxy->var()->IsStackAllocated()) { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 void AstTyper::VisitModuleUrl(ModuleUrl* module) { | 783 void AstTyper::VisitModuleUrl(ModuleUrl* module) { |
| 778 } | 784 } |
| 779 | 785 |
| 780 | 786 |
| 781 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { | 787 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { |
| 782 RECURSE(Visit(stmt->body())); | 788 RECURSE(Visit(stmt->body())); |
| 783 } | 789 } |
| 784 | 790 |
| 785 | 791 |
| 786 } } // namespace v8::internal | 792 } } // namespace v8::internal |
| OLD | NEW |