Commit 362306ea authored by Fanchen Kong's avatar Fanchen Kong Committed by V8 LUCI CQ

Fix vtunejit issues

This change fixes two issues with VTune JIT Profiling API.

1. Update way of setting flag "--no-compact-code-space" to avoid changing flags after initialization v8.
2. Fix a crash from visiting uninitialized ptr.

Change-Id: I4878ffd554ce53630db961fe09b49e081b0091bf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3787321Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Fanchen Kong <fanchen.kong@intel.com>
Cr-Commit-Position: refs/heads/main@{#82003}
parent 8ad95397
...@@ -106,7 +106,7 @@ struct JitCodeEvent { ...@@ -106,7 +106,7 @@ struct JitCodeEvent {
size_t line_number_table_size; size_t line_number_table_size;
}; };
wasm_source_info_t* wasm_source_info; wasm_source_info_t* wasm_source_info = nullptr;
union { union {
// Only valid for CODE_ADDED. // Only valid for CODE_ADDED.
......
...@@ -5648,7 +5648,9 @@ int Shell::Main(int argc, char* argv[]) { ...@@ -5648,7 +5648,9 @@ int Shell::Main(int argc, char* argv[]) {
} }
create_params.array_buffer_allocator = Shell::array_buffer_allocator; create_params.array_buffer_allocator = Shell::array_buffer_allocator;
#ifdef ENABLE_VTUNE_JIT_INTERFACE #ifdef ENABLE_VTUNE_JIT_INTERFACE
create_params.code_event_handler = vTune::GetVtuneCodeEventHandler(); if (i::FLAG_enable_vtunejit) {
create_params.code_event_handler = vTune::GetVtuneCodeEventHandler();
}
#endif #endif
create_params.constraints.ConfigureDefaults( create_params.constraints.ConfigureDefaults(
base::SysInfo::AmountOfPhysicalMemory(), base::SysInfo::AmountOfPhysicalMemory(),
......
...@@ -1582,6 +1582,11 @@ DEFINE_STRING(expose_cputracemark_as, nullptr, ...@@ -1582,6 +1582,11 @@ DEFINE_STRING(expose_cputracemark_as, nullptr,
DEFINE_BOOL(enable_vtune_domain_support, true, "enable vtune domain support") DEFINE_BOOL(enable_vtune_domain_support, true, "enable vtune domain support")
#endif // ENABLE_VTUNE_TRACEMARK #endif // ENABLE_VTUNE_TRACEMARK
#ifdef ENABLE_VTUNE_JIT_INTERFACE
DEFINE_BOOL(enable_vtunejit, true, "enable vtune jit interface")
DEFINE_NEG_IMPLICATION(enable_vtunejit, compact_code_space)
#endif // ENABLE_VTUNE_JIT_INTERFACE
// builtins.cc // builtins.cc
DEFINE_BOOL(allow_unsafe_function_constructor, false, DEFINE_BOOL(allow_unsafe_function_constructor, false,
"allow invoking the function constructor without security checks") "allow invoking the function constructor without security checks")
......
...@@ -295,7 +295,6 @@ void VTUNEJITInterface::event_handler(const v8::JitCodeEvent* event) { ...@@ -295,7 +295,6 @@ void VTUNEJITInterface::event_handler(const v8::JitCodeEvent* event) {
} // namespace internal } // namespace internal
v8::JitCodeEventHandler GetVtuneCodeEventHandler() { v8::JitCodeEventHandler GetVtuneCodeEventHandler() {
v8::V8::SetFlagsFromString("--no-compact-code-space");
return vTune::internal::VTUNEJITInterface::event_handler; return vTune::internal::VTUNEJITInterface::event_handler;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment