Update intialization of vtune support.
authorjochen@chromium.org <jochen@chromium.org>
Wed, 22 Oct 2014 15:30:50 +0000 (15:30 +0000)
committerjochen@chromium.org <jochen@chromium.org>
Wed, 22 Oct 2014 15:30:50 +0000 (15:30 +0000)
 In R23940 (https://code.google.com/p/v8/source/detail?r=23940) it introduces
 Isolate::CreateParams and mentions that V8::SetJitCodeEventHandler should either
 be passed to Isolate::New as well, or invoked via the Isolate.

 When Chrome as embedder of V8, we will set the Jit Code event handler for Vtune
 support during the initialization of renderer process and V8 has be initialized
 at that time. It's better that we invoke V8::SetJitCodeEventHander via the Isolate.
 So we change the vTune::InitializeVtuneForV8(v8::Isolate::CreateParams& params) to
 vTune::InitializeVtuneForV8(v8::Isolate* isolate).

 we will do corresponding changes in chromium code if this patch is landed and Chromium
 updates V8 to the
 new release branch.

 some part of this patch is provided by denis.pravdin@intel.com.

BUG=
R=danno@chromium.org, jochen@chromium.org

Review URL: https://codereview.chromium.org/655183002

Patch from Chunyang Dai <chunyang.dai@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24811 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/d8.cc
src/third_party/vtune/v8-vtune.h
src/third_party/vtune/vtune-jit.cc

index c9de287..85d1048 100644 (file)
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1686,7 +1686,7 @@ int Shell::Main(int argc, char* argv[]) {
   }
 #endif
 #ifdef ENABLE_VTUNE_JIT_INTERFACE
-  vTune::InitializeVtuneForV8(create_params);
+  create_params.code_event_handler = vTune::GetVtuneCodeEventHandler();
 #endif
 #ifndef V8_SHARED
   create_params.constraints.ConfigureDefaults(
index a7e5116..34da9cb 100644 (file)
@@ -62,7 +62,7 @@
 
 namespace vTune {
 
-void InitializeVtuneForV8(v8::Isolate::CreateParams& params);
+v8::JitCodeEventHandler GetVtuneCodeEventHandler();
 
 }  // namespace vTune
 
index e489d6e..b621cbc 100644 (file)
@@ -271,10 +271,10 @@ void VTUNEJITInterface::event_handler(const v8::JitCodeEvent* event) {
 
 }  // namespace internal
 
-void InitializeVtuneForV8(v8::Isolate::CreateParams& params) {
+v8::JitCodeEventHandler GetVtuneCodeEventHandler() {
   v8::V8::SetFlagsFromString("--nocompact_code_space",
                              (int)strlen("--nocompact_code_space"));
-  params.code_event_handler = vTune::internal::VTUNEJITInterface::event_handler;
+  return vTune::internal::VTUNEJITInterface::event_handler;
 }
 
 }  // namespace vTune