OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/ast.h" | 7 #include "src/ast.h" |
8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 module_index_ = 0; | 718 module_index_ = 0; |
719 | 719 |
720 // Generate code for allocating all modules, including nested ones. | 720 // Generate code for allocating all modules, including nested ones. |
721 // The allocated contexts are stored in internal variables in this scope. | 721 // The allocated contexts are stored in internal variables in this scope. |
722 AllocateModules(declarations); | 722 AllocateModules(declarations); |
723 } | 723 } |
724 | 724 |
725 AstVisitor::VisitDeclarations(declarations); | 725 AstVisitor::VisitDeclarations(declarations); |
726 | 726 |
727 if (scope_->num_modules() != 0) { | 727 if (scope_->num_modules() != 0) { |
| 728 // TODO(ES6): This step, which creates module instance objects, |
| 729 // can probably be delayed until an "import *" declaration |
| 730 // reifies a module instance. Until imports are implemented, |
| 731 // we skip it altogether. |
| 732 // |
728 // Initialize modules from descriptor array. | 733 // Initialize modules from descriptor array. |
729 DCHECK(module_index_ == modules_->length()); | 734 // DCHECK(module_index_ == modules_->length()); |
730 DeclareModules(modules_); | 735 // DeclareModules(modules_); |
731 modules_ = saved_modules; | 736 modules_ = saved_modules; |
732 module_index_ = saved_module_index; | 737 module_index_ = saved_module_index; |
733 } | 738 } |
734 | 739 |
735 if (!globals_->is_empty()) { | 740 if (!globals_->is_empty()) { |
736 // Invoke the platform-dependent code generator to do the actual | 741 // Invoke the platform-dependent code generator to do the actual |
737 // declaration of the global functions and variables. | 742 // declaration of the global functions and variables. |
738 Handle<FixedArray> array = | 743 Handle<FixedArray> array = |
739 isolate()->factory()->NewFixedArray(globals_->length(), TENURED); | 744 isolate()->factory()->NewFixedArray(globals_->length(), TENURED); |
740 for (int i = 0; i < globals_->length(); ++i) | 745 for (int i = 0; i < globals_->length(); ++i) |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1824 } | 1829 } |
1825 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1830 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1826 codegen_->scope_ = saved_scope_; | 1831 codegen_->scope_ = saved_scope_; |
1827 } | 1832 } |
1828 | 1833 |
1829 | 1834 |
1830 #undef __ | 1835 #undef __ |
1831 | 1836 |
1832 | 1837 |
1833 } } // namespace v8::internal | 1838 } } // namespace v8::internal |
OLD | NEW |