From 21a2f36b25af1cf4042f6d0f5cee0db824ec6bcd Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Wed, 16 Jul 2014 08:14:50 +0000 Subject: [PATCH] Do not expose all timer events to the API callback. R=fmeawad@chromium.org Review URL: https://codereview.chromium.org/388783004 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22422 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/api.cc | 15 +++---- src/compiler.cc | 9 ++-- src/full-codegen.cc | 3 +- src/ic.cc | 51 ++++++++--------------- src/isolate.cc | 4 +- src/log.cc | 31 +++++++------- src/log.h | 68 +++++++++++++++++-------------- src/optimizing-compiler-thread.cc | 3 +- src/vm-state-inl.h | 6 +-- 9 files changed, 85 insertions(+), 105 deletions(-) diff --git a/src/api.cc b/src/api.cc index df66ea2386..a333ad9866 100644 --- a/src/api.cc +++ b/src/api.cc @@ -1675,8 +1675,7 @@ Local Script::Run() { ON_BAILOUT(isolate, "v8::Script::Run()", return Local()); LOG_API(isolate, "Script::Run"); ENTER_V8(isolate); - i::Logger::TimerEventScope timer_scope( - isolate, i::Logger::TimerEventScope::v8_execute); + i::TimerEventScope timer_scope(isolate); i::HandleScope scope(isolate); i::Handle fun = i::Handle::cast(obj); EXCEPTION_PREAMBLE(isolate); @@ -3849,8 +3848,7 @@ Local Object::CallAsFunction(v8::Handle recv, return Local()); LOG_API(isolate, "Object::CallAsFunction"); ENTER_V8(isolate); - i::Logger::TimerEventScope timer_scope( - isolate, i::Logger::TimerEventScope::v8_execute); + i::TimerEventScope timer_scope(isolate); i::HandleScope scope(isolate); i::Handle obj = Utils::OpenHandle(this); i::Handle recv_obj = Utils::OpenHandle(*recv); @@ -3884,8 +3882,7 @@ Local Object::CallAsConstructor(int argc, return Local()); LOG_API(isolate, "Object::CallAsConstructor"); ENTER_V8(isolate); - i::Logger::TimerEventScope timer_scope( - isolate, i::Logger::TimerEventScope::v8_execute); + i::TimerEventScope timer_scope(isolate); i::HandleScope scope(isolate); i::Handle obj = Utils::OpenHandle(this); STATIC_ASSERT(sizeof(v8::Handle) == sizeof(i::Object**)); @@ -3944,8 +3941,7 @@ Local Function::NewInstance(int argc, return Local()); LOG_API(isolate, "Function::NewInstance"); ENTER_V8(isolate); - i::Logger::TimerEventScope timer_scope( - isolate, i::Logger::TimerEventScope::v8_execute); + i::TimerEventScope timer_scope(isolate); EscapableHandleScope scope(reinterpret_cast(isolate)); i::Handle function = Utils::OpenHandle(this); STATIC_ASSERT(sizeof(v8::Handle) == sizeof(i::Object**)); @@ -3965,8 +3961,7 @@ Local Function::Call(v8::Handle recv, int argc, ON_BAILOUT(isolate, "v8::Function::Call()", return Local()); LOG_API(isolate, "Function::Call"); ENTER_V8(isolate); - i::Logger::TimerEventScope timer_scope( - isolate, i::Logger::TimerEventScope::v8_execute); + i::TimerEventScope timer_scope(isolate); i::HandleScope scope(isolate); i::Handle fun = Utils::OpenHandle(this); i::Handle recv_obj = Utils::OpenHandle(*recv); diff --git a/src/compiler.cc b/src/compiler.cc index e81fc0a470..b47db481aa 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -1132,8 +1132,7 @@ static bool CompileOptimizedPrologue(CompilationInfo* info) { static bool GetOptimizedCodeNow(CompilationInfo* info) { if (!CompileOptimizedPrologue(info)) return false; - Logger::TimerEventScope timer( - info->isolate(), Logger::TimerEventScope::v8_recompile_synchronous); + TimerEventScope timer(info->isolate()); OptimizedCompileJob job(info); if (job.CreateGraph() != OptimizedCompileJob::SUCCEEDED) return false; @@ -1164,8 +1163,7 @@ static bool GetOptimizedCodeLater(CompilationInfo* info) { if (!CompileOptimizedPrologue(info)) return false; info->SaveHandles(); // Copy handles to the compilation handle scope. - Logger::TimerEventScope timer( - isolate, Logger::TimerEventScope::v8_recompile_synchronous); + TimerEventScope timer(info->isolate()); OptimizedCompileJob* job = new(info->zone()) OptimizedCompileJob(info); OptimizedCompileJob::Status status = job->CreateGraph(); @@ -1238,8 +1236,7 @@ Handle Compiler::GetConcurrentlyOptimizedCode(OptimizedCompileJob* job) { Isolate* isolate = info->isolate(); VMState state(isolate); - Logger::TimerEventScope timer( - isolate, Logger::TimerEventScope::v8_recompile_synchronous); + TimerEventScope timer(info->isolate()); Handle shared = info->shared_info(); shared->code()->set_profiler_ticks(0); diff --git a/src/full-codegen.cc b/src/full-codegen.cc index 9b9b40d5a0..37a8406a1d 100644 --- a/src/full-codegen.cc +++ b/src/full-codegen.cc @@ -290,8 +290,7 @@ void BreakableStatementChecker::VisitThisFunction(ThisFunction* expr) { bool FullCodeGenerator::MakeCode(CompilationInfo* info) { Isolate* isolate = info->isolate(); - Logger::TimerEventScope timer( - isolate, Logger::TimerEventScope::v8_compile_full_code); + TimerEventScope timer(info->isolate()); Handle