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/typing.h" | 5 #include "src/crankshaft/typing.h" |
6 | 6 |
7 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/ast/variables.h" | 9 #include "src/ast/variables.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 RECURSE(Visit(expr->obj())); | 510 RECURSE(Visit(expr->obj())); |
511 RECURSE(Visit(expr->key())); | 511 RECURSE(Visit(expr->key())); |
512 | 512 |
513 // We don't know anything about the result type. | 513 // We don't know anything about the result type. |
514 } | 514 } |
515 | 515 |
516 | 516 |
517 void AstTyper::VisitCall(Call* expr) { | 517 void AstTyper::VisitCall(Call* expr) { |
518 // Collect type feedback. | 518 // Collect type feedback. |
519 RECURSE(Visit(expr->expression())); | 519 RECURSE(Visit(expr->expression())); |
520 bool is_uninitialized = true; | 520 FeedbackVectorSlot slot = expr->CallFeedbackICSlot(); |
521 if (expr->IsUsingCallFeedbackICSlot()) { | 521 bool is_uninitialized = oracle()->CallIsUninitialized(slot); |
522 FeedbackVectorSlot slot = expr->CallFeedbackICSlot(); | 522 if (!expr->expression()->IsProperty() && oracle()->CallIsMonomorphic(slot)) { |
523 is_uninitialized = oracle()->CallIsUninitialized(slot); | 523 expr->set_target(oracle()->GetCallTarget(slot)); |
524 if (!expr->expression()->IsProperty() && | 524 Handle<AllocationSite> site = oracle()->GetCallAllocationSite(slot); |
525 oracle()->CallIsMonomorphic(slot)) { | 525 expr->set_allocation_site(site); |
526 expr->set_target(oracle()->GetCallTarget(slot)); | |
527 Handle<AllocationSite> site = oracle()->GetCallAllocationSite(slot); | |
528 expr->set_allocation_site(site); | |
529 } | |
530 } | 526 } |
531 | 527 |
532 expr->set_is_uninitialized(is_uninitialized); | 528 expr->set_is_uninitialized(is_uninitialized); |
533 | 529 |
534 ZoneList<Expression*>* args = expr->arguments(); | 530 ZoneList<Expression*>* args = expr->arguments(); |
535 for (int i = 0; i < args->length(); ++i) { | 531 for (int i = 0; i < args->length(); ++i) { |
536 Expression* arg = args->at(i); | 532 Expression* arg = args->at(i); |
537 RECURSE(Visit(arg)); | 533 RECURSE(Visit(arg)); |
538 } | 534 } |
539 | 535 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 } | 793 } |
798 | 794 |
799 | 795 |
800 void AstTyper::VisitFunctionDeclaration(FunctionDeclaration* declaration) { | 796 void AstTyper::VisitFunctionDeclaration(FunctionDeclaration* declaration) { |
801 RECURSE(Visit(declaration->fun())); | 797 RECURSE(Visit(declaration->fun())); |
802 } | 798 } |
803 | 799 |
804 | 800 |
805 } // namespace internal | 801 } // namespace internal |
806 } // namespace v8 | 802 } // namespace v8 |
OLD | NEW |