Commit 25820bda authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[code-cache] Log resources with no cache handler

Add another entry to the NoCacheReason enum, reporting that the chromium
ScriptResource has no cache handler.

Also, the amount of chromium-specific entries in this enum is getting
too high. So, added a TODO for removing them -- possibly in the future
we want to do this no-cache reason logging in Chromium after all,
propagating isolate cache hits and consume failures back up the API with
an out parameter.

Bug: chromium:769203
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I63ca863cfef61e04e7104318eb79810796b61a9c
Reviewed-on: https://chromium-review.googlesource.com/776893Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49458}
parent cc9e77ab
...@@ -1456,7 +1456,8 @@ class V8_EXPORT ScriptCompiler { ...@@ -1456,7 +1456,8 @@ class V8_EXPORT ScriptCompiler {
kNoCacheBecauseV8Extension, kNoCacheBecauseV8Extension,
kNoCacheBecauseExtensionModule, kNoCacheBecauseExtensionModule,
kNoCacheBecausePacScript, kNoCacheBecausePacScript,
kNoCacheBecauseInDocumentWrite kNoCacheBecauseInDocumentWrite,
kNoCacheBecauseResourceWithNoCacheHandler
}; };
/** /**
......
...@@ -1236,6 +1236,9 @@ namespace { ...@@ -1236,6 +1236,9 @@ namespace {
struct ScriptCompileTimerScope { struct ScriptCompileTimerScope {
public: public:
// TODO(leszeks): There are too many blink-specific entries in this enum,
// figure out a way to push produce/hit-isolate-cache/consume/consume-failed
// back up the API and log them in blink instead.
enum class CacheBehaviour { enum class CacheBehaviour {
kProduceCodeCache, kProduceCodeCache,
kHitIsolateCacheWhenNoCache, kHitIsolateCacheWhenNoCache,
...@@ -1256,6 +1259,7 @@ struct ScriptCompileTimerScope { ...@@ -1256,6 +1259,7 @@ struct ScriptCompileTimerScope {
kNoCacheBecauseExtensionModule, kNoCacheBecauseExtensionModule,
kNoCacheBecausePacScript, kNoCacheBecausePacScript,
kNoCacheBecauseInDocumentWrite, kNoCacheBecauseInDocumentWrite,
kNoCacheBecauseResourceWithNoCacheHandler,
kCount kCount
}; };
...@@ -1360,6 +1364,8 @@ struct ScriptCompileTimerScope { ...@@ -1360,6 +1364,8 @@ struct ScriptCompileTimerScope {
return CacheBehaviour::kNoCacheBecausePacScript; return CacheBehaviour::kNoCacheBecausePacScript;
case ScriptCompiler::kNoCacheBecauseInDocumentWrite: case ScriptCompiler::kNoCacheBecauseInDocumentWrite:
return CacheBehaviour::kNoCacheBecauseInDocumentWrite; return CacheBehaviour::kNoCacheBecauseInDocumentWrite;
case ScriptCompiler::kNoCacheBecauseResourceWithNoCacheHandler:
return CacheBehaviour::kNoCacheBecauseResourceWithNoCacheHandler;
} }
UNREACHABLE(); UNREACHABLE();
} }
...@@ -1406,6 +1412,7 @@ struct ScriptCompileTimerScope { ...@@ -1406,6 +1412,7 @@ struct ScriptCompileTimerScope {
case CacheBehaviour::kNoCacheBecauseExtensionModule: case CacheBehaviour::kNoCacheBecauseExtensionModule:
case CacheBehaviour::kNoCacheBecausePacScript: case CacheBehaviour::kNoCacheBecausePacScript:
case CacheBehaviour::kNoCacheBecauseInDocumentWrite: case CacheBehaviour::kNoCacheBecauseInDocumentWrite:
case CacheBehaviour::kNoCacheBecauseResourceWithNoCacheHandler:
return isolate_->counters()->compile_script_no_cache_other(); return isolate_->counters()->compile_script_no_cache_other();
case CacheBehaviour::kCount: case CacheBehaviour::kCount:
......
...@@ -1066,7 +1066,7 @@ class RuntimeCallTimerScope { ...@@ -1066,7 +1066,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, 18, 19) HR(compile_script_cache_behaviour, V8.CompileScript.CacheBehaviour, 0, 19, 20)
#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