From 682a0d65c6406d47b664ccb971f7df4e7e223843 Mon Sep 17 00:00:00 2001 From: "yurys@chromium.org" Date: Tue, 23 Jul 2013 13:44:15 +0000 Subject: [PATCH] Deprecate v8::V8::Pause/ResumeProfiler The methods were added to the public API in r1185 when Chrome DevTools were using the same output as produced for tick processor when --prof option is specified. I don't see any existing clients of these methods and since they add a noticeable complexity to the profiler code I'd like to remove them. BUG=None R=yangguo@chromium.org Review URL: https://codereview.chromium.org/19591006 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 6 +++--- src/d8.cc | 14 -------------- src/d8.h | 2 -- src/debug-debugger.js | 14 -------------- src/runtime.cc | 14 -------------- src/runtime.h | 5 +---- test/cctest/test-log.cc | 2 ++ 7 files changed, 6 insertions(+), 51 deletions(-) diff --git a/include/v8.h b/include/v8.h index 9ce0583..529597a 100644 --- a/include/v8.h +++ b/include/v8.h @@ -4545,18 +4545,18 @@ class V8EXPORT V8 { * See also the --prof and --prof_auto command line switches to * enable V8 profiling. */ - static void PauseProfiler(); + V8_DEPRECATED(static void PauseProfiler()); /** * Resumes recording of tick samples in the profiler. * See also PauseProfiler(). */ - static void ResumeProfiler(); + V8_DEPRECATED(static void ResumeProfiler()); /** * Return whether profiler is currently paused. */ - static bool IsProfilerPaused(); + V8_DEPRECATED(static bool IsProfilerPaused()); /** * Retrieve the V8 thread id of the calling thread. diff --git a/src/d8.cc b/src/d8.cc index e576e9c..5343174 100644 --- a/src/d8.cc +++ b/src/d8.cc @@ -457,16 +457,6 @@ void Shell::Write(const v8::FunctionCallbackInfo& args) { } -void Shell::EnableProfiler(const v8::FunctionCallbackInfo& args) { - V8::ResumeProfiler(); -} - - -void Shell::DisableProfiler(const v8::FunctionCallbackInfo& args) { - V8::PauseProfiler(); -} - - void Shell::Read(const v8::FunctionCallbackInfo& args) { String::Utf8Value file(args[0]); if (*file == NULL) { @@ -857,10 +847,6 @@ Handle Shell::CreateGlobalTemplate(Isolate* isolate) { global_template->Set(String::New("load"), FunctionTemplate::New(Load)); global_template->Set(String::New("quit"), FunctionTemplate::New(Quit)); global_template->Set(String::New("version"), FunctionTemplate::New(Version)); - global_template->Set(String::New("enableProfiler"), - FunctionTemplate::New(EnableProfiler)); - global_template->Set(String::New("disableProfiler"), - FunctionTemplate::New(DisableProfiler)); // Bind the Realm object. Handle realm_template = ObjectTemplate::New(); diff --git a/src/d8.h b/src/d8.h index 804cc46..4f04342 100644 --- a/src/d8.h +++ b/src/d8.h @@ -317,8 +317,6 @@ class Shell : public i::AllStatic { static void Write(const v8::FunctionCallbackInfo& args); static void Quit(const v8::FunctionCallbackInfo& args); static void Version(const v8::FunctionCallbackInfo& args); - static void EnableProfiler(const v8::FunctionCallbackInfo& args); - static void DisableProfiler(const v8::FunctionCallbackInfo& args); static void Read(const v8::FunctionCallbackInfo& args); static void ReadBuffer(const v8::FunctionCallbackInfo& args); static Handle ReadFromStdin(Isolate* isolate); diff --git a/src/debug-debugger.js b/src/debug-debugger.js index 88efbe2..a588b4c 100644 --- a/src/debug-debugger.js +++ b/src/debug-debugger.js @@ -1469,8 +1469,6 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function( this.suspendRequest_(request, response); } else if (request.command == 'version') { this.versionRequest_(request, response); - } else if (request.command == 'profile') { - this.profileRequest_(request, response); } else if (request.command == 'changelive') { this.changeLiveRequest_(request, response); } else if (request.command == 'restartframe') { @@ -2400,18 +2398,6 @@ DebugCommandProcessor.prototype.versionRequest_ = function(request, response) { }; -DebugCommandProcessor.prototype.profileRequest_ = function(request, response) { - if (request.arguments.command == 'resume') { - %ProfilerResume(); - } else if (request.arguments.command == 'pause') { - %ProfilerPause(); - } else { - return response.failed('Unknown command'); - } - response.body = {}; -}; - - DebugCommandProcessor.prototype.changeLiveRequest_ = function( request, response) { if (!request.arguments) { diff --git a/src/runtime.cc b/src/runtime.cc index c36d453..0c88cae 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -13345,20 +13345,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetHeapUsage) { #endif // ENABLE_DEBUGGER_SUPPORT -RUNTIME_FUNCTION(MaybeObject*, Runtime_ProfilerResume) { - SealHandleScope shs(isolate); - v8::V8::ResumeProfiler(); - return isolate->heap()->undefined_value(); -} - - -RUNTIME_FUNCTION(MaybeObject*, Runtime_ProfilerPause) { - SealHandleScope shs(isolate); - v8::V8::PauseProfiler(); - return isolate->heap()->undefined_value(); -} - - // Finds the script object from the script data. NOTE: This operation uses // heap traversal to find the function generated for the source position // for the requested break point. For lazily compiled functions several heap diff --git a/src/runtime.h b/src/runtime.h index a8c10d9..2fe9b0e 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -467,10 +467,7 @@ namespace internal { F(TransitionElementsKind, 2, 1) \ F(TransitionElementsSmiToDouble, 1, 1) \ F(TransitionElementsDoubleToObject, 1, 1) \ - F(HaveSameMap, 2, 1) \ - /* profiler */ \ - F(ProfilerResume, 0, 1) \ - F(ProfilerPause, 0, 1) + F(HaveSameMap, 2, 1) #ifdef ENABLE_DEBUGGER_SUPPORT diff --git a/test/cctest/test-log.cc b/test/cctest/test-log.cc index 81cb001..bf1151e 100644 --- a/test/cctest/test-log.cc +++ b/test/cctest/test-log.cc @@ -27,6 +27,7 @@ // // Tests of logging functions from log.h +#define V8_DISABLE_DEPRECATIONS 1 #ifdef __linux__ #include #include @@ -43,6 +44,7 @@ #include "v8utils.h" #include "cctest.h" #include "vm-state-inl.h" +#undef V8_DISABLE_DEPRECATIONS using v8::internal::Address; using v8::internal::EmbeddedVector; -- 2.7.4