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 {
kNoCacheBecauseV8Extension,
kNoCacheBecauseExtensionModule,
kNoCacheBecausePacScript,
kNoCacheBecauseInDocumentWrite
kNoCacheBecauseInDocumentWrite,
kNoCacheBecauseResourceWithNoCacheHandler
};
/**
......
......@@ -1236,6 +1236,9 @@ namespace {
struct ScriptCompileTimerScope {
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 {
kProduceCodeCache,
kHitIsolateCacheWhenNoCache,
......@@ -1256,6 +1259,7 @@ struct ScriptCompileTimerScope {
kNoCacheBecauseExtensionModule,
kNoCacheBecausePacScript,
kNoCacheBecauseInDocumentWrite,
kNoCacheBecauseResourceWithNoCacheHandler,
kCount
};
......@@ -1360,6 +1364,8 @@ struct ScriptCompileTimerScope {
return CacheBehaviour::kNoCacheBecausePacScript;
case ScriptCompiler::kNoCacheBecauseInDocumentWrite:
return CacheBehaviour::kNoCacheBecauseInDocumentWrite;
case ScriptCompiler::kNoCacheBecauseResourceWithNoCacheHandler:
return CacheBehaviour::kNoCacheBecauseResourceWithNoCacheHandler;
}
UNREACHABLE();
}
......@@ -1406,6 +1412,7 @@ struct ScriptCompileTimerScope {
case CacheBehaviour::kNoCacheBecauseExtensionModule:
case CacheBehaviour::kNoCacheBecausePacScript:
case CacheBehaviour::kNoCacheBecauseInDocumentWrite:
case CacheBehaviour::kNoCacheBecauseResourceWithNoCacheHandler:
return isolate_->counters()->compile_script_no_cache_other();
case CacheBehaviour::kCount:
......
......@@ -1066,7 +1066,7 @@ class RuntimeCallTimerScope {
20) \
HR(wasm_lazy_compilation_throughput, V8.WasmLazyCompilationThroughput, 1, \
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) \
/* 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