From b6ed0fef1f2f6bf47c0c7c13b4053d193859934b Mon Sep 17 00:00:00 2001 From: Kyle Farnung Date: Wed, 14 Feb 2018 13:34:02 -0800 Subject: [PATCH] src,test: cleanup differences with upstream * Fixed differences with upstream in the `src/` folder * Fixed linux test failure in `test-cli-node-options.js` PR-URL: https://github.com/nodejs/node-chakracore/pull/466 Reviewed-By: Taylor Woll Reviewed-By: Hitesh Kanwathirtha --- src/env-inl.h | 1 + src/node.cc | 173 ++++++++++++------------- src/node_api.h | 2 - src/node_buffer.cc | 15 ++- src/node_buffer.h | 5 +- src/node_contextify.cc | 15 +-- src/node_file.cc | 3 +- src/node_internals.h | 1 - src/node_trace_events.cc | 2 - src/node_url.h | 1 - src/string_bytes.cc | 12 +- test/parallel/test-cli-node-options.js | 14 +- 12 files changed, 118 insertions(+), 126 deletions(-) diff --git a/src/env-inl.h b/src/env-inl.h index 325b568cce2..5643fffb6f8 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -356,6 +356,7 @@ inline Environment::Environment(IsolateData* isolate_data, inline Environment::~Environment() { v8::HandleScope handle_scope(isolate()); + #if HAVE_INSPECTOR // Destroy inspector agent before erasing the context. The inspector // destructor depends on the context still being accessible. diff --git a/src/node.cc b/src/node.cc index 8015e60b536..da6c96a1b15 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2000,11 +2000,12 @@ static void WaitForInspectorDisconnect(Environment* env) { static void Exit(const FunctionCallbackInfo& args) { #if ENABLE_TTD_NODE - // If TTD recording is enable then we want to emit the log info - if (s_doTTRecord) { - JsTTDHostExit(args[0]->Int32Value()); - } + // If TTD recording is enable then we want to emit the log info + if (s_doTTRecord) { + JsTTDHostExit(args[0]->Int32Value()); + } #endif + WaitForInspectorDisconnect(Environment::GetCurrent(args)); if (trace_enabled) { v8_platform.StopTracingAgent(); @@ -2091,6 +2092,7 @@ static void Hrtime(const FunctionCallbackInfo& args) { fields[0] = (t / NANOS_PER_SEC) >> 32; fields[1] = (t / NANOS_PER_SEC) & 0xffffffff; fields[2] = t % NANOS_PER_SEC; + #if ENABLE_TTD_NODE if (s_doTTRecord || s_doTTReplay) { ab->TTDRawBufferModifyNotifySync(args[0].As()->ByteOffset(), @@ -2129,6 +2131,7 @@ static void CPUUsage(const FunctionCallbackInfo& args) { // Set the Float64Array elements to be user / system values in microseconds. fields[0] = MICROS_PER_SEC * rusage.ru_utime.tv_sec + rusage.ru_utime.tv_usec; fields[1] = MICROS_PER_SEC * rusage.ru_stime.tv_sec + rusage.ru_stime.tv_usec; + #if ENABLE_TTD_NODE if (s_doTTRecord || s_doTTReplay) { ab->TTDRawBufferModifyNotifySync(array->ByteOffset(), 2 * sizeof(double)); @@ -3532,10 +3535,10 @@ static void PrintHelp() { #if ENABLE_TTD_NODE void TTDFlagWarning(const char* arg, const char* newflag) { - fprintf(stderr, "Flag %s is deprecated use %s\n", arg, newflag); - fprintf(stderr, "Run with \"-h\" for help with flags.\n"); + fprintf(stderr, "Flag %s is deprecated use %s\n", arg, newflag); + fprintf(stderr, "Run with \"-h\" for help with flags.\n"); - exit(1); + exit(1); } void TTDFlagWarning_Cond(bool cond, const char* msg) { @@ -3750,44 +3753,44 @@ static void ParseArgs(int* argc, args_consumed += 1; trace_enabled_categories = categories; #if ENABLE_TTD_NODE - // Parse and extract the TT args - } else if (strcmp(arg, "--record") == 0) { - s_doTTRecord = true; - } else if (strstr(arg, "--tt-debug") == arg) { - s_doTTRecord = true; - s_doTTEnableDebug = true; - s_ttdSnapInterval = 500; - s_ttdSnapHistoryLength = 4; - } else if (strstr(arg, "--replay=") == arg) { - s_doTTReplay = true; - s_ttoptReplayUri = arg + strlen("--replay="); - s_ttoptReplayUriLength = strlen(s_ttoptReplayUri); - } else if (strstr(arg, "--replay-debug=") == arg) { - s_doTTReplay = true; - s_doTTEnableDebug = true; - s_ttoptReplayUri = arg + strlen("--replay-debug="); - s_ttoptReplayUriLength = strlen(s_ttoptReplayUri); - } else if (strcmp(arg, "--break-first") == 0) { - s_ttdStartupMode = (0x100 | 0x1); - debug_options.do_wait_for_connect(); - } else if (strstr(arg, "--record-interval=") == arg) { - const char* intervalStr = arg + strlen("--record-interval="); - s_ttdSnapInterval = (uint32_t)atoi(intervalStr); - } else if (strstr(arg, "--record-history=") == arg) { - const char* historyStr = arg + strlen("--record-history="); - s_ttdSnapHistoryLength = (uint32_t)atoi(historyStr); - } else if (strstr(arg, "-TTRecord:") == arg) { - TTDFlagWarning(arg, "--record"); - } else if (strstr(arg, "-TTReplay:") == arg) { - TTDFlagWarning(arg, "--replay=dir"); - } else if (strstr(arg, "-TTDebug:") == arg) { - TTDFlagWarning(arg, "--replay-debug=dir"); - } else if (strstr(arg, "-TTBreakFirst") == arg) { - TTDFlagWarning(arg, "--break-first"); - } else if (strstr(arg, "-TTSnapInterval:") == arg) { - TTDFlagWarning(arg, "--record-interval=num"); - } else if (strstr(arg, "-TTHistoryLength:") == arg) { - TTDFlagWarning(arg, "--record-history=num"); + // Parse and extract the TT args + } else if (strcmp(arg, "--record") == 0) { + s_doTTRecord = true; + } else if (strstr(arg, "--tt-debug") == arg) { + s_doTTRecord = true; + s_doTTEnableDebug = true; + s_ttdSnapInterval = 500; + s_ttdSnapHistoryLength = 4; + } else if (strstr(arg, "--replay=") == arg) { + s_doTTReplay = true; + s_ttoptReplayUri = arg + strlen("--replay="); + s_ttoptReplayUriLength = strlen(s_ttoptReplayUri); + } else if (strstr(arg, "--replay-debug=") == arg) { + s_doTTReplay = true; + s_doTTEnableDebug = true; + s_ttoptReplayUri = arg + strlen("--replay-debug="); + s_ttoptReplayUriLength = strlen(s_ttoptReplayUri); + } else if (strcmp(arg, "--break-first") == 0) { + s_ttdStartupMode = (0x100 | 0x1); + debug_options.do_wait_for_connect(); + } else if (strstr(arg, "--record-interval=") == arg) { + const char* intervalStr = arg + strlen("--record-interval="); + s_ttdSnapInterval = (uint32_t)atoi(intervalStr); + } else if (strstr(arg, "--record-history=") == arg) { + const char* historyStr = arg + strlen("--record-history="); + s_ttdSnapHistoryLength = (uint32_t)atoi(historyStr); + } else if (strstr(arg, "-TTRecord:") == arg) { + TTDFlagWarning(arg, "--record"); + } else if (strstr(arg, "-TTReplay:") == arg) { + TTDFlagWarning(arg, "--replay=dir"); + } else if (strstr(arg, "-TTDebug:") == arg) { + TTDFlagWarning(arg, "--replay-debug=dir"); + } else if (strstr(arg, "-TTBreakFirst") == arg) { + TTDFlagWarning(arg, "--break-first"); + } else if (strstr(arg, "-TTSnapInterval:") == arg) { + TTDFlagWarning(arg, "--record-interval=num"); + } else if (strstr(arg, "-TTHistoryLength:") == arg) { + TTDFlagWarning(arg, "--record-history=num"); #endif } else if (strcmp(arg, "--track-heap-objects") == 0) { track_heap_objects = true; @@ -4304,11 +4307,6 @@ void Init(int* argc, } #endif - // Unconditionally force typed arrays to allocate outside the v8 heap. This - // is to prevent memory pointers from being moved around that are returned by - // Buffer::Data(). - const char no_typed_array_heap[] = "--typed_array_max_size_in_heap=0"; - V8::SetFlagsFromString(no_typed_array_heap, sizeof(no_typed_array_heap) - 1); // Needed for access to V8 intrinsics. Disabled again during bootstrapping, // see lib/internal/bootstrap_node.js. const char allow_natives_syntax[] = "--allow_natives_syntax"; @@ -4451,8 +4449,7 @@ void FreePlatform(MultiIsolatePlatform* platform) { struct ChakraShimIsolateContext { ChakraShimIsolateContext(uv_loop_t* event_loop, uint32_t* zero_fill_field) : event_loop(event_loop), - zero_fill_field(zero_fill_field) - {} + zero_fill_field(zero_fill_field) {} uv_loop_t* event_loop; uint32_t* zero_fill_field; @@ -4463,9 +4460,7 @@ struct ChakraShimIsolateContext { Local NewContext(Isolate* isolate, bool recordTTD, Local object_template) { - auto context = Context::New(isolate, recordTTD, nullptr, object_template); - - return context; + return Context::New(isolate, recordTTD, nullptr, object_template); } #else Local NewContext(Isolate* isolate, @@ -4544,6 +4539,7 @@ inline int Start(Isolate* isolate, void* isolate_context, #endif env.set_trace_sync_io(trace_sync_io); + { SealHandleScope seal(isolate); bool more; @@ -4586,7 +4582,6 @@ inline int Start(Isolate* isolate, void* isolate_context, return exit_code; } - inline int Start(uv_loop_t* event_loop, int argc, const char* const* argv, int exec_argc, const char* const* exec_argv) { @@ -4599,7 +4594,7 @@ inline int Start(uv_loop_t* event_loop, #if ENABLE_TTD_NODE if (s_doTTRecord) { - fprintf(stderr, "Recording is enabled (but not yet started)...\n"); + fprintf(stderr, "Recording is enabled (but not yet started)...\n"); } Isolate* const isolate = Isolate::NewWithTTDSupport(params, @@ -4650,15 +4645,15 @@ inline int Start(uv_loop_t* event_loop, isolate_data_ptr = &isolate_data; #else ChakraShimIsolateContext chakra_isolate_ctx(event_loop, - allocator.zero_fill_field()); + allocator.zero_fill_field()); isolate_data_ptr = &chakra_isolate_ctx; #endif if (track_heap_objects) { isolate->GetHeapProfiler()->StartTrackingHeapObjects(true); } - exit_code = Start(isolate, isolate_data_ptr, argc, argv, - exec_argc, exec_argv); + exit_code = Start(isolate, isolate_data_ptr, argc, argv, exec_argc, + exec_argv); } { @@ -4674,8 +4669,8 @@ inline int Start(uv_loop_t* event_loop, #if ENABLE_TTD_NODE inline int Start_TTDReplay(Isolate* isolate, void* isolate_context, - int argc, const char* const* argv, - int exec_argc, const char* const* exec_argv) { + int argc, const char* const* argv, + int exec_argc, const char* const* exec_argv) { HandleScope handle_scope(isolate); Local context = Context::New(isolate, true); @@ -4684,12 +4679,11 @@ inline int Start_TTDReplay(Isolate* isolate, void* isolate_context, #ifdef NODE_ENGINE_CHAKRACORE ChakraShimIsolateContext* chakra_isolate_context = - reinterpret_cast(isolate_context); + reinterpret_cast(isolate_context); - IsolateData data(isolate, - chakra_isolate_context->event_loop, - v8_platform.Platform(), - chakra_isolate_context->zero_fill_field); + IsolateData data(isolate, chakra_isolate_context->event_loop, + v8_platform.Platform(), + chakra_isolate_context->zero_fill_field); IsolateData* isolate_data = &data; #else IsolateData* isolate_data = reinterpret_cast(isolate_context); @@ -4732,8 +4726,8 @@ inline int Start_TTDReplay(Isolate* isolate, void* isolate_context, } inline int Start_TTDReplay(uv_loop_t* event_loop, - int argc, const char* const* argv, - int exec_argc, const char* const* exec_argv) { + int argc, const char* const* argv, + int exec_argc, const char* const* exec_argv) { Isolate::CreateParams params; ArrayBufferAllocator allocator; params.array_buffer_allocator = &allocator; @@ -4872,36 +4866,38 @@ int Start(int argc, char** argv) { } TTDFlagWarning_Cond(!s_doTTRecord || !s_doTTReplay, - "Cannot enable record & replay at same time.\n"); + "Cannot enable record & replay at same time.\n"); if (s_doTTRecord || s_doTTReplay) { - TTDFlagWarning_Cond(eval_string == nullptr, - "Eval mode not supported in record/replay.\n"); + TTDFlagWarning_Cond(eval_string == nullptr, + "Eval mode not supported in record/replay.\n"); - TTDFlagWarning_Cond(!force_repl, - "Repl mode not supported in record/replay.\n"); + TTDFlagWarning_Cond(!force_repl, + "Repl mode not supported in record/replay.\n"); } if (s_doTTRecord) { - TTDFlagWarning_Cond(!chk_debug_enabled || s_doTTEnableDebug, - "Must use --tt-debug if attaching debugger to live session.\n"); + TTDFlagWarning_Cond( + !chk_debug_enabled || s_doTTEnableDebug, + "Must use --tt-debug if attaching debugger to live session.\n"); - TTDFlagWarning_Cond(!s_doTTEnableDebug || chk_debug_enabled, - "Must enable debugger if running --tt-debug.\n"); + TTDFlagWarning_Cond(!s_doTTEnableDebug || chk_debug_enabled, + "Must enable debugger if running --tt-debug.\n"); - TTDFlagWarning_Cond(s_ttdStartupMode == 0x1, - "Cannot set break flags in record mode.\n"); + TTDFlagWarning_Cond(s_ttdStartupMode == 0x1, + "Cannot set break flags in record mode.\n"); } if (s_doTTReplay) { - TTDFlagWarning_Cond(!chk_debug_enabled || s_doTTEnableDebug, - "Must enable --replay-debug if attaching debugger to recording.\n"); + TTDFlagWarning_Cond( + !chk_debug_enabled || s_doTTEnableDebug, + "Must enable --replay-debug if attaching debugger to recording.\n"); - TTDFlagWarning_Cond(!s_doTTEnableDebug || chk_debug_enabled, - "Must enable debugger if running --replay-debug.\n"); + TTDFlagWarning_Cond(!s_doTTEnableDebug || chk_debug_enabled, + "Must enable debugger if running --replay-debug.\n"); - TTDFlagWarning_Cond(s_ttoptReplayUri != nullptr, - "Must set replay source info when replaying.\n"); + TTDFlagWarning_Cond(s_ttoptReplayUri != nullptr, + "Must set replay source info when replaying.\n"); } if (s_doTTRecord) { @@ -4910,15 +4906,14 @@ int Start(int argc, char** argv) { } #endif - #if ENABLE_TTD_NODE int exit_code; if (s_doTTReplay) { exit_code = - Start_TTDReplay(uv_default_loop(), argc, argv, exec_argc, exec_argv); + Start_TTDReplay(uv_default_loop(), argc, argv, exec_argc, exec_argv); } else { exit_code = - Start(uv_default_loop(), argc, argv, exec_argc, exec_argv); + Start(uv_default_loop(), argc, argv, exec_argc, exec_argv); } #else const int exit_code = diff --git a/src/node_api.h b/src/node_api.h index 032df5859be..e9b3645e404 100644 --- a/src/node_api.h +++ b/src/node_api.h @@ -16,8 +16,6 @@ struct uv_loop_s; // Forward declaration. -#define NAPI_VERSION 2 - #ifdef _WIN32 #ifdef BUILDING_NODE_EXTENSION #ifdef EXTERNAL_NAPI diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 52f6fce7cea..4652643ebb4 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -678,10 +678,10 @@ void Fill(const FunctionCallbackInfo& args) { if (str_length >= fill_length) { #if ENABLE_TTD_NODE - TTD_NATIVE_BUFFER_ACCESS_NOTIFY("Fill Early Return"); + TTD_NATIVE_BUFFER_ACCESS_NOTIFY("Fill Early Return"); #endif - return; + return; } // If str_length is zero, then either an empty buffer was provided, or Write() // indicated that no bytes could be written. If no bytes could be written, @@ -690,8 +690,9 @@ void Fill(const FunctionCallbackInfo& args) { // buffers with unexpected contents. if (str_length == 0) { #if ENABLE_TTD_NODE - TTD_NATIVE_BUFFER_ACCESS_NOTIFY("Fill Questionable Case"); + TTD_NATIVE_BUFFER_ACCESS_NOTIFY("Fill Questionable Case"); #endif + return args.GetReturnValue().Set(-1); } @@ -752,7 +753,7 @@ void StringWrite(const FunctionCallbackInfo& args) { #if ENABLE_TTD_NODE if (s_doTTRecord || s_doTTReplay) { args.This().As()->Buffer()->TTDRawBufferModifyNotifySync( - ts_obj_offset + offset, written); + ts_obj_offset + offset, written); } #endif } @@ -1198,7 +1199,7 @@ void Swap16(const FunctionCallbackInfo& args) { #if ENABLE_TTD_NODE if (s_doTTRecord || s_doTTReplay) { args[0].As()->Buffer()->TTDRawBufferModifyNotifySync( - ts_obj_offset, ts_obj_length); + ts_obj_offset, ts_obj_length); } #endif } @@ -1214,7 +1215,7 @@ void Swap32(const FunctionCallbackInfo& args) { #if ENABLE_TTD_NODE if (s_doTTRecord || s_doTTReplay) { args[0].As()->Buffer()->TTDRawBufferModifyNotifySync( - ts_obj_offset, ts_obj_length); + ts_obj_offset, ts_obj_length); } #endif } @@ -1230,7 +1231,7 @@ void Swap64(const FunctionCallbackInfo& args) { #if ENABLE_TTD_NODE if (s_doTTRecord || s_doTTReplay) { args[0].As()->Buffer()->TTDRawBufferModifyNotifySync( - ts_obj_offset, ts_obj_length); + ts_obj_offset, ts_obj_length); } #endif } diff --git a/src/node_buffer.h b/src/node_buffer.h index 643f075c949..a84c57650b2 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -46,13 +46,14 @@ NODE_EXTERN void TTDAsyncModRegister(v8::Local val, unsigned char* initialModPosition); NODE_EXTERN void TTDAsyncModNotify(unsigned char* finalModPosition); NODE_EXTERN void TTDSyncDataModNotify(v8::Local val, - unsigned int index, unsigned int count); + unsigned int index, unsigned int count); + // Notify us that a native buffer access (which we don't currently // understand/support) happened. #define TTD_NATIVE_BUFFER_ACCESS_NOTIFY(X) \ if (s_doTTRecord || s_doTTReplay) { \ JsTTDCheckAndAssertIfTTDRunning( \ - "Unsupported raw buffer access -- investigate this!!!\n"); \ + "Unsupported raw buffer access -- investigate this!!!\n"); \ } #else #define TTD_NATIVE_BUFFER_ACCESS_NOTIFY(X) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index ce9c18bb22a..53c0a22c574 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -165,11 +165,10 @@ Local ContextifyContext::CreateV8Context( object_template->SetHandler(indexed_config); #if ENABLE_TTD_NODE - // Don't use TT global state -- inherit TT mode from calling script context - Local ctx = NewContext(env->isolate(), - false, object_template); + // Don't use TT global state -- inherit TT mode from calling script context + Local ctx = NewContext(env->isolate(), false, object_template); #else - Local ctx = NewContext(env->isolate(), object_template); + Local ctx = NewContext(env->isolate(), object_template); #endif if (ctx.IsEmpty()) { @@ -339,10 +338,10 @@ void ContextifyContext::PropertySetterCallback( if (ctx->context_.IsEmpty()) return; - // Node-ChakraCore TODO: ChakraShim does not implement ShouldThrowOnError - // correctly. This causes contextify to break in node-chakracore with - // upstream PR 10227. For maintaining compat, using the old incorrect code - // with Node-ChakraCore- we can fix this issue after the merge. + // Node-ChakraCore TODO: ChakraShim does not implement ShouldThrowOnError + // correctly. This causes contextify to break in node-chakracore with + // upstream PR 10227. For maintaining compat, using the old incorrect code + // with Node-ChakraCore- we can fix this issue after the merge. #ifndef NODE_ENGINE_CHAKRACORE auto attributes = PropertyAttribute::None; bool is_declared_on_global_proxy = ctx->global_proxy() diff --git a/src/node_file.cc b/src/node_file.cc index 8f1de5d6351..d1be11c2573 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -411,9 +411,8 @@ void AfterInteger(uv_fs_t* req) { } #endif - if (after.Proceed()) { + if (after.Proceed()) req_wrap->Resolve(Integer::New(req_wrap->env()->isolate(), req->result)); - } } void AfterOpenFileHandle(uv_fs_t* req) { diff --git a/src/node_internals.h b/src/node_internals.h index 7c4f170243e..97e53582577 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -220,7 +220,6 @@ inline v8::Local PersistentToLocal( // Creates a new context with Node.js-specific tweaks. Currently, it removes // the `v8BreakIterator` property from the global `Intl` object if present. // See https://github.com/nodejs/node/issues/14909 for more info. - v8::Local NewContext( v8::Isolate* isolate, #ifdef NODE_ENGINE_CHAKRACORE diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 5c833ee0b2e..f269b32fbef 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -1,8 +1,6 @@ #include "node_internals.h" #include "tracing/agent.h" -#include - namespace node { using v8::Context; diff --git a/src/node_url.h b/src/node_url.h index 2d6936a81a3..6b526d15b07 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -7,7 +7,6 @@ #include "env-inl.h" #include -#include namespace node { namespace url { diff --git a/src/string_bytes.cc b/src/string_bytes.cc index 4be090c7420..1237f3f1455 100644 --- a/src/string_bytes.cc +++ b/src/string_bytes.cc @@ -121,12 +121,12 @@ class ExternString: public ResourceType { ExternString* h_str = new ExternString(isolate, data, length); - // CHAKRA-TODO: Revert this change. Currently chakrashim - // String::NewExternal deletes h_str immediately. Avoid accessing h_str - // after passing it to String::NewExternal. - size_t byte_length = h_str->byte_length(); - MaybeLocal str = NewExternal(isolate, h_str); - isolate->AdjustAmountOfExternalAllocatedMemory(byte_length); + // CHAKRA-TODO: Revert this change. Currently chakrashim + // String::NewExternal deletes h_str immediately. Avoid accessing h_str + // after passing it to String::NewExternal. + size_t byte_length = h_str->byte_length(); + MaybeLocal str = NewExternal(isolate, h_str); + isolate->AdjustAmountOfExternalAllocatedMemory(byte_length); if (str.IsEmpty()) { delete h_str; diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index edf47879715..e8a893fffef 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -29,13 +29,15 @@ expect('--zero-fill-buffers', 'B\n'); expect('--v8-pool-size=10', 'B\n'); expect('--trace-event-categories node', 'B\n'); -if (!common.isWindows) { - expect('--perf-basic-prof', 'B\n'); -} +if (!common.isChakraEngine) { + if (!common.isWindows) { + expect('--perf-basic-prof', 'B\n'); + } -if (common.isLinux && ['arm', 'x64', 'mips'].includes(process.arch)) { - // PerfJitLogger is only implemented in Linux. - expect('--perf-prof', 'B\n'); + if (common.isLinux && ['arm', 'x64', 'mips'].includes(process.arch)) { + // PerfJitLogger is only implemented in Linux. + expect('--perf-prof', 'B\n'); + } } if (common.hasCrypto) {