Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-02src: make --no-node-snapshot a per-process optionJoyee Cheung
We enable the shared read-only heap which currently requires that the snapshot used in different isolates in the same process to be the same. Therefore --no-node-snapshot is a per-process option. PR-URL: https://github.com/nodejs/node/pull/42864 Refs: https://github.com/nodejs/node/pull/42809 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2022-04-28bootstrap: move embedded snapshot to SnapshotBuilderJoyee Cheung
So that the embedded snapshot can be reused by the worker. PR-URL: https://github.com/nodejs/node/pull/42702 Refs: https://github.com/nodejs/node/issues/35711 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-28test_runner: add initial CLI runnerColin Ihrig
This commit introduces an initial version of a CLI-based test runner. PR-URL: https://github.com/nodejs/node/pull/42658 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-03-31build: add --node-snapshot-main configure optionJoyee Cheung
This adds a --build-snapshot runtime option which is currently only supported by the node_mksnapshot binary, and a --node-snapshot-main configure option that makes use it to run a custom script when building the embedded snapshot. The idea is to have this experimental feature in core as a configure-time feature for now, and investigate the renaming V8 bugs before we make it available to more users via making it a runtime option. PR-URL: https://github.com/nodejs/node/pull/42466 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-03-23bootstrap: use SnapshotData to pass snapshot data aroundJoyee Cheung
Instead of passing the snapshot blob, the per-isolate data indices and the EnvSerializeInfo separately, use the aggregate type Snapshot to carry these around, and refactor NodeMainInstance so that it owns the v8::Isolate::CreateParams when it owns its isolate. This also gets rid of the owns_isolate_ and deserialize_mode_ booleans in NodeMainInstance since NodeMainInstance can compute these by just checking if it has pointers to the CreateParams or the SnapshotData. PR-URL: https://github.com/nodejs/node/pull/42360 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-03-09src: use `emplace_back` instead of `push_back`Yash Ladha
PR-URL: https://github.com/nodejs/node/pull/42159 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-01-05src: add kNoBrowserGlobals flag for EnvironmentCheng Zhao
PR-URL: https://github.com/nodejs/node/pull/40532 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-11-10src: add and fix some preprocessor commentsTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/40701 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-11-04esm: add support for JSON import assertionAntoine du Hamel
Remove V8 flag for import assertions, enabling support for the syntax; require the import assertion syntax for imports of JSON. Support import assertions in user loaders. Use both resolved module URL and import assertion type as the key for caching modules. Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com> PR-URL: https://github.com/nodejs/node/pull/40250 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2021-10-14src: add flags for controlling process behaviorCheng Zhao
PR-URL: https://github.com/nodejs/node/pull/40339 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-09-29v8: remove --harmony-top-level-awaitGeoffrey Booth
PR-URL: https://github.com/nodejs/node/pull/40226 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-08src: use Isolate::TryGetCurrent where appropriateAnna Henningsen
In two places, we call `Isolate::GetCurrent()` even though that is technically invalid usage of the function. Now that V8 exposes `Isolate::TryGetCurrent()`, we can do this in a proper way. PR-URL: https://github.com/nodejs/node/pull/39954 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-06-29crypto: add OPENSSL_IS_BORINGSSL guardShelley Vohr
PR-URL: https://github.com/nodejs/node/pull/39138 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-06-21src: allow to negate boolean CLI flagsMichaël Zasso
This change allows all boolean flags to be negated using the `--no-` prefix. Flags that are `true` by default (for example `--deprecation`) are still documented as negations. With this change, it becomes possible to easily flip the default value of a boolean flag and to override the value of a flag passed in the NODE_OPTIONS environment variable. `process.allowedNodeEnvironmentFlags` contains both the negated and non-negated versions of boolean flags. Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: https://github.com/nodejs/node/pull/39023 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2021-06-10tools: refactor snapshot builderJoyee Cheung
This patch: - Moves the snapshot building code to src/ so that we can reuse it later when generating custom snapshots from an entry point accepted by the node binary. - Create a SnapshotData struct that incorporates all the data useful for a snapshot blob, including both the V8 data and the Node.js data. PR-URL: https://github.com/nodejs/node/pull/38902 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2021-06-08src,test: raise error for --enable-fips when no FIPSDaniel Bevenius
This commit moves the check for FIPS from the crypto module initialization to process startup. The motivation for this is that when OpenSSL is not FIPS enabled and the command line options --enable-fips, or --force-fips are used, there will only be an error raised if the crypto module is used. This can be surprising and we have gotten feedback that users assumed that there would be an error if these options were specified and FIPS is not available. PR-URL: https://github.com/nodejs/node/pull/38859 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <rlau@redhat.com>
2021-06-07src: make InitializeOncePerProcess more flexibleShelley Vohr
PR-URL: https://github.com/nodejs/node/pull/38888 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-06-01src: fix typosbl-ue
PR-URL: https://github.com/nodejs/node/pull/38845 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
2021-05-25src: use SPrintF in ProcessEmitWarningDarshan Sen
PR-URL: https://github.com/nodejs/node/pull/38758 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-05-24src: set CONF_MFLAGS_DEFAULT_SECTION for OpenSSL 3Daniel Bevenius
This commit adds a call to OPENSSL_init_crypto to initialize OPENSSL_INIT_LOAD_CONFIG to avoid the default behavior where errors raised during the parsing of the OpenSSL configuration file are not propagated and cannot be detected. The motivation for this is that if FIPS is configured the OpenSSL configuration file will have an .include pointing to the fipsmodule.cnf file generated by the openssl fipsinstall command. If the path to this file is incorrect no error will be reported. For Node.js this will mean that EntropySource will be called by V8 as part of its initalization process, and EntropySource will in turn call CheckEntropy. CheckEntropy will call RAND_status which will now always return 0 leading to an endless loop and the node process will appear to hang/freeze. I'll continue investigating the cause of this and see if this is expected behavior or not, but in the mean time it would be good to be able to workaround this issue with this commit. PR-URL: https://github.com/nodejs/node/pull/38732 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Refs: https://github.com/nodejs/node/pull/38633#pullrequestreview-658811317
2021-05-17lib: support setting process.env.TZ on windowsJames M Snell
Fixes: https://github.com/nodejs/node/issues/4230 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/38642 Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-03-16src,test: support dynamically linking OpenSSL 3.0Daniel Bevenius
This commit enables node to dynamically link against OpenSSL 3.0. The motivation for opening this PR even though OpenSSL 3.0 has not been released yet is to allow a nightly CI job to be created. This will allow us stay on top of changes required for OpenSSL 3.0, and also to make sure that changes to node crypto do not cause issues when linking to OpenSSL 3.0. PR-URL: https://github.com/nodejs/node/pull/37669 Refs: https://github.com/nodejs/node/issues/29817 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-02-26crypto: make FIPS related options always awailableVít Ondruch
There is no reason to hide FIPS functionality behind build flags. OpenSSL always provide the information about FIPS availability via `FIPS_mode()` function. This makes the user experience more consistent, because the OpenSSL library is always queried and the `crypto.getFips()` always returns OpenSSL settings. Fixes #34903 PR-URL: https://github.com/nodejs/node/pull/36341 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2021-02-15perf_hooks: introduce createHistogramJames M Snell
Adds a new `perf_hooks.createHistogram()` API for creating histogram instances that allow user recording. Makes Histogram instances cloneable via MessagePort. This allows, for instance, an event loop delay monitor to be running on the main thread while the histogram data can be monitored actively from a worker thread. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37155 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-02-08src: avoid implicit type conversionsMichaël Zasso
This fixes a bunch of C4244 ('conversion' conversion from 'type1' to 'type2', possible loss of data) MSVC warnings in the code base. PR-URL: https://github.com/nodejs/node/pull/37149 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-05src: refactor bookkeeping of bootstrap statusJoyee Cheung
This patch 1. Refactors the bootstrap routine of the main instance so that when --no-node-snapshot is used, Environment::InitializeMainContext() will only be called once (previously it would be called twice, which was harmless for now but not ideal). 2. Mark the number of BaseObjects in RunBootstrapping() when creating the Environment from scratch and in InitializeMainContext() when the Environment is deserialized. Previously the marking was done in the Environment constructor and InitializeMainContext() respectively for the cctest which was incorrect because the cctest never uses an Environment that's not bootstrapped. Also renames the mark to base_object_created_after_bootstrap to reflect what it's intended for. PR-URL: https://github.com/nodejs/node/pull/37113 Refs: https://github.com/nodejs/node/pull/36943 Reviewed-By: James M Snell <jasnell@gmail.com>
2020-11-02src: clean up embedder APIAnna Henningsen
Remove deprecated APIs (and deprecate one legacy API). PR-URL: https://github.com/nodejs/node/pull/35897 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2020-10-21src: add --heapsnapshot-near-heap-limit optionJoyee Cheung
This patch adds a --heapsnapshot-near-heap-limit CLI option that takes heap snapshots when the V8 heap is approaching the heap size limit. It will try to write the snapshots to disk before the program crashes due to OOM. PR-URL: https://github.com/nodejs/node/pull/33010 Refs: https://github.com/nodejs/node/issues/27552 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-09-26src: fix incorrect SIGSEGV handling in NODE_USE_V8_WASM_TRAP_HANDLERAnatoly Korniltsev
Pass SA_SIGINFO to sa_flags so the TrapWebAssemblyOrContinue is treated as sa_sigaction, not sa_handler, otherwise siginfo_t* info contains some garbage PR-URL: https://github.com/nodejs/node/pull/35282 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2020-09-16src: enable wasm trap handler on windowsGus Caplan
PR-URL: https://github.com/nodejs/node/pull/35033 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2020-08-29perf_hooks: add idleTime and event loop utilTrevor Norris
Use uv_metrics_idle_time() to return a high resolution millisecond timer of the amount of time the event loop has been idle since it was initialized. Include performance.eventLoopUtilization() API to handle the math of calculating the idle and active times. This has been added to prevent accidental miscalculations of the event loop utilization. Such as not taking into consideration offsetting nodeTiming.loopStart or timing differences when being called from a Worker thread. PR-URL: https://github.com/nodejs/node/pull/34938 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Adrian Estrada <edsadr@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-08-03module: unflag Top-Level AwaitMyles Borins
This unflags Top-Level await so it can be used by default in the module goal. This is accomplished by manually setting the --harmony-top-level-await flag. We are allowing this as a one of approval based on circumstances. It is not a precedent that future harmony features will be manually enabled. Refs: https://github.com/nodejs/node/issues/34551 PR-URL: https://github.com/nodejs/node/pull/34558 Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2020-07-18src: make code cache test work with snapshotsJoyee Cheung
Keep track of snapshotted modules in JS land, and move bootstrap switches into StartExecution() so that they are not included into part of the environment-independent bootstrap process. PR-URL: https://github.com/nodejs/node/pull/32984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-07-18src: snapshot Environment upon instantiationJoyee Cheung
This includes the initial Environment (without running bootstrap scripts) into the builtin snapshot PR-URL: https://github.com/nodejs/node/pull/32984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-07-18src: add an ExternalReferenceRegistry classJoyee Cheung
Add an ExternalReferenceRegistry class for registering static external references. To register the external JS to C++ references created in a binding (e.g. when a FunctionTemplate is created): - Add the binding name (same as the id used for `internalBinding()` and `NODE_MODULE_CONTEXT_AWARE_INTERNAL`) to `EXTERNAL_REFERENCE_BINDING_LIST` in `src/node_external_reference.h`. - In the file where the binding is implemented, create a registration function to register the static C++ references (e.g. the C++ functions in `v8::FunctionCallback` associated with the function templates), like this: ```c++ void RegisterExternalReferences( ExternalReferenceRegistry* registry) { registry->Register(cpp_func_1); } ``` - At the end of the file where `NODE_MODULE_CONTEXT_AWARE_INTERNAL` is also usually called, register the registration function with ``` NODE_MODULE_EXTERNAL_REFERENCE(binding_name, RegisterExternalReferences); ``` PR-URL: https://github.com/nodejs/node/pull/32984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-07-08src: exit explicitly after printing V8 helpAnna Henningsen
V8 will not exit the process after handling --help anymore: https://chromium-review.googlesource.com/c/v8/v8/+/2276276 As a drive-by fix, correctly return in the `print_bash_completion` case as well. Refs: https://github.com/nodejs/node/pull/34135 Co-authored-by: Ulan Degenbaev <ulan@chromium.org> PR-URL: https://github.com/nodejs/node/pull/34136 Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-06-25lib,src: remove cpu profiler idle notifierBen Noordhuis
I added it in commit 57231d5286 ("src: notify V8 profiler when we're idle") from October 2013 as a stop-gap measure to measure CPU time rather than wall clock time, otherwise processes that spend a lot of time sleeping in system calls give a false impression of being very busy. That fix is not without drawbacks because the idle flag is set before libuv makes I/O callbacks and cleared again after. I/O callbacks can result into calls into JS code and executing JS code is as non-idle as you can get. In commit 96ffcb9a21 ("src: reduce cpu profiler overhead") from January 2015, I made Node.js block off the SIGPROF signal that V8's CPU profiler uses before Node.js goes to sleep. The goal of that commit is to reduce the overhead from EINTR system call wakeups but it also has the pleasant side effect of fixing what the idle notifier tried to fix. This commit removes the idle notifier and turns the JS process object methods into no-ops. Fixes: https://github.com/nodejs/node/issues/19009 Refs: https://github.com/nodejs/node/pull/33138 PR-URL: https://github.com/nodejs/node/pull/34010 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-25src: tolerate EPERM returned from tcsetattrpatr0nus
macOS app sandbox makes tcsetattr return EPERM. The CHECK_EQ(0, err) here would fail when a sandboxed Node.js process is exiting. This commit fixes this issue. * test: add test for running in macOS app sandbox Bare-bone command-line executables cannot run directly in the app sandbox. To test that Node.js is able to run in the sandbox (and to test the fix in 317621b4a12562eb75055a67bb2c5556f53fe017), this commit creates a typical Cocoa app bundle, puts the node executable in it and calles Apple's codesign command to enable sandbox. * test: use process.execPath to get path of testing node PR-URL: https://github.com/nodejs/node/pull/33944 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-25src: remove _third_party_main supportAnna Henningsen
Since 7dead8440c7ee, there is a more official alternative that is tested and comes with a proper API, and since a6c57cc66d0, the `LoadEnvironment(env)` overload is deprecated, which is the closest thing we can achieve to deprecating `_third_party_main` support. Thus, we can now consider us able to remove `_third_party_main` support. Fixes: https://github.com/nodejs/node/issues/24017 Refs: https://github.com/nodejs/node/pull/30467 Refs: https://github.com/nodejs/node/pull/32858 PR-URL: https://github.com/nodejs/node/pull/33971 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-06-01src: remove deprecated node debug commandJames M Snell
The `node debug` command has been deprecated for a while now. There's really no good reason to keep it around. Move to end of life. PR-URL: https://github.com/nodejs/node/pull/33648 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2020-05-31src: extract AllocatedBuffer from env.hJames M Snell
Cleanup up env.h by removing things that are not specific to `Environment`. PR-URL: https://github.com/nodejs/node/pull/33291 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com>
2020-05-18src: add default: case to silence compiler warningAnna Henningsen
This fails compilation on at least one platform because there is no `default:` case, despite all currently possible enum values being listed. Fix that by adding a default message that won’t be used unless V8 introduces new enum values. Refs: https://github.com/nodejs/node/commit/c7eeef568ce5a3714b89689160ec85c017527364#commitcomment-39228519 PR-URL: https://github.com/nodejs/node/pull/33451 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-05-15cli: add `--trace-atomics-wait` flagAnna Henningsen
Adds a flag that helps with debugging deadlocks due to incorrectly implemented `Atomics.wait()` calls. PR-URL: https://github.com/nodejs/node/pull/33292 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-05-13src: remove unused using declarations in node.ccDaniel Bevenius
PR-URL: https://github.com/nodejs/node/pull/33261 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-05-12src: use MaybeLocal.ToLocal instead of IsEmptyDaniel Bevenius
This commit suggest using MaybeLocal.ToLocal and passing in the Local<Function> fn. The motivation for doing this is that the following MaybeLocal.ToLocalChecked call can then be avoided. PR-URL: https://github.com/nodejs/node/pull/33312 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-05-06src: retrieve binding data from the contextJoyee Cheung
Instead of passing them through the data bound to function templates, store references to them in a list embedded inside the context. This makes the function templates more context-independent, and makes it possible to embed binding data in non-main contexts. Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: https://github.com/nodejs/node/pull/33139 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-04-06src: make creating per-binding data structures easierAnna Henningsen
Enable the state associated with the individual bindings, e.g. fs or http2, to be moved out of the Environment class, in order for these to be more modular and for Environment to be come less of a collection of random data fields. Do this by using a BaseObject as the data for callbacks, which can hold the per-binding state. By default, no per-binding state is available, although that can be configured when setting up the binding. PR-URL: https://github.com/nodejs/node/pull/32538 Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-03Revert "embedding: make Stop() stop Workers"Anna Henningsen
This reverts commit 037ac99ed5aa763b7a3567da2cc81f9d7b97bdf9. As flaky CI failures have revealed, this feature was implemented incorrectly. `stop_sub_worker_contexts()` needs to be called on the thread on which the `Environment` is currently running, it’s not thread-safe. The current API requires `Stop()` to be thread-safe, though. We could add a new API for this, but unless there’s demand, that’s probably not necessary as `FreeEnvironment()` will also stop Workers, which is commonly the next action on an `Environment` instance after having `Stop()` called on it. Refs: https://github.com/nodejs/node/pull/32531 PR-URL: https://github.com/nodejs/node/pull/32623 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-04-02embedding: make Stop() stop WorkersAnna Henningsen
This makes sense given that terminating execution of the parent thread this way likely also is supposed to stop all running Worker threads spawned by it. PR-URL: https://github.com/nodejs/node/pull/32531 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-21src: provide a variant of LoadEnvironment taking a callbackAnna Henningsen
This allows embedders to flexibly control how they start JS code rather than using `third_party_main`. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>