From d684ece016209efe7a864144a1ce07bd12b1cae1 Mon Sep 17 00:00:00 2001 From: yangguo Date: Wed, 28 Jan 2015 07:55:04 -0800 Subject: [PATCH] Only add API-triggered compilation to compile-script histogram. R=vogelheim@chromium.org Review URL: https://codereview.chromium.org/879273003 Cr-Commit-Position: refs/heads/master@{#26308} --- src/api.cc | 1 + src/compiler.cc | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/api.cc b/src/api.cc index 8ddd351f9e..9b6be9ac55 100644 --- a/src/api.cc +++ b/src/api.cc @@ -1598,6 +1598,7 @@ Local ScriptCompiler::CompileUnbound( ENTER_V8(isolate); i::SharedFunctionInfo* raw_result = NULL; { i::HandleScope scope(isolate); + i::HistogramTimerScope total(isolate->counters()->compile_script(), true); i::Handle name_obj; int line_offset = 0; int column_offset = 0; diff --git a/src/compiler.cc b/src/compiler.cc index 4517b1f870..f7d3676e74 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -1268,8 +1268,6 @@ Handle Compiler::CompileScript( v8::Extension* extension, ScriptData** cached_data, ScriptCompiler::CompileOptions compile_options, NativesFlag natives) { Isolate* isolate = source->GetIsolate(); - HistogramTimerScope total(isolate->counters()->compile_script(), true); - if (compile_options == ScriptCompiler::kNoCompileOptions) { cached_data = NULL; } else if (compile_options == ScriptCompiler::kProduceParserCache ||