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

Side by Side Diff: src/bootstrapper.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 unified diff | Download patch
« no previous file with comments | « src/api.cc ('k') | src/compiler.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/extensions/externalize-string-extension.h" 10 #include "src/extensions/externalize-string-extension.h"
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 1445
1446 // If we can't find the function in the cache, we compile a new 1446 // If we can't find the function in the cache, we compile a new
1447 // function and insert it into the cache. 1447 // function and insert it into the cache.
1448 if (cache == NULL || !cache->Lookup(name, &function_info)) { 1448 if (cache == NULL || !cache->Lookup(name, &function_info)) {
1449 DCHECK(source->IsOneByteRepresentation()); 1449 DCHECK(source->IsOneByteRepresentation());
1450 Handle<String> script_name = 1450 Handle<String> script_name =
1451 factory->NewStringFromUtf8(name).ToHandleChecked(); 1451 factory->NewStringFromUtf8(name).ToHandleChecked();
1452 function_info = Compiler::CompileScript( 1452 function_info = Compiler::CompileScript(
1453 source, script_name, 0, 0, false, false, top_context, extension, NULL, 1453 source, script_name, 0, 0, false, false, top_context, extension, NULL,
1454 ScriptCompiler::kNoCompileOptions, 1454 ScriptCompiler::kNoCompileOptions,
1455 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE); 1455 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE, false);
1456 if (function_info.is_null()) return false; 1456 if (function_info.is_null()) return false;
1457 if (cache != NULL) cache->Add(name, function_info); 1457 if (cache != NULL) cache->Add(name, function_info);
1458 } 1458 }
1459 1459
1460 // Set up the function context. Conceptually, we should clone the 1460 // Set up the function context. Conceptually, we should clone the
1461 // function before overwriting the context but since we're in a 1461 // function before overwriting the context but since we're in a
1462 // single-threaded environment it is not strictly necessary. 1462 // single-threaded environment it is not strictly necessary.
1463 DCHECK(top_context->IsNativeContext()); 1463 DCHECK(top_context->IsNativeContext());
1464 Handle<Context> context = 1464 Handle<Context> context =
1465 Handle<Context>(use_runtime_context 1465 Handle<Context>(use_runtime_context
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
2883 return from + sizeof(NestingCounterType); 2883 return from + sizeof(NestingCounterType);
2884 } 2884 }
2885 2885
2886 2886
2887 // Called when the top-level V8 mutex is destroyed. 2887 // Called when the top-level V8 mutex is destroyed.
2888 void Bootstrapper::FreeThreadResources() { 2888 void Bootstrapper::FreeThreadResources() {
2889 DCHECK(!IsActive()); 2889 DCHECK(!IsActive());
2890 } 2890 }
2891 2891
2892 } } // namespace v8::internal 2892 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698