Commit 5b0a753d authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[code-cache] Keep track of extensions not caching

Bug: chromium:769203
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Iffb7e92fb9c08c42f03ad28c8defb516454a2d3d
Reviewed-on: https://chromium-review.googlesource.com/753740Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49158}
parent 3f67c138
...@@ -1447,6 +1447,7 @@ class V8_EXPORT ScriptCompiler { ...@@ -1447,6 +1447,7 @@ class V8_EXPORT ScriptCompiler {
kNoCacheBecauseInspector, kNoCacheBecauseInspector,
kNoCacheBecauseScriptTooSmall, kNoCacheBecauseScriptTooSmall,
kNoCacheBecauseCacheTooCold, kNoCacheBecauseCacheTooCold,
kNoCacheBecauseExtension,
}; };
/** /**
......
...@@ -3730,8 +3730,9 @@ bool Genesis::CompileExtension(Isolate* isolate, v8::Extension* extension) { ...@@ -3730,8 +3730,9 @@ bool Genesis::CompileExtension(Isolate* isolate, v8::Extension* extension) {
Compiler::GetSharedFunctionInfoForScript( Compiler::GetSharedFunctionInfoForScript(
source, script_name, 0, 0, ScriptOriginOptions(), source, script_name, 0, 0, ScriptOriginOptions(),
MaybeHandle<Object>(), context, extension, nullptr, MaybeHandle<Object>(), context, extension, nullptr,
ScriptCompiler::kNoCompileOptions, ScriptCompiler::kNoCacheNoReason, ScriptCompiler::kNoCompileOptions,
EXTENSION_CODE, MaybeHandle<FixedArray>()); ScriptCompiler::kNoCacheBecauseExtension, EXTENSION_CODE,
MaybeHandle<FixedArray>());
if (!maybe_function_info.ToHandle(&function_info)) return false; if (!maybe_function_info.ToHandle(&function_info)) return false;
cache->Add(name, function_info); cache->Add(name, function_info);
} }
......
...@@ -1244,6 +1244,7 @@ struct ScriptCompileTimerScope { ...@@ -1244,6 +1244,7 @@ struct ScriptCompileTimerScope {
kNoCacheBecauseCachingDisabled, kNoCacheBecauseCachingDisabled,
kNoCacheBecauseModule, kNoCacheBecauseModule,
kNoCacheBecauseStreamingSource, kNoCacheBecauseStreamingSource,
kNoCacheBecauseExtension,
kCount kCount
}; };
...@@ -1336,6 +1337,8 @@ struct ScriptCompileTimerScope { ...@@ -1336,6 +1337,8 @@ struct ScriptCompileTimerScope {
return CacheBehaviour::kNoCacheBecauseModule; return CacheBehaviour::kNoCacheBecauseModule;
case ScriptCompiler::kNoCacheBecauseStreamingSource: case ScriptCompiler::kNoCacheBecauseStreamingSource:
return CacheBehaviour::kNoCacheBecauseStreamingSource; return CacheBehaviour::kNoCacheBecauseStreamingSource;
case ScriptCompiler::kNoCacheBecauseExtension:
return CacheBehaviour::kNoCacheBecauseExtension;
} }
UNREACHABLE(); UNREACHABLE();
} }
...@@ -1374,6 +1377,7 @@ struct ScriptCompileTimerScope { ...@@ -1374,6 +1377,7 @@ struct ScriptCompileTimerScope {
// TODO(leszeks): Count separately or remove entirely once we have // TODO(leszeks): Count separately or remove entirely once we have
// background compilation. // background compilation.
case CacheBehaviour::kNoCacheBecauseStreamingSource: case CacheBehaviour::kNoCacheBecauseStreamingSource:
case CacheBehaviour::kNoCacheBecauseExtension:
return isolate_->counters()->compile_script_no_cache_other(); return isolate_->counters()->compile_script_no_cache_other();
case CacheBehaviour::kCount: case CacheBehaviour::kCount:
......
...@@ -1055,7 +1055,7 @@ class RuntimeCallTimerScope { ...@@ -1055,7 +1055,7 @@ class RuntimeCallTimerScope {
20) \ 20) \
HR(wasm_lazy_compilation_throughput, V8.WasmLazyCompilationThroughput, 1, \ HR(wasm_lazy_compilation_throughput, V8.WasmLazyCompilationThroughput, 1, \
10000, 50) \ 10000, 50) \
HR(compile_script_cache_behaviour, V8.CompileScript.CacheBehaviour, 0, 12, 13) HR(compile_script_cache_behaviour, V8.CompileScript.CacheBehaviour, 0, 13, 14)
#define HISTOGRAM_TIMER_LIST(HT) \ #define HISTOGRAM_TIMER_LIST(HT) \
/* Garbage collection timers. */ \ /* Garbage collection timers. */ \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment