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

Unified Diff: src/compiler.cc

Issue 902093002: Add basic compilation support for modules (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add TODO 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.h ('k') | src/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 9aab688c6a0492ecabd546c95969e7168437ce67..75d23eac87c496f38f5d7baa5bbf52fae7c06d35 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1135,7 +1135,7 @@ static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
isolate->debug()->OnBeforeCompile(script);
- DCHECK(info->is_eval() || info->is_global());
+ DCHECK(info->is_eval() || info->is_global() || info->is_module());
info->MarkAsToplevel();
@@ -1280,7 +1280,8 @@ Handle<SharedFunctionInfo> Compiler::CompileScript(
int column_offset, bool is_embedder_debug_script,
bool is_shared_cross_origin, Handle<Context> context,
v8::Extension* extension, ScriptData** cached_data,
- ScriptCompiler::CompileOptions compile_options, NativesFlag natives) {
+ ScriptCompiler::CompileOptions compile_options, NativesFlag natives,
+ bool is_module) {
Isolate* isolate = source->GetIsolate();
if (compile_options == ScriptCompiler::kNoCompileOptions) {
cached_data = NULL;
@@ -1345,7 +1346,11 @@ Handle<SharedFunctionInfo> Compiler::CompileScript(
// Compile the function and add it to the cache.
CompilationInfoWithZone info(script);
- info.MarkAsGlobal();
+ if (FLAG_harmony_modules && is_module) {
+ info.MarkAsModule();
+ } else {
+ info.MarkAsGlobal();
+ }
info.SetCachedData(cached_data, compile_options);
info.SetExtension(extension);
info.SetContext(context);
« no previous file with comments | « src/compiler.h ('k') | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698