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
2020-10-15src: combine TLSWrap/SSLWrapJames M Snell
SSLWrap was needlessly defined as a template class, splitting the TLS implementation over multiple locations. The original idea, I surmise, was to make it possible to reuse SSLWrap for some other purpose that never manifest. This squashes them down into a single TLSWrap class and moves tls_wrap.h/cc into src/crypto. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35552 Reviewed-By: Alba Mendez <me@alba.sh>
2020-10-14src: add embedding helpers to reduce boilerplate codeAnna Henningsen
Provide helpers for a) spinning the event loop and b) setting up and tearing down the objects involved in a single Node.js instance, as they would typically be used. The former helper is also usable inside Node.js itself, for both Worker and main threads. PR-URL: https://github.com/nodejs/node/pull/35597 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-10-12module: use Wasm CJS lexer when availableGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/35583 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
2020-10-09build: fuzzer that targets node::LoadEnvironment()davkor
Refs: https://github.com/nodejs/node/pull/34761 Refs: https://github.com/nodejs/node/issues/33724 PR-URL: https://github.com/nodejs/node/pull/34844 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-10-08crypto: refactoring internals, add WebCryptoJames M Snell
Fixes: https://github.com/nodejs/node/issues/678 Refs: https://github.com/nodejs/node/issues/26854 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35093 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-08crypto: move node_crypto files to src/cryptoJames M Snell
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35093 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-30src: create helper for reading Uint32BEJuan José Arboleda
Fixes: https://github.com/nodejs/node/issues/34827 PR-URL: https://github.com/nodejs/node/pull/34944 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-09-29module: named exports for CJS via static analysisGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/35249 Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-09-21stream: move to internal/streamsMatteo Collina
Move all the streams constructors to internal/streams and avoid a circular dependencies between the modules. See: https://github.com/nodejs/readable-stream/issues/348 PR-URL: https://github.com/nodejs/node/pull/35239 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2020-08-26policy: implement scopes fieldBradley Farias
PR-URL: https://github.com/nodejs/node/pull/34552 Reviewed-By: James M Snell <jasnell@gmail.com>
2020-08-16build: add build flag for OSS-Fuzz integrationdavkor
Refs: https://github.com/google/oss-fuzz/pull/3860 Fixes: https://github.com/nodejs/node/issues/33724 PR-URL: https://github.com/nodejs/node/pull/34761 Fixes: https://github.com/nodejs/node/issues/33724 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-08-13policy: support conditions for redirectsBradley Farias
PR-URL: https://github.com/nodejs/node/pull/34414 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
2020-08-11net: introduce net.BlockListJames M Snell
`net.BlockList` provides an object intended to be used by net APIs to specify rules for disallowing network activity with specific IP addresses. This commit adds the basic mechanism but does not add the specific uses. PR-URL: https://github.com/nodejs/node/pull/34625 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-07-31quic: use OpenSSL built-in cert and hostname validationJames M Snell
PR-URL: https://github.com/nodejs/node/pull/34533 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-22build: define NODE_EXPERIMENTAL_QUIC in mkcodecache and node_mksnapshotJoyee Cheung
Otherwise the build would fail with `./configure --experimental-quic --ninja` as the list of per-Environment values would not match and the code cache builder would not generate code cache for the quic JS sources. This is more or less a band-aid - a proper fix would be to aggregate these flags into something that can be included by all these different binary targets. See https://github.com/nodejs/node/issues/31074. PR-URL: https://github.com/nodejs/node/pull/34454 Fixes: https://github.com/nodejs/node/issues/34435 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@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-17stream: simpler and faster Readable async iteratorRobert Nagy
Reimplement as an async generator instead of a custom iterator class. PR-URL: https://github.com/nodejs/node/pull/34035 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-09stream: add promises version to utility functionsrickyes
PR-URL: https://github.com/nodejs/node/pull/33991 Fixes: https://github.com/nodejs/node/issues/33582 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
2020-07-06src: add TimerWrap utilityJames M Snell
Consolidate uv_timer_t boilerplate code into a shared utility. There are several places throughout the code where we use uv_timer_t internally (inspector, perf, quic), with some code duplication. This eliminates the duplicated code, ensures that cleanup occurs correctly, and simplifies use of the timers. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/34186 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-06-25assert: add `assert/strict` alias moduleExE Boss
Refs: https://github.com/nodejs/node/pull/31553 Refs: https://github.com/nodejs/node/pull/32953 PR-URL: https://github.com/nodejs/node/pull/34001 Refs: https://github.com/nodejs/node/pull/34002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> 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-23internal: rename error-serdes for consistencyEvan Lucas
All other JavaScript files in lib use snake case, so make this one consistent. PR-URL: https://github.com/nodejs/node/pull/33793 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23timers: introduce timers/promisesJames M Snell
Move the promisified timers implementations into a new sub-module to avoid the need to promisify. The promisified versions now return the timers/promises versions. Also adds `ref` option to the promisified versions ```js const { setTimeout, setImmediate } = require('timers/promises'); setTimeout(10, null, { ref: false }) .then(console.log); setImmediate(null, { ref: false }) .then(console.log); ``` Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33950 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-19domain: remove native domain codeStephen Belanger
With the async_hooks callback trampoline, domains no longer need any native code. With this, domains can exist in pure JavaScript. PR-URL: https://github.com/nodejs/node/pull/33801 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-06-16quic: initial QUIC implementationJames M Snell
Co-authored-by: Anna Henningsen <anna@addaleax.net> Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com> Co-authored-by: gengjiawen <technicalcute@gmail.com> Co-authored-by: James M Snell <jasnell@gmail.com> Co-authored-by: Lucas Pardue <lucaspardue.24.7@gmail.com> Co-authored-by: Ouyang Yadong <oyydoibh@gmail.com> Co-authored-by: Juan Jos<C3><A9> Arboleda <soyjuanarbol@gmail.com> Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com> Co-authored-by: Denys Otrishko <shishugi@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32379 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-16test: add common/udppair utilityJames M Snell
Extracted from the QUIC PR. This adds a utility used to deterministically test UDP traffic. It is currently only used by the experimental QUIC implementation. Separated out on request to make review easier. PR-URL: https://github.com/nodejs/node/pull/33380 Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2020-06-14worker: allow passing JS wrapper objects via postMessageAnna Henningsen
Enable JS wrapper objects to be used as transferable or cloneable objects in `postMessage()` calls, by having them extend a C++-backed class. This requires a few internal changes: - This commit adds the possibility for transferred objects to read/write JS values at the end of the serialization/deserialization phases. - This commit adds the possibility for transferred objects to list sub-transferables, e.g. typically the public JS wrapper class would list its C++ handle in there. - This commit adds usage of `BaseObject` in a few more places, because now during deserialization weakly held objects can also be involved, in addition to `MessagePort`s. PR-URL: https://github.com/nodejs/node/pull/33772 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-08src,build: add --openssl-default-cipher-listDaniel Bevenius
This commit adds a configuration option named openssl-default-cipher-list which takes a colon separated string specifying ciphers that should be used as the default ciphers instead of the ones defined in node_constants. The motivation for this is a use case where Fedora/RHEL would like to be able to specify a default cipher in the format PROFILE=SYSTEM. This would enable Fedora/RHEL to have a system wide security level for all applications. PR-URL: https://github.com/nodejs/node/pull/33708 Refs: https://docs.fedoraproject.org/en-US/packaging-guidelines/CryptoPolicies/ Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-06-05lib: initial experimental AbortController implementationJames M Snell
AbortController impl based very closely on: https://github.com/mysticatea/abort-controller Marked experimental. Not currently used by any of the existing promise apis. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33527 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-02build: fix node.gyp configgengjiawen
PR-URL: https://github.com/nodejs/node/pull/33685 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.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-28events: initial implementation of experimental EventTargetJames M Snell
See documentation changes for details Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33556 Refs: https://github.com/nodejs/node/pull/33527 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-05-25esm: share package.json cache between ESM and CJS loadersKirill Shatskiy
Refs: https://github.com/nodejs/node/issues/30674 PR-URL: https://github.com/nodejs/node/pull/33229 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
2020-05-24dns: add dns/promises aliasshisama
PR-URL: https://github.com/nodejs/node/pull/32953 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-13build: fix `--error-on-warn` for macOSRichard Lau
XCode builds on macOS do not appear to inherit the `cflags` setting. Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: https://github.com/nodejs/node/pull/33357 Refs: https://github.com/nodejs/node/pull/32685 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-05-09src: split out callback queue implementation from EnvironmentAnna Henningsen
This isn’t conceptually tied to anything Node.js-specific at all. PR-URL: https://github.com/nodejs/node/pull/33272 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-04-30build: add --error-on-warn configure flagDaniel Bevenius
This commit adds a configuration time flag named error-on-warn: $ ./configure --help | grep -A1 error-on-warn --error-on-warn Turn compiler warnings into errors for node core sources. The motivation for this is that CI jobs can use this flag to turn warnings into errors. PR-URL: https://github.com/nodejs/node/pull/32685 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
2020-04-23assert: port common.mustCall() to assertConorDavenport
Fixes: https://github.com/nodejs/node/issues/31392 PR-URL: https://github.com/nodejs/node/pull/31982 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-04-14src: add AliasedStruct utilityJames M Snell
For http2 (and eventually QUIC) we have a struct that is backed by a v8::BackingStore and exposed to the JavaScript side as an ArrayBuffer and TypedArray. This is similar to AliasedBuffer except that it is fronted by a struct on the C++ side. ```c++ struct foo { uint32_t ex1; uint32_t ex2; }; AliasedStruct<foo> foo_; foo_->ex1 = 1; foo_->ex2 = 2; foo_.GetArrayBuffer(); ``` Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32778 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-04-02src: move JSONWriter into its own fileAnna Henningsen
The JSONWriter feature is not inherently related to the report feature in any way. As a drive-by fix, remove a number of unused header includes. PR-URL: https://github.com/nodejs/node/pull/32552 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-03-30src: unify Linux and FreeBSD large pages implemGabriel Schulhof
dl_iterate_phdr(3) is also available for FreeBSD. This change adds the same trimming code for the start and end of the .text section as on Linux, making it work on FreeBSD, and removing the need for the additional FreeBSD-specific check. Manually tested on * https://www.osboxes.org/freebsd/#freebsd-12-1-vbox * https://www.osboxes.org/freebsd/#freebsd-11-vbox * test-digitalocean-freebsd11-x64-2 Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: https://github.com/nodejs/node/pull/32534 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
2020-03-21src,test: add full-featured embedder API testAnna Henningsen
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>
2020-03-15build: remove node_report option in node.gypcjihrig
PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-03-11build: remove empty line on node.gyp fileJuan José Arboleda
PR-URL: https://github.com/nodejs/node/pull/31952 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-10tools: use per-process native Debug() printer in mkcodecacheJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/31884 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-06src,http2: introduce node_http_commonJames M Snell
The nghttp2 and nghttp3 (used in the QUIC implementation) share nearly identical structs for header handling. However, they differ enough that they need to be handled slightly different in each case. This PR includes some elements introduced in the QUIC PR separated out to make them independently reviewable, and updates the http2 implementation to use the shared utilities. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32069 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-03-05src: introduce node_sockaddrJames M Snell
Introduce the SocketAddress utility class. The QUIC implementation makes extensive use of this for handling of socket addresses. It was separated out to make it generically reusable throughout core Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32070 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-03-04build: fix building with ninjaRichard Lau
The ninja build places objects in a different directory. Co-authored-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: https://github.com/nodejs/node/pull/32071 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-03-03src: start the .text section with an asm symbolGabriel Schulhof
We create an object file in assembly which introduces the symbol `__node_text_start` into the .text section and place the resulting object file as the first file the linker encounters. We do this to ensure that we can recognize the boundaries of the .text section when attempting to establish the address range to map to large pages. Additionally, we rename the section containing the remapping code from `.lpstub` to `lpstub` so as to take advantage of the linker's feature whereby it inserts the symbol `__start_lpstub` when the section's name can be rendered as a valid C variable. We need this symbol in order to avoid self-mapping the remapping code to large pages, because doing so would cause the process to crash. PR-URL: https://github.com/nodejs/node/pull/31981 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
2020-03-03src: add node_crypto_common and refactorJames M Snell
Two things in one on this commit: (a) For the QUIC implementation, we need to separate out various bits from node_crypto.cc to allow them to be reused. That's where this commit starts. (b) Quite a bit of the node_crypto.cc code was just messy in terms of it's organization and lack of error handling and use of Local vs. MaybeLocal. This cleans that up a bit and hopefully makes certain parts a bit more manageable also. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32016 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>