Commit 13d0784d authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[compiler] Fix isolate cache/consume cache histogram sample

The consume code cache code path was only taken in the case where the
isolate cache lookup failed, making the "hit isolate cache when consume
code cache" histogram sample never work.

Bug: chromium:769203
Change-Id: I15398f9ce4fc53602b323b8efb8ac9787440dd85
Reviewed-on: https://chromium-review.googlesource.com/765455Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49321}
parent cecbe26b
......@@ -1434,13 +1434,18 @@ MaybeHandle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
MaybeHandle<SharedFunctionInfo> maybe_result;
Handle<Cell> vector;
if (extension == nullptr) {
bool can_consume_code_cache =
compile_options == ScriptCompiler::kConsumeCodeCache &&
!isolate->debug()->is_loaded();
if (can_consume_code_cache) {
compile_timer.set_consuming_code_cache();
}
// First check per-isolate compilation cache.
InfoVectorPair pair = compilation_cache->LookupScript(
source, maybe_script_name, line_offset, column_offset, resource_options,
context, language_mode);
if (!pair.has_shared() &&
compile_options == ScriptCompiler::kConsumeCodeCache &&
!isolate->debug()->is_loaded()) {
if (can_consume_code_cache && !pair.has_shared()) {
compile_timer.set_consuming_code_cache();
// Then check cached code provided by embedder.
HistogramTimerScope timer(isolate->counters()->compile_deserialize());
......
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