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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 RECURSE(Visit(expr->obj())); | 503 RECURSE(Visit(expr->obj())); |
504 RECURSE(Visit(expr->key())); | 504 RECURSE(Visit(expr->key())); |
505 | 505 |
506 // We don't know anything about the result type. | 506 // We don't know anything about the result type. |
507 } | 507 } |
508 | 508 |
509 | 509 |
510 void AstTyper::VisitCall(Call* expr) { | 510 void AstTyper::VisitCall(Call* expr) { |
511 // Collect type feedback. | 511 // Collect type feedback. |
512 RECURSE(Visit(expr->expression())); | 512 RECURSE(Visit(expr->expression())); |
513 FeedbackVectorICSlot slot = expr->CallFeedbackSlot(); | 513 bool is_uninitialized = true; |
514 expr->set_is_uninitialized(oracle()->CallIsUninitialized(slot)); | 514 if (expr->IsUsingCallFeedbackSlot(isolate())) { |
515 if (!expr->expression()->IsProperty() && | 515 FeedbackVectorICSlot slot = expr->CallFeedbackSlot(); |
516 expr->IsUsingCallFeedbackSlot(isolate()) && | 516 is_uninitialized = oracle()->CallIsUninitialized(slot); |
517 oracle()->CallIsMonomorphic(slot)) { | 517 if (!expr->expression()->IsProperty() && |
518 expr->set_target(oracle()->GetCallTarget(slot)); | 518 oracle()->CallIsMonomorphic(slot)) { |
519 Handle<AllocationSite> site = oracle()->GetCallAllocationSite(slot); | 519 expr->set_target(oracle()->GetCallTarget(slot)); |
520 expr->set_allocation_site(site); | 520 Handle<AllocationSite> site = oracle()->GetCallAllocationSite(slot); |
| 521 expr->set_allocation_site(site); |
| 522 } |
521 } | 523 } |
522 | 524 |
| 525 expr->set_is_uninitialized(is_uninitialized); |
| 526 |
523 ZoneList<Expression*>* args = expr->arguments(); | 527 ZoneList<Expression*>* args = expr->arguments(); |
524 for (int i = 0; i < args->length(); ++i) { | 528 for (int i = 0; i < args->length(); ++i) { |
525 Expression* arg = args->at(i); | 529 Expression* arg = args->at(i); |
526 RECURSE(Visit(arg)); | 530 RECURSE(Visit(arg)); |
527 } | 531 } |
528 | 532 |
529 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 533 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
530 if (proxy != NULL && proxy->var()->is_possibly_eval(isolate())) { | 534 if (proxy != NULL && proxy->var()->is_possibly_eval(isolate())) { |
531 store_.Forget(); // Eval could do whatever to local variables. | 535 store_.Forget(); // Eval could do whatever to local variables. |
532 } | 536 } |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 void AstTyper::VisitModuleUrl(ModuleUrl* module) { | 788 void AstTyper::VisitModuleUrl(ModuleUrl* module) { |
785 } | 789 } |
786 | 790 |
787 | 791 |
788 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { | 792 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { |
789 RECURSE(Visit(stmt->body())); | 793 RECURSE(Visit(stmt->body())); |
790 } | 794 } |
791 | 795 |
792 | 796 |
793 } } // namespace v8::internal | 797 } } // namespace v8::internal |
OLD | NEW |