From 890400af529f42ca06392f2ce6d68405540a068a Mon Sep 17 00:00:00 2001 From: zealotchen <92966734+zealotchen0@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:40:34 +0800 Subject: [PATCH] feat(js): open js profiler (#3489) * feat(js): open js profiler * chore(js): open js profiler * chore(js): open js profiler * chore(js): open js profiler * chore(js): open js profiler * chore(js): open js profiler --- driver/js/src/vm/v8/v8_vm.cc | 4 ++++ framework/android/build.gradle | 1 + framework/android/gradle.properties | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/driver/js/src/vm/v8/v8_vm.cc b/driver/js/src/vm/v8/v8_vm.cc index 8e43e7adb08..57212d40372 100644 --- a/driver/js/src/vm/v8/v8_vm.cc +++ b/driver/js/src/vm/v8/v8_vm.cc @@ -88,6 +88,10 @@ V8VM::V8VM(const std::shared_ptr& param) : VM(param) { #endif FOOTSTONE_DLOG(INFO) << "Initialize"; v8::V8::Initialize(); +#ifdef ENABLE_INSPECTOR + auto trace = reinterpret_cast(platform->GetTracingController()); + devtools::DevtoolsDataSource::OnGlobalTracingControlGenerate(trace); +#endif } } create_params_.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator(); diff --git a/framework/android/build.gradle b/framework/android/build.gradle index 14fd6c253f4..2e9a643fd2a 100644 --- a/framework/android/build.gradle +++ b/framework/android/build.gradle @@ -123,6 +123,7 @@ android { arguments ( "-DCMAKE_BUILD_TYPE=Debug", "-DMODULES=${getAllModules().join(';')}", + "-DENABLE_INSPECTOR=$ENABLE_INSPECTOR", *mergeCppDefinitions() ) diff --git a/framework/android/gradle.properties b/framework/android/gradle.properties index 0f1d472f854..5182f9e96a5 100644 --- a/framework/android/gradle.properties +++ b/framework/android/gradle.properties @@ -116,3 +116,8 @@ PUBLISH_ARTIFACT_ID=release # Specifies maven publish group ID # PUBLISH_GROUP_ID=com.tencent.hippy + +# +# Specifies DEVTOOL INSPECTOR OPEN OR NOT +# +ENABLE_INSPECTOR=true