From 3178dbda1513c0fa0dea1afae46fda4577920161 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 13 May 2021 19:52:42 +0800 Subject: [PATCH] patches: update for 14.17.0 --- ...16.1.cpp.patch => node.v14.17.0.cpp.patch} | 184 ++++-------------- patches/patches.json | 2 +- 2 files changed, 44 insertions(+), 142 deletions(-) rename patches/{node.v14.16.1.cpp.patch => node.v14.17.0.cpp.patch} (81%) diff --git a/patches/node.v14.16.1.cpp.patch b/patches/node.v14.17.0.cpp.patch similarity index 81% rename from patches/node.v14.16.1.cpp.patch rename to patches/node.v14.17.0.cpp.patch index 2a89c815..88ed5b8a 100644 --- a/patches/node.v14.16.1.cpp.patch +++ b/patches/node.v14.17.0.cpp.patch @@ -1,8 +1,17 @@ +--- node/common.gypi ++++ node/common.gypi +@@ -164,7 +164,7 @@ + 'v8_enable_handle_zapping': 0, + 'pgo_generate': ' -fprofile-generate ', + 'pgo_use': ' -fprofile-use -fprofile-correction ', +- 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', ++ 'lto': ' -flto=4 -ffat-lto-objects ', + 'conditions': [ + ['node_shared != "true"', { + 'MSVC_runtimeType': 0 # MultiThreaded (/MT) --- node/deps/v8/include/v8.h +++ node/deps/v8/include/v8.h -@@ -9525,10 +9525,14 @@ - */ - static void SetFlagsFromCommandLine(int* argc, +@@ -9633,6 +9633,10 @@ class V8_EXPORT V8 { char** argv, bool remove_flags); @@ -13,13 +22,9 @@ /** Get the version string. */ static const char* GetVersion(); - /** - * Initializes V8. This function needs to be called before the first Isolate --- node/deps/v8/src/api/api.cc +++ node/deps/v8/src/api/api.cc -@@ -927,10 +927,38 @@ - - void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) { +@@ -840,6 +840,34 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) { i::FlagList::SetFlagsFromCommandLine(argc, argv, remove_flags); } @@ -54,13 +59,9 @@ RegisteredExtension* RegisteredExtension::first_extension_ = nullptr; RegisteredExtension::RegisteredExtension(std::unique_ptr extension) - : extension_(std::move(extension)) {} - --- node/deps/v8/src/codegen/compiler.cc +++ node/deps/v8/src/codegen/compiler.cc -@@ -2045,11 +2045,11 @@ - // First check per-isolate compilation cache. - maybe_result = compilation_cache->LookupScript( +@@ -2365,7 +2365,7 @@ MaybeHandle Compiler::GetSharedFunctionInfoForScript( source, script_details.name_obj, script_details.line_offset, script_details.column_offset, origin_options, isolate->native_context(), language_mode); @@ -69,13 +70,9 @@ compile_timer.set_hit_isolate_cache(); } else if (can_consume_code_cache) { compile_timer.set_consuming_code_cache(); - // Then check cached code provided by embedder. - HistogramTimerScope timer(isolate->counters()->compile_deserialize()); --- node/deps/v8/src/objects/js-objects.cc +++ node/deps/v8/src/objects/js-objects.cc -@@ -5524,10 +5524,13 @@ - - // Check if we should print {function} as a class. +@@ -5514,6 +5514,9 @@ Handle JSFunction::ToString(Handle function) { Handle maybe_class_positions = JSReceiver::GetDataProperty( function, isolate->factory()->class_positions_symbol()); if (maybe_class_positions->IsClassPositions()) { @@ -85,13 +82,9 @@ ClassPositions class_positions = ClassPositions::cast(*maybe_class_positions); int start_position = class_positions.start(); - int end_position = class_positions.end(); - Handle script_source( --- node/deps/v8/src/objects/shared-function-info-inl.h +++ node/deps/v8/src/objects/shared-function-info-inl.h -@@ -493,10 +493,18 @@ - // check if it is old. Note, this is done this way since this function can be - // called by the concurrent marker. +@@ -505,6 +505,14 @@ bool SharedFunctionInfo::ShouldFlushBytecode(BytecodeFlushMode mode) { Object data = function_data(); if (!data.IsBytecodeArray()) return false; @@ -106,11 +99,9 @@ if (mode == BytecodeFlushMode::kStressFlushBytecode) return true; BytecodeArray bytecode = BytecodeArray::cast(data); - - return bytecode.IsOld(); --- node/deps/v8/src/parsing/parsing.cc +++ node/deps/v8/src/parsing/parsing.cc -@@ -42,6 +42,7 @@ +@@ -42,6 +42,7 @@ bool ParseProgram(ParseInfo* info, Handle