diff --git a/include/v8.h b/include/v8.h index 1346ad67f2..de0c7c0437 100644 --- a/include/v8.h +++ b/include/v8.h @@ -1449,7 +1449,10 @@ class V8_EXPORT ScriptCompiler { kNoCacheBecauseInspector, kNoCacheBecauseScriptTooSmall, kNoCacheBecauseCacheTooCold, - kNoCacheBecauseExtension, + kNoCacheBecauseV8Extension, + kNoCacheBecauseExtensionModule, + kNoCacheBecausePacScript, + kNoCacheBecauseInDocumentWrite }; /** diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index c580cd6278..409d3a46a7 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -3759,7 +3759,7 @@ bool Genesis::CompileExtension(Isolate* isolate, v8::Extension* extension) { source, script_name, 0, 0, ScriptOriginOptions(), MaybeHandle(), context, extension, nullptr, ScriptCompiler::kNoCompileOptions, - ScriptCompiler::kNoCacheBecauseExtension, EXTENSION_CODE, + ScriptCompiler::kNoCacheBecauseV8Extension, EXTENSION_CODE, MaybeHandle()); if (!maybe_function_info.ToHandle(&function_info)) return false; cache->Add(name, function_info); diff --git a/src/compiler.cc b/src/compiler.cc index 58532caa73..68b3e0911c 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -1251,9 +1251,12 @@ struct ScriptCompileTimerScope { kNoCacheBecauseCachingDisabled, kNoCacheBecauseModule, kNoCacheBecauseStreamingSource, - kNoCacheBecauseExtension, + kNoCacheBecauseV8Extension, kHitIsolateCacheWhenProduceCodeCache, kHitIsolateCacheWhenConsumeCodeCache, + kNoCacheBecauseExtensionModule, + kNoCacheBecausePacScript, + kNoCacheBecauseInDocumentWrite, kCount }; @@ -1350,8 +1353,14 @@ struct ScriptCompileTimerScope { return CacheBehaviour::kNoCacheBecauseModule; case ScriptCompiler::kNoCacheBecauseStreamingSource: return CacheBehaviour::kNoCacheBecauseStreamingSource; - case ScriptCompiler::kNoCacheBecauseExtension: - return CacheBehaviour::kNoCacheBecauseExtension; + case ScriptCompiler::kNoCacheBecauseV8Extension: + return CacheBehaviour::kNoCacheBecauseV8Extension; + case ScriptCompiler::kNoCacheBecauseExtensionModule: + return CacheBehaviour::kNoCacheBecauseExtensionModule; + case ScriptCompiler::kNoCacheBecausePacScript: + return CacheBehaviour::kNoCacheBecausePacScript; + case ScriptCompiler::kNoCacheBecauseInDocumentWrite: + return CacheBehaviour::kNoCacheBecauseInDocumentWrite; } UNREACHABLE(); } @@ -1394,7 +1403,10 @@ struct ScriptCompileTimerScope { // TODO(leszeks): Count separately or remove entirely once we have // background compilation. case CacheBehaviour::kNoCacheBecauseStreamingSource: - case CacheBehaviour::kNoCacheBecauseExtension: + case CacheBehaviour::kNoCacheBecauseV8Extension: + case CacheBehaviour::kNoCacheBecauseExtensionModule: + case CacheBehaviour::kNoCacheBecausePacScript: + case CacheBehaviour::kNoCacheBecauseInDocumentWrite: return isolate_->counters()->compile_script_no_cache_other(); case CacheBehaviour::kCount: diff --git a/src/counters.h b/src/counters.h index f5d0dc4318..2f824db796 100644 --- a/src/counters.h +++ b/src/counters.h @@ -1065,7 +1065,7 @@ class RuntimeCallTimerScope { 20) \ HR(wasm_lazy_compilation_throughput, V8.WasmLazyCompilationThroughput, 1, \ 10000, 50) \ - HR(compile_script_cache_behaviour, V8.CompileScript.CacheBehaviour, 0, 15, 16) + HR(compile_script_cache_behaviour, V8.CompileScript.CacheBehaviour, 0, 18, 19) #define HISTOGRAM_TIMER_LIST(HT) \ /* Garbage collection timers. */ \