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

Unified Diff: src/compilation-cache.cc

Issue 923573002: Properly thread language mode to compilation cache (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 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 684d7227acf2ecd0058ff2db4a26fffec8ee91c5..b696ea55079e0a70eaccbc53ebec0454565077aa 100644
--- a/src/compilation-cache.cc
+++ b/src/compilation-cache.cc
@@ -147,7 +147,8 @@ bool CompilationCacheScript::HasOrigin(Handle<SharedFunctionInfo> function_info,
Handle<SharedFunctionInfo> CompilationCacheScript::Lookup(
Handle<String> source, Handle<Object> name, int line_offset,
int column_offset, bool is_embedder_debug_script,
- bool is_shared_cross_origin, Handle<Context> context) {
+ bool is_shared_cross_origin, Handle<Context> context,
+ LanguageMode language_mode) {
Object* result = NULL;
int generation;
@@ -156,7 +157,7 @@ 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);
+ Handle<Object> probe = table->Lookup(source, context, language_mode);
if (probe->IsSharedFunctionInfo()) {
Handle<SharedFunctionInfo> function_info =
Handle<SharedFunctionInfo>::cast(probe);
@@ -181,7 +182,7 @@ Handle<SharedFunctionInfo> CompilationCacheScript::Lookup(
is_embedder_debug_script, is_shared_cross_origin));
// 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, shared);
+ if (generation != 0) Put(source, context, language_mode, shared);
isolate()->counters()->compilation_cache_hits()->Increment();
return shared;
} else {
@@ -193,11 +194,12 @@ Handle<SharedFunctionInfo> CompilationCacheScript::Lookup(
void CompilationCacheScript::Put(Handle<String> source,
Handle<Context> context,
+ LanguageMode language_mode,
Handle<SharedFunctionInfo> function_info) {
HandleScope scope(isolate());
Handle<CompilationCacheTable> table = GetFirstTable();
- SetFirstTable(
- CompilationCacheTable::Put(table, source, context, function_info));
+ SetFirstTable(CompilationCacheTable::Put(table, source, context,
+ language_mode, function_info));
}
@@ -292,12 +294,13 @@ void CompilationCache::Remove(Handle<SharedFunctionInfo> function_info) {
MaybeHandle<SharedFunctionInfo> CompilationCache::LookupScript(
Handle<String> source, Handle<Object> name, int line_offset,
int column_offset, bool is_embedder_debug_script,
- bool is_shared_cross_origin, Handle<Context> context) {
+ bool is_shared_cross_origin, Handle<Context> context,
+ LanguageMode language_mode) {
if (!IsEnabled()) return MaybeHandle<SharedFunctionInfo>();
return script_.Lookup(source, name, line_offset, column_offset,
is_embedder_debug_script, is_shared_cross_origin,
- context);
+ context, language_mode);
}
@@ -329,10 +332,11 @@ MaybeHandle<FixedArray> CompilationCache::LookupRegExp(Handle<String> source,
void CompilationCache::PutScript(Handle<String> source,
Handle<Context> context,
+ LanguageMode language_mode,
Handle<SharedFunctionInfo> function_info) {
if (!IsEnabled()) return;
- script_.Put(source, context, function_info);
+ script_.Put(source, context, language_mode, 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