| 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);
|
| }
|
|
|
|
|
|
|