From a699645b71ec442617647cef55ac71f53c6293fa Mon Sep 17 00:00:00 2001 From: yangguo Date: Mon, 26 Jan 2015 02:56:53 -0800 Subject: [PATCH] Probe same-isolate compilation cache before deserializing. R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/875863002 Cr-Commit-Position: refs/heads/master@{#26266} --- src/compiler.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index 266bd54..4517b1f 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -1293,7 +1293,10 @@ Handle Compiler::CompileScript( MaybeHandle maybe_result; Handle result; if (extension == NULL) { - if (FLAG_serialize_toplevel && + maybe_result = compilation_cache->LookupScript( + source, script_name, line_offset, column_offset, is_shared_cross_origin, + context); + if (maybe_result.is_null() && FLAG_serialize_toplevel && compile_options == ScriptCompiler::kConsumeCodeCache && !isolate->debug()->is_loaded()) { HistogramTimerScope timer(isolate->counters()->compile_deserialize()); @@ -1303,10 +1306,6 @@ Handle Compiler::CompileScript( return result; } // Deserializer failed. Fall through to compile. - } else { - maybe_result = compilation_cache->LookupScript( - source, script_name, line_offset, column_offset, - is_shared_cross_origin, context); } } -- 2.7.4