Commit 083c5a6c authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Compile] Track cases where a script is in the isolate cache but was streaming parse/compiled.

We want to limit these cases since they result in unecessary work on background threads
doing the streaming parse / compile, and delay the script execution unecessarily
while waiting for the streamer to complete.

BUG=chromium:865098

Change-Id: Ibb3346c2e644bb333521d876d00aeb9cc063b6aa
Reviewed-on: https://chromium-review.googlesource.com/1163669Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54929}
parent c38f52f1
...@@ -1383,6 +1383,7 @@ struct ScriptCompileTimerScope { ...@@ -1383,6 +1383,7 @@ struct ScriptCompileTimerScope {
kNoCacheBecausePacScript, kNoCacheBecausePacScript,
kNoCacheBecauseInDocumentWrite, kNoCacheBecauseInDocumentWrite,
kNoCacheBecauseResourceWithNoCacheHandler, kNoCacheBecauseResourceWithNoCacheHandler,
kHitIsolateCacheWhenStreamingSource,
kCount kCount
}; };
...@@ -1455,8 +1456,9 @@ struct ScriptCompileTimerScope { ...@@ -1455,8 +1456,9 @@ struct ScriptCompileTimerScope {
} }
if (hit_isolate_cache_) { if (hit_isolate_cache_) {
// There's probably no need to distinguish the different isolate cache if (no_cache_reason_ == ScriptCompiler::kNoCacheBecauseStreamingSource) {
// hits. return CacheBehaviour::kHitIsolateCacheWhenStreamingSource;
}
return CacheBehaviour::kHitIsolateCacheWhenNoCache; return CacheBehaviour::kHitIsolateCacheWhenNoCache;
} }
...@@ -1510,6 +1512,7 @@ struct ScriptCompileTimerScope { ...@@ -1510,6 +1512,7 @@ struct ScriptCompileTimerScope {
return isolate_->counters()->compile_script_with_produce_cache(); return isolate_->counters()->compile_script_with_produce_cache();
case CacheBehaviour::kHitIsolateCacheWhenNoCache: case CacheBehaviour::kHitIsolateCacheWhenNoCache:
case CacheBehaviour::kHitIsolateCacheWhenConsumeCodeCache: case CacheBehaviour::kHitIsolateCacheWhenConsumeCodeCache:
case CacheBehaviour::kHitIsolateCacheWhenStreamingSource:
return isolate_->counters()->compile_script_with_isolate_cache_hit(); return isolate_->counters()->compile_script_with_isolate_cache_hit();
case CacheBehaviour::kConsumeCodeCacheFailed: case CacheBehaviour::kConsumeCodeCacheFailed:
return isolate_->counters()->compile_script_consume_failed(); return isolate_->counters()->compile_script_consume_failed();
......
...@@ -1171,8 +1171,8 @@ class RuntimeCallTimerScope { ...@@ -1171,8 +1171,8 @@ 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, 19, \ HR(compile_script_cache_behaviour, V8.CompileScript.CacheBehaviour, 0, 20, \
20) \ 21) \
HR(wasm_memory_allocation_result, V8.WasmMemoryAllocationResult, 0, 3, 4) \ HR(wasm_memory_allocation_result, V8.WasmMemoryAllocationResult, 0, 3, 4) \
HR(wasm_address_space_usage_mb, V8.WasmAddressSpaceUsageMiB, 0, 1 << 20, \ HR(wasm_address_space_usage_mb, V8.WasmAddressSpaceUsageMiB, 0, 1 << 20, \
128) \ 128) \
......
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