Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: src/full-codegen.cc

Issue 902093002: Add basic compilation support for modules (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/compiler.cc ('K') | « src/debug.cc ('k') | src/parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Initialize modules from descriptor array. 728 // Initialize modules from descriptor array.
729 DCHECK(module_index_ == modules_->length()); 729 // DCHECK(module_index_ == modules_->length());
730 DeclareModules(modules_); 730 // DeclareModules(modules_);
rossberg 2015/02/06 12:36:56 Is this stray? Or a TODO?
adamk 2015/02/06 17:29:08 Oops. This is a TODO, I thought I'd managed to fix
731 modules_ = saved_modules; 731 modules_ = saved_modules;
732 module_index_ = saved_module_index; 732 module_index_ = saved_module_index;
733 } 733 }
734 734
735 if (!globals_->is_empty()) { 735 if (!globals_->is_empty()) {
736 // Invoke the platform-dependent code generator to do the actual 736 // Invoke the platform-dependent code generator to do the actual
737 // declaration of the global functions and variables. 737 // declaration of the global functions and variables.
738 Handle<FixedArray> array = 738 Handle<FixedArray> array =
739 isolate()->factory()->NewFixedArray(globals_->length(), TENURED); 739 isolate()->factory()->NewFixedArray(globals_->length(), TENURED);
740 for (int i = 0; i < globals_->length(); ++i) 740 for (int i = 0; i < globals_->length(); ++i)
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 } 1824 }
1825 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); 1825 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS);
1826 codegen_->scope_ = saved_scope_; 1826 codegen_->scope_ = saved_scope_;
1827 } 1827 }
1828 1828
1829 1829
1830 #undef __ 1830 #undef __
1831 1831
1832 1832
1833 } } // namespace v8::internal 1833 } } // namespace v8::internal
OLDNEW
« src/compiler.cc ('K') | « src/debug.cc ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698