summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* deps: update undici to 5.22.1Node.js GitHub Bot2023-05-161-1/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/47994 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
* doc: fix typo in binding functionsDeokjin Kim2023-05-161-1/+1
| | | | | | | | | | According to usage(node::util::RegisterExternalReferences) of below line, namespace has to be `util`(not `utils`). PR-URL: https://github.com/nodejs/node/pull/48003 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* permission: remove unused function declarationDeokjin Kim2023-05-151-3/+0
| | | | | | | | | | | | RestrictAccess() is declared, but it's not used. PR-URL: https://github.com/nodejs/node/pull/47957 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe>
* src: deduplicate X509Certificate::Fingerprint*Tobias Nießen2023-05-152-36/+18
| | | | | | | | | All three functions do the same, except using different cryptographic hash functions. Move the common logic into a new template and use it directly. PR-URL: https://github.com/nodejs/node/pull/47978 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
* vm: fix crash when setting __proto__ on context's globalThisFeng Yu2023-05-151-1/+2
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/47939 Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* src: stop copying code cache, part 2Keyhan Vakil2023-05-153-51/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes more copies of the code cache data. First: for the builtin snapshot, we were copying the code cache to create a `std::vector<uint8_t>`. This was slowing down static intialization. Change it to use a good old `uint8_t*` and `size_t` rather than a vector. For the case of embedder provided snapshots, we also add an `owning_ptr` so that we can properly cleanup owned values created from the snapshot. Second: whenever the code cache was hit, we would remove the bytecode from the code cache, and then reserialize it from the compiled function. This was pretty slow. Change the code so that we can reuse the same code cache multiple times. If the code cache is rejected (say, because the user added V8 options), then we need to generate the bytecode, in which case we again use `owning_ptr` to ensure that the underlying code cache is freed. Combined, these changes improve the misc/startup.js benchmarks significantly (p < 0.001): * process,benchmark/fixtures/require-builtins: 22.15% * process,test/fixtures/semicolon: 8.55% * worker,benchmark/fixtures/require-builtins: 26.52% * worker,test/fixtures/semicolon: 21.52% PR-URL: https://github.com/nodejs/node/pull/47958 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
* src: add cjs_module_lexer_version base64_versionJithil P Ponnan2023-05-144-2/+20
| | | | | | | | | src: add cjs_module_lexer_version base64_version PR-URL: https://github.com/nodejs/node/pull/45629 Refs: https://github.com/nodejs/node/issues/45260 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* src: move BlobSerializerDeserializer to a separate header fileDarshan Sen2023-05-113-332/+488
| | | | | | | | | | | | | | | This should make it possible to reuse the BlobSerializer and the BlobDeserializer classes in SEAs to generate and parse the injected blob. This change also resolves this TODO: https://github.com/nodejs/node/blob/4f69aae6a04a460f267005dcf6551959064b3238/src/node_snapshotable.cc#L187 Refs: https://github.com/nodejs/node/pull/47458 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/47933 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* dns: call `ada::idna::to_ascii` directly from c++Yagiz Nizipli2023-05-101-11/+14
| | | | | | PR-URL: https://github.com/nodejs/node/pull/47920 Fixes: https://github.com/nodejs/performance/issues/77 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: rename SKIP_CHECK_SIZE to SKIP_CHECK_STRLENTobias Nießen2023-05-101-4/+4
| | | | | | | | | | | | | SKIP_CHECK_VALUE is a string literal, so its size is the length of the string in chars plus one. The buffer buf is also always null-terminated, so its size should match the size of SKIP_CHECK_VALUE, which is _not_ SKIP_CHECK_SIZE. Rename SKIP_CHECK_SIZE to be consistent with C/C++ terminology. PR-URL: https://github.com/nodejs/node/pull/47845 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
* src: register external references for source codeKeyhan Vakil2023-05-105-103/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we use external strings for internalized builtin source code. However when a snapshot is taken, any external string whose resource is not registered is flattened into a SeqString (see ref). The result is that module source code stored in the snapshot does not use external strings after deserialization. This patch registers an external string resource for each internalized builtin's source. The savings are substantial: ~1.9 MB of heap memory per isolate, or ~44% of an otherwise empty isolate's heap usage: ```console $ node --expose-gc -p 'gc(),process.memoryUsage().heapUsed' 4190968 $ ./node --expose-gc -p 'gc(),process.memoryUsage().heapUsed' 2327536 ``` The savings can be even higher for user snapshots which may include more internal modules. The existing UnionBytes implementation was ill-suited, because it only created an external string resource when ToStringChecked was called, but we need to register the external string resources before the isolate even exists. We change UnionBytes to no longer own the data, and shift ownership of the data to a new external resource class called StaticExternalByteResource. StaticExternalByteResource are either statically allocated (for internalized builtin code) or owned by the static `externalized_builtin_sources` map, so they will only be destructed when static resources are destructed. We change JS2C to emit statements to register a string resource for each internalized builtin. Refs: https://github.com/v8/v8/blob/d2c8fbe9ccd1a6ce5591bb7dd319c3c00d6bf489/src/snapshot/serializer.cc#L633 PR-URL: https://github.com/nodejs/node/pull/47055 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
* src: support V8 experimental shared values in messagingShu-yu Guo2023-05-092-4/+31
| | | | | PR-URL: https://github.com/nodejs/node/pull/47706 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* quic: fix typo in endpoint.hTobias Nießen2023-05-081-1/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/47911 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
* src: register ext reference for Fingerprint512Tobias Nießen2023-05-081-0/+1
| | | | | | | | | Refs: https://github.com/nodejs/node/pull/39809 Refs: https://github.com/nodejs/node/pull/40239 PR-URL: https://github.com/nodejs/node/pull/47892 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* dgram: convert macro to templateTobias Nießen2023-05-082-33/+30
| | | | | | | | It's not pretty either way, but a template is still preferable over a macro. PR-URL: https://github.com/nodejs/node/pull/47891 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* src: stop copying code cacheKeyhan Vakil2023-05-072-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code cache is quite large - around 1.3 MiB. Change the code to use non-owning buffers to avoid copying it. For starting up an otherwise empty main isolate, this saves around 1.3 MiB of unique set size memory (9.9 MiB -> 8.6 MiB) and 1.1ms elapsed time (22.9 ms -> 21.8 ms). Copying the code cache is unnecessary since: 1. for the builtin snapshot, the code cache data has static lifetime. 2. for non-builtin snapshots, we create copies of the code cache data in `SnapshotDeserializer::ReadVector`. These copies are owned by the `Environment` (through `IsolateData` -> `SnapshotData`), so they won't be deallocated. 3. a worker thread can copy a parent's isolate's code cache, but in that case we still know that the parent isolate will outlive the worker isolate. (Admittedly point (2) feels a little fragile from a lifetime perspective, and I would be happy to restrict this optimization to the builtin snapshot.) ```console $ perf stat -r 100 -e ... ./node -e 0 Performance counter stats for './node -e 0' (100 runs): 21.78 msec task-clock 2760 page-faults 113161604 instructions 18437648 branches 423230 branch-misses 853093 cache-references 41474 cache-misses 0.0225473 +- 0.0000504 seconds time elapsed ( +- 0.22% ) $ perf stat -r 100 -e ... ./node-main -e 0 Performance counter stats for './node-main -e 0' (100 runs): 22.91 msec task-clock 3102 page-faults 114890673 instructions 18751329 branches 428909 branch-misses 895721 cache-references 45202 cache-misses 0.0233760 +- 0.0000741 seconds time elapsed ( +- 0.32% ) ``` PR-URL: https://github.com/nodejs/node/pull/47144 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
* src: clarify the parameter name in `Permission::Apply`Daeyeon Jeong2023-05-077-7/+7
| | | | | | | | | This fixes confusing parameter names. They are references to set allow-permission. Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com> PR-URL: https://github.com/nodejs/node/pull/47874 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
* node-api: get Node API version used by addonVladimir Morozov2023-05-0510-44/+159
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/45715 Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
* http2: improve nghttp2 error callbackTobias Nießen2023-05-052-12/+8
| | | | | | | | | | | | | | | The http2 implementation uses the deprecated function nghttp2_session_callbacks_set_error_callback, which does not supply an error code but only an error message. This so far forced node's error callback to rely on the error message in order to distinguish between different errors, which is fragile and inefficient. Use the newer nghttp2_session_callbacks_set_error_callback2 function instead, which is not deprecated and which provides the exact error code to node's error callback. PR-URL: https://github.com/nodejs/node/pull/47840 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
* src: throw DataCloneError on transfering untransferable objectsChengzhong Wu2023-05-052-6/+14
| | | | | | | | | | | | The HTML StructuredSerializeWithTransfer algorithm defines that when an untransferable object is in the transfer list, a DataCloneError is thrown. An array buffer that is already transferred is also considered as untransferable. PR-URL: https://github.com/nodejs/node/pull/47604 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* src: fix creating an ArrayBuffer from a Blob created with `openAsBlob`Daeyeon Jeong2023-05-041-2/+2
| | | | | | | Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com> PR-URL: https://github.com/nodejs/node/pull/47691 Fixes: https://github.com/nodejs/node/issues/47683 Reviewed-By: James M Snell <jasnell@gmail.com>
* src: avoid strcmp() with Utf8ValueTobias Nießen2023-05-044-8/+5
| | | | | | | | | | | | Having Utf8Value::operator==() without operator!=() is awkward in C++17, so add the negated equality operator. Then, use either instead of strcmp() where appropriate. PR-URL: https://github.com/nodejs/node/pull/47827 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
* quic: address recent coverity warningMichael Dawson2023-05-041-1/+1
| | | | | | | | | | Address coverity warning about uninitialized value Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/47753 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* src: get binding data store directly from the realmJoyee Cheung2023-05-041-6/+6
| | | | | | | | | | | We now store the binding data store in the realm and invoke `Realm::AddBindingData` to add the binding data, so there is no need to get a reference to the binding data store from the context now, we can just get the reference from the realm. PR-URL: https://github.com/nodejs/node/pull/47437 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* sea: add option to disable the experimental SEA warningDarshan Sen2023-05-043-18/+114
| | | | | | | | | | Refs: https://github.com/nodejs/single-executable/discussions/60 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/47588 Fixes: https://github.com/nodejs/node/issues/47741 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* worker: use snapshot in workers spawned by workersJoyee Cheung2023-05-041-4/+12
| | | | | | | | | | | Previously we didn't pass the snapshot data down to the isolate data of workers so workers spawned by workers won't use the snapshot. Fixes it by passing the snapshot data down. PR-URL: https://github.com/nodejs/node/pull/47731 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
* src: prefer data accessor of string and vectorMohammed Keyvanzadeh2023-05-037-10/+11
| | | | | | | | | | | | | | | | | The pattern of getting the address of the element at index 0 of a container is generally used to materialize a pointer to the backing data of a container, however `std::string` and `std::vector` provide a `data()` accessor to retrieve the data pointer which should be preferred. This also ensures that in the case that the container is empty, the data pointer access does not perform an errant memory access. PR-URL: https://github.com/nodejs/node/pull/47750 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* bootstrap: initialize per-isolate properties of bindings separatelyJoyee Cheung2023-05-0322-289/+384
| | | | | | | | | | | | | | This patch moves the initialization of per-isolate properties of the bindings that are in the embedded snapshot separate from the initialization of their per-context properties. This is necessary for workers to share the isolate snapshot with the main thread and deserialize these properties instead of creating them from scratch. PR-URL: https://github.com/nodejs/node/pull/47768 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
* fs: move fs_use_promises_symbol to per-isolate symbolsJoyee Cheung2023-05-033-11/+12
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/47768 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
* bootstrap: log isolate data info in mksnapshot debug logsJoyee Cheung2023-05-031-2/+2
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/47768 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
* src: add per-isolate SetFastMethod and Set[Fast]MethodNoSideEffectJoyee Cheung2023-05-032-0/+69
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/47768 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
* url: reduce revokeObjectURL cpp callsYagiz Nizipli2023-04-302-8/+24
| | | | | PR-URL: https://github.com/nodejs/node/pull/47728 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
* test_runner: fix --require with --experimental-loaderMoshe Atlow2023-04-291-0/+3
| | | | | | PR-URL: https://github.com/nodejs/node/pull/47751 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* src: avoid copying string in fs_permissionYagiz Nizipli2023-04-292-2/+2
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/47746 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
* src: replace idna functions with ada::idnaYagiz Nizipli2023-04-282-0/+30
| | | | | | Co-authored-by: Daniel Lemire <daniel@lemire.me> PR-URL: https://github.com/nodejs/node/pull/47735 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
* test_runner: support combining coverage reportscjihrig2023-04-281-7/+0
| | | | | | | | | | This commit adds support for combining code coverage reports in the test runner. This allows coverage to be collected for child processes, and by extension, the test runner CLI. PR-URL: https://github.com/nodejs/node/pull/47686 Fixes: https://github.com/nodejs/node/issues/47669 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: fix typo in comment in quic/sessionticket.ccTobias Nießen2023-04-281-1/+1
| | | | | PR-URL: https://github.com/nodejs/node/pull/47754 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
* src: mark fatal error functions as noreturnChengzhong Wu2023-04-277-20/+14
| | | | | | | | | | | | OnFatalError and OOMErrorHandler will not return control flow to the calling function. node::FatalError is an alias of node::OnFatalError. Replace all the callsites with node::OnFatalError instead. PR-URL: https://github.com/nodejs/node/pull/47695 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
* quic: add additional QUIC implementationJames M Snell2023-04-2610-14/+2002
| | | | | | | | Adds most of the Endpoint implementation with a few tweaks to other bits. PR-URL: https://github.com/nodejs/node/pull/47603 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* src: split BlobSerializer/BlobDeserializerJoyee Cheung2023-04-262-100/+169
| | | | | | | | | | | | This patch splits BlobSerializer and BlobDeserializer out of SnapshotSerializer and SnapshotDeserializer. The child classes can implement serialization methods for custom types on top of BlobSerializer/BlobDeserializer for conversions between native types and binary blobs. This allows us to reuse the classes for other cases (e.g. SEA blobs). PR-URL: https://github.com/nodejs/node/pull/47458 Reviewed-By: Darshan Sen <raisinten@gmail.com>
* src: prevent changing FunctionTemplateInfo after publishShelley Vohr2023-04-252-3/+8
| | | | | | | | | | | | | | Refs https://chromium-review.googlesource.com/c/v8/v8/+/2718147 Fixes an issue where Node.js tries to call SetClassName on a FunctionTemplate twice in some cases. The above CL made it so that V8 CHECKs when this occurs. It is fixed by ensuring SetClassName is only called once. PR-URL: https://github.com/nodejs/node/pull/46979 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* deps: update undici to 5.22.0Node.js GitHub Bot2023-04-251-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/47679 Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
* deps: update ada to 2.2.0Node.js GitHub Bot2023-04-251-3/+3
| | | | | PR-URL: https://github.com/nodejs/node/pull/47678 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* crypto: update root certificates to NSS 3.89Node.js GitHub Bot2023-04-231-83/+0
| | | | | | | | | | | | | | | | | | | | This is the certdata.txt[0] from NSS 3.89, released on 2023-03-09. This is the version of NSS that shipped in Firefox 112 on 2023-04-11. Certificates removed: - Network Solutions Certificate Authority - EC-ACC - Staat der Nederlanden EV Root CA [0] https://hg.mozilla.org/projects/nss/raw-file/NSS_3_89_RTM/lib/ckfw/builtins/certdata.txt PR-URL: https://github.com/nodejs/node/pull/47659 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
* src: add v8 fast api for url canParseKhafra2023-04-203-3/+29
| | | | | PR-URL: https://github.com/nodejs/node/pull/47552 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
* src: make AliasedBuffers in the binding data weakJoyee Cheung2023-04-2010-89/+213
| | | | | | | | | | | | | | The binding data holds references to the AliasedBuffers directly from their wrappers which already ensures that the AliasedBuffers won't be accessed when the wrappers are GC'ed. So we can just make the global references to the AliasedBuffers weak. This way we can simply deserialize the typed arrays when deserialize the binding data and avoid the extra Object::Set() calls. It also eliminates the caveat in the JS land where aliased buffers must be dynamically read from the binding. PR-URL: https://github.com/nodejs/node/pull/47354 Refs: https://github.com/nodejs/node/issues/47353 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
* 2023-04-18, Version 20.0.0 (Current)RafaelGSS2023-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable Changes: crypto: * (SEMVER-MAJOR) use WebIDL converters in WebCryptoAPI (Filip Skokan) https://github.com/nodejs/node/pull/46067 deps: * update ada to 2.0.0 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/47339 esm: * move hook execution to separate thread (Jacob Smith) https://github.com/nodejs/node/pull/44710 sea: * use JSON configuration and blob content for SEA (Joyee Cheung) https://github.com/nodejs/node/pull/47125 src,process: * (SEMVER-MINOR) add permission model (Rafael Gonzaga) https://github.com/nodejs/node/pull/44004 url: * drop ICU requirement for parsing hostnames (Yagiz Nizipli) https://github.com/nodejs/node/pull/47339 * use ada::url_aggregator for parsing urls (Yagiz Nizipli) https://github.com/nodejs/node/pull/47339 * (SEMVER-MAJOR) runtime-deprecate url.parse() with invalid ports (Rich Trott) https://github.com/nodejs/node/pull/45526 Semver-Major Commits: * [9fafb0a090] - (SEMVER-MAJOR) async_hooks: deprecate the AsyncResource.bind asyncResource property (James M Snell) https://github.com/nodejs/node/pull/46432 * [1948d37595] - (SEMVER-MAJOR) buffer: check INSPECT_MAX_BYTES with validateNumber (Umuoy) https://github.com/nodejs/node/pull/46599 * [7bc0e6a4e7] - (SEMVER-MAJOR) buffer: graduate File from experimental and expose as global (Khafra) https://github.com/nodejs/node/pull/47153 * [671ffd7825] - (SEMVER-MAJOR) buffer: use min/max of `validateNumber` (Deokjin Kim) https://github.com/nodejs/node/pull/45796 * [ab1614d280] - (SEMVER-MAJOR) build: reset embedder string to "-node.0" (Michaël Zasso) https://github.com/nodejs/node/pull/47251 * [c1bcdbcf79] - (SEMVER-MAJOR) build: warn for gcc versions earlier than 10.1 (Richard Lau) https://github.com/nodejs/node/pull/46806 * [649f68fc1e] - (SEMVER-MAJOR) build: reset embedder string to "-node.0" (Yagiz Nizipli) https://github.com/nodejs/node/pull/45579 * [9374700d7a] - (SEMVER-MAJOR) crypto: remove DEFAULT_ENCODING (Tobias Nießen) https://github.com/nodejs/node/pull/47182 * [1640aeb680] - (SEMVER-MAJOR) crypto: remove obsolete SSL_OP_* constants (Tobias Nießen) https://github.com/nodejs/node/pull/47073 * [c2e4b1fa9a] - (SEMVER-MAJOR) crypto: remove ALPN_ENABLED (Tobias Nießen) https://github.com/nodejs/node/pull/47028 * [3ef38c4bd7] - (SEMVER-MAJOR) crypto: use WebIDL converters in WebCryptoAPI (Filip Skokan) https://github.com/nodejs/node/pull/46067 * [08af023b1f] - (SEMVER-MAJOR) crypto: runtime deprecate replaced rsa-pss keygen parameters (Filip Skokan) https://github.com/nodejs/node/pull/45653 * [7eb0ac3cb6] - (SEMVER-MAJOR) deps: patch V8 to support compilation on win-arm64 (Michaël Zasso) https://github.com/nodejs/node/pull/47251 * [a7c129f286] - (SEMVER-MAJOR) deps: silence irrelevant V8 warning (Michaël Zasso) https://github.com/nodejs/node/pull/47251 * [6f5655a18e] - (SEMVER-MAJOR) deps: always define V8_EXPORT_PRIVATE as no-op (Michaël Zasso) https://github.com/nodejs/node/pull/47251 * [f226350fcb] - (SEMVER-MAJOR) deps: update V8 to 11.3.244.4 (Michaël Zasso) https://github.com/nodejs/node/pull/47251 * [d6dae7420e] - (SEMVER-MAJOR) deps: V8: cherry-pick f1c888e7093e (Michaël Zasso) https://github.com/nodejs/node/pull/45579 * [56c436533e] - (SEMVER-MAJOR) deps: fix V8 build on Windows with MSVC (Michaël Zasso) https://github.com/nodejs/node/pull/45579 * [51ab98c71b] - (SEMVER-MAJOR) deps: silence irrelevant V8 warning (Michaël Zasso) https://github.com/nodejs/node/pull/45579 * [9f84d3eea8] - (SEMVER-MAJOR) deps: V8: fix v8-cppgc.h for MSVC (Jiawen Geng) https://github.com/nodejs/node/pull/45579 * [f2318cd4b5] - (SEMVER-MAJOR) deps: fix V8 build issue with inline methods (Jiawen Geng) https://github.com/nodejs/node/pull/45579 * [16e03e7968] - (SEMVER-MAJOR) deps: update V8 to 10.9.194.4 (Yagiz Nizipli) https://github.com/nodejs/node/pull/45579 * [6473f5e7f7] - (SEMVER-MAJOR) doc: update toolchains used for Node.js 20 releases (Richard Lau) https://github.com/nodejs/node/pull/47352 * [cc18fd9608] - (SEMVER-MAJOR) events: refactor to use `validateNumber` (Deokjin Kim) https://github.com/nodejs/node/pull/45770 * [ff92b40ffc] - (SEMVER-MAJOR) http: close the connection after sending a body without declared length (Tim Perry) https://github.com/nodejs/node/pull/46333 * [2a29df6464] - (SEMVER-MAJOR) http: keep HTTP/1.1 conns alive even if the Connection header is removed (Tim Perry) https://github.com/nodejs/node/pull/46331 * [391dc74a10] - (SEMVER-MAJOR) http: throw error if options of http.Server is array (Deokjin Kim) https://github.com/nodejs/node/pull/46283 * [ed3604cd64] - (SEMVER-MAJOR) http: server check Host header, to meet RFC 7230 5.4 requirement (wwwzbwcom) https://github.com/nodejs/node/pull/45597 * [88d71dc301] - (SEMVER-MAJOR) lib: refactor to use min/max of `validateNumber` (Deokjin Kim) https://github.com/nodejs/node/pull/45772 * [e4d641f02a] - (SEMVER-MAJOR) lib: refactor to use validators in http2 (Debadree Chatterjee) https://github.com/nodejs/node/pull/46174 * [0f3e531096] - (SEMVER-MAJOR) lib: performance improvement on readline async iterator (Thiago Oliveira Santos) https://github.com/nodejs/node/pull/41276 * [5b5898ac86] - (SEMVER-MAJOR) lib,src: update exit codes as per todos (Debadree Chatterjee) https://github.com/nodejs/node/pull/45841 * [55321bafd1] - (SEMVER-MAJOR) net: enable autoSelectFamily by default (Paolo Insogna) https://github.com/nodejs/node/pull/46790 * [2d0d99733b] - (SEMVER-MAJOR) process: remove `process.exit()`, `process.exitCode` coercion to integer (Daeyeon Jeong) https://github.com/nodejs/node/pull/43716 * [dc06df31b6] - (SEMVER-MAJOR) readline: refactor to use `validateNumber` (Deokjin Kim) https://github.com/nodejs/node/pull/45801 * [295b2f3ff4] - (SEMVER-MAJOR) src: update NODE_MODULE_VERSION to 115 (Michaël Zasso) https://github.com/nodejs/node/pull/47251 * [3803b028dd] - (SEMVER-MAJOR) src: share common code paths for SEA and embedder script (Anna Henningsen) https://github.com/nodejs/node/pull/46825 * [e8bddac3e9] - (SEMVER-MAJOR) src: apply ABI-breaking API simplifications (Anna Henningsen) https://github.com/nodejs/node/pull/46705 * [f84de0ad4c] - (SEMVER-MAJOR) src: use uint32_t for process initialization flags enum (Anna Henningsen) https://github.com/nodejs/node/pull/46427 * [a6242772ec] - (SEMVER-MAJOR) src: fix ArrayBuffer::Detach deprecation (Michaël Zasso) https://github.com/nodejs/node/pull/45579 * [dd5c39a808] - (SEMVER-MAJOR) src: update NODE_MODULE_VERSION to 112 (Yagiz Nizipli) https://github.com/nodejs/node/pull/45579 * [63eca7fec0] - (SEMVER-MAJOR) stream: validate readable defaultEncoding (Marco Ippolito) https://github.com/nodejs/node/pull/46430 * [9e7093f416] - (SEMVER-MAJOR) stream: validate writable defaultEncoding (Marco Ippolito) https://github.com/nodejs/node/pull/46322 * [fb91ee4f26] - (SEMVER-MAJOR) test: make trace-gc-flag tests less strict (Yagiz Nizipli) https://github.com/nodejs/node/pull/45579 * [eca618071e] - (SEMVER-MAJOR) test: adapt test-v8-stats for V8 update (Michaël Zasso) https://github.com/nodejs/node/pull/45579 * [c03354d3e0] - (SEMVER-MAJOR) test: test case for multiple res.writeHead and res.getHeader (Marco Ippolito) https://github.com/nodejs/node/pull/45508 * [c733cc0c7f] - (SEMVER-MAJOR) test_runner: mark module as stable (Colin Ihrig) https://github.com/nodejs/node/pull/46983 * [7ce223273d] - (SEMVER-MAJOR) tools: update V8 gypfiles for 11.1 (Michaël Zasso) https://github.com/nodejs/node/pull/47251 * [ca4bd3023e] - (SEMVER-MAJOR) tools: update V8 gypfiles for 11.0 (Michaël Zasso) https://github.com/nodejs/node/pull/47251 * [58b06a269a] - (SEMVER-MAJOR) tools: update V8 gypfiles (Michaël Zasso) https://github.com/nodejs/node/pull/45579 * [027841c964] - (SEMVER-MAJOR) url: use private properties for brand check (Yagiz Nizipli) https://github.com/nodejs/node/pull/46904 * [3bed5f11e0] - (SEMVER-MAJOR) url: runtime-deprecate url.parse() with invalid ports (Rich Trott) https://github.com/nodejs/node/pull/45526 * [7c76fddf25] - (SEMVER-MAJOR) util,doc: mark parseArgs() as stable (Colin Ihrig) https://github.com/nodejs/node/pull/46718 * [4b52727976] - (SEMVER-MAJOR) wasi: make version non-optional (Michael Dawson) https://github.com/nodejs/node/pull/47391 Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> PR-URL: https://github.com/nodejs/node/pull/47441 Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
* node-api: remove unused mark_arraybuffer_as_untransferableChengzhong Wu2023-04-183-13/+0
| | | | | | | | | | | | napi_create_external_arraybuffer creates the arraybuffer with node::Buffer, which already marks the buffer as untransferable. The napi_env__::mark_arraybuffer_as_untransferable is not used anymore. PR-URL: https://github.com/nodejs/node/pull/47557 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* quic: add more QUIC implementationJames M Snell2023-04-179-8/+1479
| | | | | | | | | | | * add TLSContext * quic: add stat collection utilities * add Packet * add NgTcp2CallbackScope/NgHttp3CallbackScope PR-URL: https://github.com/nodejs/node/pull/47494 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* crypto: remove INT_MAX restriction in randomBytesTobias Nießen2023-04-171-6/+0
| | | | | | | | | | This restriction was due to an implementation detail in CSPRNG(). Now that CSPRNG() properly handles lengths exceeding INT_MAX, remove this artificial restriction. Refs: https://github.com/nodejs/node/pull/47515 PR-URL: https://github.com/nodejs/node/pull/47559 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>