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/parser.h" // for CompileTimeValue; TODO(rossberg): should move | 9 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move |
10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 478 |
479 void AstTyper::VisitProperty(Property* expr) { | 479 void AstTyper::VisitProperty(Property* expr) { |
480 // Collect type feedback. | 480 // Collect type feedback. |
481 TypeFeedbackId id = expr->PropertyFeedbackId(); | 481 TypeFeedbackId id = expr->PropertyFeedbackId(); |
482 expr->set_is_uninitialized(oracle()->LoadIsUninitialized(id)); | 482 expr->set_is_uninitialized(oracle()->LoadIsUninitialized(id)); |
483 if (!expr->IsUninitialized()) { | 483 if (!expr->IsUninitialized()) { |
484 if (expr->key()->IsPropertyName()) { | 484 if (expr->key()->IsPropertyName()) { |
485 Literal* lit_key = expr->key()->AsLiteral(); | 485 Literal* lit_key = expr->key()->AsLiteral(); |
486 ASSERT(lit_key != NULL && lit_key->value()->IsString()); | 486 ASSERT(lit_key != NULL && lit_key->value()->IsString()); |
487 Handle<String> name = Handle<String>::cast(lit_key->value()); | 487 Handle<String> name = Handle<String>::cast(lit_key->value()); |
488 bool is_prototype; | 488 oracle()->PropertyReceiverTypes(id, name, expr->GetReceiverTypes()); |
489 oracle()->PropertyReceiverTypes( | |
490 id, name, expr->GetReceiverTypes(), &is_prototype); | |
491 expr->set_is_function_prototype(is_prototype); | |
492 } else { | 489 } else { |
493 bool is_string; | 490 bool is_string; |
494 oracle()->KeyedPropertyReceiverTypes( | 491 oracle()->KeyedPropertyReceiverTypes( |
495 id, expr->GetReceiverTypes(), &is_string); | 492 id, expr->GetReceiverTypes(), &is_string); |
496 expr->set_is_string_access(is_string); | 493 expr->set_is_string_access(is_string); |
497 } | 494 } |
498 } | 495 } |
499 | 496 |
500 RECURSE(Visit(expr->obj())); | 497 RECURSE(Visit(expr->obj())); |
501 RECURSE(Visit(expr->key())); | 498 RECURSE(Visit(expr->key())); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 void AstTyper::VisitModuleUrl(ModuleUrl* module) { | 770 void AstTyper::VisitModuleUrl(ModuleUrl* module) { |
774 } | 771 } |
775 | 772 |
776 | 773 |
777 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { | 774 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { |
778 RECURSE(Visit(stmt->body())); | 775 RECURSE(Visit(stmt->body())); |
779 } | 776 } |
780 | 777 |
781 | 778 |
782 } } // namespace v8::internal | 779 } } // namespace v8::internal |
OLD | NEW |