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/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/frames.h" | 8 #include "src/frames.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/ostreams.h" | 10 #include "src/ostreams.h" |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 RECURSE(Visit(expr->key())); | 508 RECURSE(Visit(expr->key())); |
509 | 509 |
510 // We don't know anything about the result type. | 510 // We don't know anything about the result type. |
511 } | 511 } |
512 | 512 |
513 | 513 |
514 void AstTyper::VisitCall(Call* expr) { | 514 void AstTyper::VisitCall(Call* expr) { |
515 // Collect type feedback. | 515 // Collect type feedback. |
516 RECURSE(Visit(expr->expression())); | 516 RECURSE(Visit(expr->expression())); |
517 bool is_uninitialized = true; | 517 bool is_uninitialized = true; |
518 if (expr->IsUsingCallFeedbackICSlot(isolate_)) { | 518 if (expr->IsUsingCallFeedbackICSlot()) { |
519 FeedbackVectorSlot slot = expr->CallFeedbackICSlot(); | 519 FeedbackVectorSlot slot = expr->CallFeedbackICSlot(); |
520 is_uninitialized = oracle()->CallIsUninitialized(slot); | 520 is_uninitialized = oracle()->CallIsUninitialized(slot); |
521 if (!expr->expression()->IsProperty() && | 521 if (!expr->expression()->IsProperty() && |
522 oracle()->CallIsMonomorphic(slot)) { | 522 oracle()->CallIsMonomorphic(slot)) { |
523 expr->set_target(oracle()->GetCallTarget(slot)); | 523 expr->set_target(oracle()->GetCallTarget(slot)); |
524 Handle<AllocationSite> site = oracle()->GetCallAllocationSite(slot); | 524 Handle<AllocationSite> site = oracle()->GetCallAllocationSite(slot); |
525 expr->set_allocation_site(site); | 525 expr->set_allocation_site(site); |
526 } | 526 } |
527 } | 527 } |
528 | 528 |
529 expr->set_is_uninitialized(is_uninitialized); | 529 expr->set_is_uninitialized(is_uninitialized); |
530 | 530 |
531 ZoneList<Expression*>* args = expr->arguments(); | 531 ZoneList<Expression*>* args = expr->arguments(); |
532 for (int i = 0; i < args->length(); ++i) { | 532 for (int i = 0; i < args->length(); ++i) { |
533 Expression* arg = args->at(i); | 533 Expression* arg = args->at(i); |
534 RECURSE(Visit(arg)); | 534 RECURSE(Visit(arg)); |
535 } | 535 } |
536 | 536 |
537 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 537 if (expr->is_possibly_eval()) { |
538 if (proxy != NULL && proxy->var()->is_possibly_eval(isolate_)) { | |
539 store_.Forget(); // Eval could do whatever to local variables. | 538 store_.Forget(); // Eval could do whatever to local variables. |
540 } | 539 } |
541 | 540 |
542 // We don't know anything about the result type. | 541 // We don't know anything about the result type. |
543 } | 542 } |
544 | 543 |
545 | 544 |
546 void AstTyper::VisitCallNew(CallNew* expr) { | 545 void AstTyper::VisitCallNew(CallNew* expr) { |
547 // Collect type feedback. | 546 // Collect type feedback. |
548 FeedbackVectorSlot allocation_site_feedback_slot = | 547 FeedbackVectorSlot allocation_site_feedback_slot = |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 } | 780 } |
782 | 781 |
783 | 782 |
784 void AstTyper::VisitFunctionDeclaration(FunctionDeclaration* declaration) { | 783 void AstTyper::VisitFunctionDeclaration(FunctionDeclaration* declaration) { |
785 RECURSE(Visit(declaration->fun())); | 784 RECURSE(Visit(declaration->fun())); |
786 } | 785 } |
787 | 786 |
788 | 787 |
789 } // namespace internal | 788 } // namespace internal |
790 } // namespace v8 | 789 } // namespace v8 |
OLD | NEW |