Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 #include "scopes.h" | 33 #include "scopes.h" |
| 34 | 34 |
| 35 namespace v8 { | 35 namespace v8 { |
| 36 namespace internal { | 36 namespace internal { |
| 37 | 37 |
| 38 | 38 |
| 39 AstTyper::AstTyper(CompilationInfo* info) | 39 AstTyper::AstTyper(CompilationInfo* info) |
| 40 : info_(info), | 40 : info_(info), |
| 41 oracle_( | 41 oracle_( |
| 42 Handle<Code>(info->closure()->shared()->code()), | 42 Handle<Code>(info->closure()->shared()->code()), |
| 43 Handle<FixedArray>(info->closure()->shared()->feedback_vector()), | |
|
mvstanton
2014/04/30 08:31:18
Warning: you aren't copying the vector, what if a
| |
| 43 Handle<Context>(info->closure()->context()->native_context()), | 44 Handle<Context>(info->closure()->context()->native_context()), |
|
Benedikt Meurer
2014/04/28 19:17:00
Nit: Use handle() instead of Handle<T>()
mvstanton
2014/04/30 08:31:18
Done.
| |
| 44 info->zone()), | 45 info->zone()), |
| 45 store_(info->zone()) { | 46 store_(info->zone()) { |
| 46 InitializeAstVisitor(info->zone()); | 47 InitializeAstVisitor(info->zone()); |
| 47 } | 48 } |
| 48 | 49 |
| 49 | 50 |
| 50 #define RECURSE(call) \ | 51 #define RECURSE(call) \ |
| 51 do { \ | 52 do { \ |
| 52 ASSERT(!visitor->HasStackOverflow()); \ | 53 ASSERT(!visitor->HasStackOverflow()); \ |
| 53 call; \ | 54 call; \ |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 523 RECURSE(Visit(expr->key())); | 524 RECURSE(Visit(expr->key())); |
| 524 | 525 |
| 525 // We don't know anything about the result type. | 526 // We don't know anything about the result type. |
| 526 } | 527 } |
| 527 | 528 |
| 528 | 529 |
| 529 void AstTyper::VisitCall(Call* expr) { | 530 void AstTyper::VisitCall(Call* expr) { |
| 530 // Collect type feedback. | 531 // Collect type feedback. |
| 531 RECURSE(Visit(expr->expression())); | 532 RECURSE(Visit(expr->expression())); |
| 532 if (!expr->expression()->IsProperty() && | 533 if (!expr->expression()->IsProperty() && |
| 533 expr->HasCallFeedbackSlot() && | 534 expr->IsUsingCallFeedbackSlot(isolate()) && |
| 534 oracle()->CallIsMonomorphic(expr->CallFeedbackSlot())) { | 535 oracle()->CallIsMonomorphic(expr->CallFeedbackSlot())) { |
| 535 expr->set_target(oracle()->GetCallTarget(expr->CallFeedbackSlot())); | 536 expr->set_target(oracle()->GetCallTarget(expr->CallFeedbackSlot())); |
| 536 } | 537 } |
| 537 | 538 |
| 538 ZoneList<Expression*>* args = expr->arguments(); | 539 ZoneList<Expression*>* args = expr->arguments(); |
| 539 for (int i = 0; i < args->length(); ++i) { | 540 for (int i = 0; i < args->length(); ++i) { |
| 540 Expression* arg = args->at(i); | 541 Expression* arg = args->at(i); |
| 541 RECURSE(Visit(arg)); | 542 RECURSE(Visit(arg)); |
| 542 } | 543 } |
| 543 | 544 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 792 void AstTyper::VisitModuleUrl(ModuleUrl* module) { | 793 void AstTyper::VisitModuleUrl(ModuleUrl* module) { |
| 793 } | 794 } |
| 794 | 795 |
| 795 | 796 |
| 796 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { | 797 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { |
| 797 RECURSE(Visit(stmt->body())); | 798 RECURSE(Visit(stmt->body())); |
| 798 } | 799 } |
| 799 | 800 |
| 800 | 801 |
| 801 } } // namespace v8::internal | 802 } } // namespace v8::internal |
| OLD | NEW |