v12.1.0 proposal by targos · Pull Request #27440 · nodejs/node

@joyeecheung @targos

Allows instantiating a NodeMainInstance with an isolate
whose initialization and disposal are controlled by the caller.

PR-URL: #27321
Refs: #17058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

@joyeecheung @targos

This patch allows serializing per-isolate data into an isolate
snapshot and deserializing them from an isolate snapthot.

PR-URL: #27321
Refs: #17058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

@joyeecheung @targos

Implements a node_mksnapshot target that generates a snapshot blob
from a Node.js main instance's isolate, and serializes the data blob
with other additional data into a C++ file that can be embedded into
the Node.js binary.

PR-URL: #27321
Refs: #17058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

@joyeecheung @targos

Enable serializing the isolate from an isolate snapshot generated
by node_mksnapshot with per-isolate data.

PR-URL: #27321
Refs: #17058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

@joyeecheung @targos

At build time, snapshot the context after running per-context scripts
in the main instance, and in the final build, deserialize the
context in the main instance.

This provides a ~5% in the misc/startup benchmark when the instance
is launched within a process that runs test/fixtures/semicolon.js.

PR-URL: #27321
Refs: #17058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

@joyeecheung @targos

PR-URL: #27321
Refs: #17058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

@Trott @targos

Split one very long sentence into three shorter sentences.

PR-URL: #27348
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

@ryzokuken @targos

Update tools/license-builder.sh in order to work normally after jinja2
and markupsafe were moved from tools/ to tools/inspector_protocol/ in
an earlier commit.

Refs: #25614

PR-URL: #27362
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>

@joyeecheung @targos

This currently breaks `test/pummel/test-hash-seed.js`

PR-URL: #27365
Refs: #27321
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>

@BethGriggs @targos

PR-URL: #27368
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>

@Trott @targos

The internal HTTParser `reinitialize()` function was removed in
ece5073 and replaced with an `initialize()` function. This broke
benchmark/http/bench-parser.js. This change updates the benchmark so
that it runs again.

PR-URL: #27359
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>

@Trott @targos

Add a test for the only uncovered code in lib/internal/dns/promises.js.

PR-URL: #27330
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@targos

The function 'isConnected' is directly called by many 'Socket' instance,
so we shouldn't directly use 'this' because 'this' will be the self of
function itself, and we should use 'self' as the instance of 'Socket'
function.

PR-URL: #27338
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>

@Trott @targos

test-worker-esm-missing-main failed in CI recently in a way that
suggests that maybe the `does-not-exist.js` file did in fact exist.
Maybe that isn't what happened at all, but let's rule it out by changing
the use of `does-not-exist.js` from a file expected to be missing from
the current working directory to a file in the temp directory, which the
test will remove and recreate at the outset.

PR-URL: #27340
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>

@targos

Fix tests whether errors are thrown correctly
because they are successful when error doesn't get thrown.

PR-URL: #27333
Fixes: #26385
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

@bnoordhuis @targos

Call `v8::Platform::ShutdownPlatform()` to fix a Coverity warning about
the `v8::Platform` instance being deleted when it's still in use.

PR-URL: #27332
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

@sam-github @targos

This is a continuing source of confusion, attempt to make it even more
clear.

Fixes: #24923

PR-URL: #27282
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>

@gengjiawen @targos

PR-URL: #27264
Reviewed-By: Refael Ackermann <refack@gmail.com>

@addaleax @targos

This can be necessary for being able to call the function when no
JS Context is on the stack, e.g. during GC.

Refs: #27218

PR-URL: #27255
Fixes: #27218
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@addaleax @targos

Allow the function to be called during GC, which is a common use case.

Fixes: #27218

PR-URL: #27255
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@addaleax @targos

Allow the destructor to be called during GC,
which is a common use case.

PR-URL: #27255
Fixes: #27218
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@BridgeAR @targos

This fixes a pull request number in `repl.md`.

PR-URL: #27336
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>

@joyeecheung @targos

Instead of using the public AssertionError, use a simplified
error that describes potential causes of these assertions
and suggests the user to open an issue.

PR-URL: #26635
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

@joyeecheung @targos

Since the bootstrap does not actually use ESM at all, there
is no need to create this map so early. This patch moves
the initialization of the map to pre-execution,
so that the only binding loaded in loaders is native_module.
In addition, switch to SafeWeakMap.

PR-URL: #27323
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

@BridgeAR @targos

Only special handle `Symbol.toStringTag` if the property is not
enumerable or not the own property of the inspected object.

PR-URL: #27342
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

@BridgeAR @targos

The function is actually a getter, not a setter.

PR-URL: #27342
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

@sam-github @targos

Let .end() propogate from client, to server, and back, before
considering the test complete. Also, remove the test vector and exit
handling in favour of running all the tests in parallel and using
common.must/mustNotCall().

PR-URL: #27300
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

@ryzokuken @targos

Update the version of the bundled ICU (deps/icu-small) to ICU version
64.2 (Unicode 12, CLDR 35)

Fixes: #26388

PR-URL: #27361
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@ryzokuken @targos

Update the LICENSE file and tools/icu/current_ver.dep file in order to
finalize the upgrade to ICU 64.2

PR-URL: #27361
Fixes: #26388
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

@sam-github @targos