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

Unified Diff: src/compilation-cache.cc

Issue 2065453002: [module] Track script "module code" status Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use idiomatic variable names Created 4 years, 6 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/compilation-cache.h ('k') | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compilation-cache.cc
diff --git a/src/compilation-cache.cc b/src/compilation-cache.cc
index af9fbb573499d18df351c01f780b3baa577baf28..5194297fbc0a79675ddfa89d896716d43eb84020 100644
--- a/src/compilation-cache.cc
+++ b/src/compilation-cache.cc
@@ -144,7 +144,7 @@ bool CompilationCacheScript::HasOrigin(Handle<SharedFunctionInfo> function_info,
Handle<SharedFunctionInfo> CompilationCacheScript::Lookup(
Handle<String> source, Handle<Object> name, int line_offset,
int column_offset, ScriptOriginOptions resource_options,
- Handle<Context> context, LanguageMode language_mode) {
+ Handle<Context> context, LanguageMode language_mode, bool is_module) {
Object* result = NULL;
int generation;
@@ -153,7 +153,8 @@ Handle<SharedFunctionInfo> CompilationCacheScript::Lookup(
{ HandleScope scope(isolate());
for (generation = 0; generation < generations(); generation++) {
Handle<CompilationCacheTable> table = GetTable(generation);
- Handle<Object> probe = table->Lookup(source, context, language_mode);
+ Handle<Object> probe =
+ table->Lookup(source, context, language_mode, is_module);
if (probe->IsSharedFunctionInfo()) {
Handle<SharedFunctionInfo> function_info =
Handle<SharedFunctionInfo>::cast(probe);
@@ -178,7 +179,7 @@ Handle<SharedFunctionInfo> CompilationCacheScript::Lookup(
HasOrigin(shared, name, line_offset, column_offset, resource_options));
// If the script was found in a later generation, we promote it to
// the first generation to let it survive longer in the cache.
- if (generation != 0) Put(source, context, language_mode, shared);
+ if (generation != 0) Put(source, context, language_mode, is_module, shared);
isolate()->counters()->compilation_cache_hits()->Increment();
return shared;
} else {
@@ -187,15 +188,13 @@ Handle<SharedFunctionInfo> CompilationCacheScript::Lookup(
}
}
-
-void CompilationCacheScript::Put(Handle<String> source,
- Handle<Context> context,
- LanguageMode language_mode,
+void CompilationCacheScript::Put(Handle<String> source, Handle<Context> context,
+ LanguageMode language_mode, bool is_module,
Handle<SharedFunctionInfo> function_info) {
HandleScope scope(isolate());
Handle<CompilationCacheTable> table = GetFirstTable();
- SetFirstTable(CompilationCacheTable::Put(table, source, context,
- language_mode, function_info));
+ SetFirstTable(CompilationCacheTable::Put(
+ table, source, context, language_mode, is_module, function_info));
}
@@ -286,15 +285,14 @@ void CompilationCache::Remove(Handle<SharedFunctionInfo> function_info) {
script_.Remove(function_info);
}
-
MaybeHandle<SharedFunctionInfo> CompilationCache::LookupScript(
Handle<String> source, Handle<Object> name, int line_offset,
int column_offset, ScriptOriginOptions resource_options,
- Handle<Context> context, LanguageMode language_mode) {
+ Handle<Context> context, LanguageMode language_mode, bool is_script) {
if (!IsEnabled()) return MaybeHandle<SharedFunctionInfo>();
return script_.Lookup(source, name, line_offset, column_offset,
- resource_options, context, language_mode);
+ resource_options, context, language_mode, is_script);
}
@@ -323,14 +321,12 @@ MaybeHandle<FixedArray> CompilationCache::LookupRegExp(Handle<String> source,
return reg_exp_.Lookup(source, flags);
}
-
-void CompilationCache::PutScript(Handle<String> source,
- Handle<Context> context,
- LanguageMode language_mode,
+void CompilationCache::PutScript(Handle<String> source, Handle<Context> context,
+ LanguageMode language_mode, bool is_module,
Handle<SharedFunctionInfo> function_info) {
if (!IsEnabled()) return;
- script_.Put(source, context, language_mode, function_info);
+ script_.Put(source, context, language_mode, is_module, function_info);
}
« no previous file with comments | « src/compilation-cache.h ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698