Merge branch 'master' into roller/chromium/master

This commit is contained in:
John Kleinschmidt 2021-03-15 18:43:25 -04:00
parent 8f4e362d8f
commit 57a8781c01
137 changed files with 876 additions and 4289 deletions

View file

@ -16,7 +16,6 @@ build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.pa
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch
chore_read_nobrowserglobals_from_global_not_process.patch
build_bring_back_node_with_ltcg_configuration.patch
enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
fix_use_crypto_impls_for_compat.patch
fix_comment_out_incompatible_crypto_modules.patch
@ -32,3 +31,4 @@ remove_makeexternal_case_for_uncached_internal_strings.patch
fix_remove_outdated_--experimental-wasm-bigint_flag.patch
fix_crypto_tests_to_run_with_bssl.patch
build_add_mjs_support_to_js2c.patch
src_inline_asynccleanuphookhandle_in_headers.patch

View file

@ -1,51 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Deepak Mohan <hop2deep@gmail.com>
Date: Wed, 16 Oct 2019 13:41:12 -0700
Subject: build: bring back node_with_ltcg configuration
This was moved to code node.gyp as part of https://github.com/nodejs/node/pull/25931
which caused native modules size increase which were depending on
this configuration transitively https://github.com/nodejs/node/issues/29501.
THe fix for this should land in node-gyp as discussed in above issue,
landing this as temporary patch.
diff --git a/common.gypi b/common.gypi
index d37d29736ead82aca6c89cc7625ca4d9a053da32..ffb80656d4a2117b7ee4cd5bd2d7aabfef16122b 100644
--- a/common.gypi
+++ b/common.gypi
@@ -19,7 +19,7 @@
'node_use_v8_platform%': 'true',
'node_use_bundled_v8%': 'true',
'node_module_version%': '',
- 'node_with_ltcg%': '',
+ 'node_with_ltcg%': 'true',
'node_shared_openssl%': 'false',
'node_tag%': '',
@@ -232,6 +232,26 @@
'cflags': [ '-fPIC' ],
'ldflags': [ '-fPIC' ]
}],
+ ['node_with_ltcg=="true"', {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for LTCG
+ },
+ 'VCLibrarianTool': {
+ 'AdditionalOptions': [
+ '/LTCG:INCREMENTAL', # incremental link-time code generation
+ ]
+ },
+ 'VCLinkerTool': {
+ 'OptimizeReferences': 2, # /OPT:REF
+ 'EnableCOMDATFolding': 2, # /OPT:ICF
+ 'LinkIncremental': 1, # disable incremental linking
+ 'AdditionalOptions': [
+ '/LTCG:INCREMENTAL', # incremental link-time code generation
+ ]
+ }
+ }
+ }]
],
'msvs_settings': {
'VCCLCompilerTool': {

View file

@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid
out in memory on 64-bit machines, and will summarily fail to work.
diff --git a/common.gypi b/common.gypi
index ffb80656d4a2117b7ee4cd5bd2d7aabfef16122b..2f6e8fbb302d133631acd33e90dd1b6661364b32 100644
index d37d29736ead82aca6c89cc7625ca4d9a053da32..b6aa3c0504fd108ada368d30f3021d1c171a4879 100644
--- a/common.gypi
+++ b/common.gypi
@@ -64,7 +64,7 @@

View file

@ -6,7 +6,7 @@ Subject: fix: add v8_enable_reverse_jsargs defines in common.gypi
This can be removed once node upgrades V8 and inevitably has to do this exact same thing. Also hi node people if you are looking at this.
diff --git a/common.gypi b/common.gypi
index 2f6e8fbb302d133631acd33e90dd1b6661364b32..1f05305dee3fe5558d41765b5fac4ccfdd843eb5 100644
index b6aa3c0504fd108ada368d30f3021d1c171a4879..9a2552ab3c1ba44b57b2d3b1ddf2becaa32ebbda 100644
--- a/common.gypi
+++ b/common.gypi
@@ -65,6 +65,7 @@
@ -25,7 +25,7 @@ index 2f6e8fbb302d133631acd33e90dd1b6661364b32..1f05305dee3fe5558d41765b5fac4ccf
##### end V8 defaults #####
# When building native modules using 'npm install' with the system npm,
@@ -392,6 +394,9 @@
@@ -372,6 +374,9 @@
['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
}],

View file

@ -0,0 +1,73 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Ang-Wanek <tylerw@axosoft.com>
Date: Tue, 19 Jan 2021 07:39:14 -0700
Subject: src: inline AsyncCleanupHookHandle in headers
Fixes: https://github.com/nodejs/node/issues/36349
PR-URL: https://github.com/nodejs/node/pull/37000
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
diff --git a/src/api/hooks.cc b/src/api/hooks.cc
index a719a861dbe9d8d9ca67c3bb5920b14b0df16d83..8f191aad7e2dcfbedddeaeb88f47ed721ef51cf1 100644
--- a/src/api/hooks.cc
+++ b/src/api/hooks.cc
@@ -133,7 +133,7 @@ static void RunAsyncCleanupHook(void* arg) {
info->fun(info->arg, FinishAsyncCleanupHook, info);
}
-AsyncCleanupHookHandle AddEnvironmentCleanupHook(
+ACHHandle* AddEnvironmentCleanupHookInternal(
Isolate* isolate,
AsyncCleanupHook fun,
void* arg) {
@@ -145,11 +145,11 @@ AsyncCleanupHookHandle AddEnvironmentCleanupHook(
info->arg = arg;
info->self = info;
env->AddCleanupHook(RunAsyncCleanupHook, info.get());
- return AsyncCleanupHookHandle(new ACHHandle { info });
+ return new ACHHandle { info };
}
-void RemoveEnvironmentCleanupHook(
- AsyncCleanupHookHandle handle) {
+void RemoveEnvironmentCleanupHookInternal(
+ ACHHandle* handle) {
if (handle->info->started) return;
handle->info->self.reset();
handle->info->env->RemoveCleanupHook(RunAsyncCleanupHook, handle->info.get());
diff --git a/src/node.h b/src/node.h
index f150725b54ee1315476d202797963369490d5152..7ab2ed9345c83cb4c1f51c0cc3050abc6571e3fa 100644
--- a/src/node.h
+++ b/src/node.h
@@ -905,12 +905,26 @@ struct ACHHandle;
struct NODE_EXTERN DeleteACHHandle { void operator()(ACHHandle*) const; };
typedef std::unique_ptr<ACHHandle, DeleteACHHandle> AsyncCleanupHookHandle;
-NODE_EXTERN AsyncCleanupHookHandle AddEnvironmentCleanupHook(
+/* This function is not intended to be used externally, it exists to aid in
+ * keeping ABI compatibility between Node and Electron. */
+NODE_EXTERN ACHHandle* AddEnvironmentCleanupHookInternal(
v8::Isolate* isolate,
void (*fun)(void* arg, void (*cb)(void*), void* cbarg),
void* arg);
+inline AsyncCleanupHookHandle AddEnvironmentCleanupHook(
+ v8::Isolate* isolate,
+ void (*fun)(void* arg, void (*cb)(void*), void* cbarg),
+ void* arg) {
+ return AsyncCleanupHookHandle(AddEnvironmentCleanupHookInternal(isolate, fun,
+ arg));
+}
-NODE_EXTERN void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder);
+/* This function is not intended to be used externally, it exists to aid in
+ * keeping ABI compatibility between Node and Electron. */
+NODE_EXTERN void RemoveEnvironmentCleanupHookInternal(ACHHandle* holder);
+inline void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder) {
+ RemoveEnvironmentCleanupHookInternal(holder.get());
+}
/* Returns the id of the current execution context. If the return value is
* zero then no execution has been set. This will happen if the user handles