summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-07-19http2: remove unused nghttp2 error listAnna Henningsen
Remove a list of HTTP2 errors as well as `nghttp2_errname()` that converted an integer nghttp2 error code to a string representation. We already use `nghttp2_strerror()` for this, which is provided by nghttp2 returns a better error string anyway. PR-URL: https://github.com/nodejs/node/pull/21827 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-07-19src: use offset calc. instead of `req->data` in node_fileAnna Henningsen
A small refactor – this removes one layer of pointer indirection. (The performance gain is likely negligible, the main point here being that this encapsulates libuv request management a bit more.) PR-URL: https://github.com/nodejs/node/pull/21839 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-07-19src: prepare for V8 Swallowed Rejection HookBenedikt Meurer
This is done in preparation for landing https://chromium-review.googlesource.com/c/v8/v8/+/1126099 on the V8 side, which extends the existing PromiseRejectEvent mechanism with new hooks for reject/resolve after a Promise was previously resolved already. Refs: https://github.com/nodejs/promises-debugging/issues/8 Design: https://goo.gl/2stLUY PR-URL: https://github.com/nodejs/node/pull/21838 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com>
2018-07-18trace_events: add more process metadataJames M Snell
Now that TracedValue has landed, add more detailed process `__metadata` including versions, arch, platform, release detail, and argv/execArgv to the trace event log. PR-URL: https://github.com/nodejs/node/pull/21785 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-07-18util: improve display of iterators and weak entriesRuben Bridgewater
This adds the number of not visible elements when inspecting iterators while exceeding `maxArrayLength`. It also fixes a edge case with `maxArrayLength` and the map.entries() iterator. Now the whole entry will be visible instead of only the key but not the value of the first entry. Besides that it uses a slighly better algorithm that improves the performance by skipping unnecessary steps. PR-URL: https://github.com/nodejs/node/pull/20961 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-07-18src: avoid unnecessarily formatting a warningTobias Nießen
ProcessEmitWarning will already format the message, there is no need to call snprintf here. PR-URL: https://github.com/nodejs/node/pull/21832 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-18crypto: add support for OCB mode for AEADTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/21447 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-17buffer: remove superfluous assignmentTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/21844 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-17src: include cwd in chdir error messageAnna Henningsen
Include the current working directory in the error message for a failing `process.chdir()` since that is usually information relevant for debugging. This is semver-major because it moves properties of the error message object. Inspired by https://github.com/nodejs/help/issues/1355. PR-URL: https://github.com/nodejs/node/pull/21526 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-07-16http2: fix issues with aborted `respondWithFile()`sAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/21561 Fixes: https://github.com/nodejs/node/issues/20824 Fixes: https://github.com/nodejs/node/issues/21560 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-07-16lib,src: replace all C++ promises with JS promisesRuben Bridgewater
C++ promises can not be properly optimized by V8. They also behave a tiny bit different than "regular" promises. PR-URL: https://github.com/nodejs/node/pull/20830 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-07-16console,util: avoid pair array generation in C++Anna Henningsen
Use a plain `[key, value, key, value]`-style list instead of an array of pairs for inspecting collections. This also fixes a bug with `console.table()` where inspecting a non-key-value `MapIterator` would have led to odd results. PR-URL: https://github.com/nodejs/node/pull/20831 Refs: https://github.com/nodejs/node/pull/20719#discussion_r189342513 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-07-16src: fix async hooks crashing when there is no node contextJavier Gonzalez
PR-URL: https://github.com/nodejs/node/pull/19134 Fixes: https://github.com/nodejs/node/issues/19104 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-07-15src: make heap snapshot & embedder graph accessible for testsAnna Henningsen
Add methods that allow inspection of heap snapshots and a JS version of our own embedder graph. These can be used in tests and might also prove useful for ad-hoc debugging. Usage requires `--expose-internals` and prints a warning similar to our other modules whose primary purpose is test support. PR-URL: https://github.com/nodejs/node/pull/21741 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-07-15src: use V8 graph heap snapshot APIAnna Henningsen
Transition to a newer, more flexible API for heap snapshot creation. This addresses a currently pending deprecation in the V8 API. PR-URL: https://github.com/nodejs/node/pull/21741 Fixes: https://github.com/nodejs/node/issues/21633 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-07-15src: add iteration over all base objects to EnvironmentAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/21741 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-07-15src: remove defunct timer_wrap fileJon Moss
Unused since the excellent refactoring in 2930bd, which also removed `src/timer_wrap.cc` from `node.gyp`. If you try and get at the binding on a v11.0-pre build, you'll get an error, since the file is no longer in the GYP build. ``` Jonathans-MBP:node jon$ ./node -v v11.0.0-pre Jonathans-MBP:node jon$ ./node -e "process.binding('timer_wrap')" internal/bootstrap/loaders.js:81 mod = bindingObj[module] = getBinding(module); ^ Error: No such module: timer_wrap at process.binding (internal/bootstrap/loaders.js:81:36) at [eval]:1:9 at Script.runInThisContext (vm.js:89:20) at Object.runInThisContext (vm.js:286:38) at Object.<anonymous> ([eval]-wrapper:6:22) at Module._compile (internal/modules/cjs/loader.js:689:30) at evalScript (internal/bootstrap/node.js:562:27) at startup (internal/bootstrap/node.js:248:9) at bootstrapNodeJSCore (internal/bootstrap/node.js:595:3) ``` PR-URL: https://github.com/nodejs/node/pull/21777 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Refs: https://github.com/nodejs/node/pull/20894
2018-07-14process: fix process.exitCode handling for fatalExceptionDenys Otrishko
* set process.exitCode before calling 'exit' handlers so that there will not be a situation where process.exitCode !== code in 'exit' callback during uncaughtException handling * don't ignore process.exitCode set in 'exit' callback when failed with uncaughtException and there is no uncaughtException listener PR-URL: https://github.com/nodejs/node/pull/21739 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-07-14src,tools: use https://nodejs.org URL when possible.XhmikosR
PR-URL: https://github.com/nodejs/node/pull/21719 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-07-14src: add comment on CallbackScope exception behaviourAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/21743 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-07-13inspector: split main thread interface from transportEugene Ostroukhov
Workers debugging will require interfacing between the "main" inspector and per-worker isolate inspectors. This is consistent with what WS interface does. This change is a refactoring change and does not change the functionality. PR-URL: https://github.com/nodejs/node/pull/21182 Fixes: https://github.com/nodejs/node/issues/21725 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-13src: enable more detailed memory trackingAnna Henningsen
This will enable more detailed heap snapshots based on a newer V8 API. This commit itself is not tied to that API and could be backported. PR-URL: https://github.com/nodejs/node/pull/21742 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-13src: add HandleWrap::AddWrapMethodsJon Moss
Extracts common setters to a single location PR-URL: https://github.com/nodejs/node/pull/21769 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-07-12napi: add bigint supportGus Caplan
PR-URL: https://github.com/nodejs/node/pull/21226 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
2018-07-12trace_events: add traced_value.cc/traced_value.hJames M Snell
Port of the V8 internal v8::tracing::TracedValue that allows structured data to be included in the trace event. The v8 class is not exported in the public API so we cannot use it directly. This is a simplified and slightly modified port. This commit only adds the class, it does not add uses of it. Those will come in separate PRs/commits. PR-URL: https://github.com/nodejs/node/pull/21475 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-07-12crypto: handle OpenSSL error queue in CipherBaseTobias Nießen
This handles all errors produced by OpenSSL within the CipherBase class. API functions ensure that they do not add any new errors to the error queue. Also adds a couple of CHECKs and throws under certain conditions. PR-URL: https://github.com/nodejs/node/pull/21288 Fixes: https://github.com/nodejs/node/issues/21281 Refs: https://github.com/nodejs/node/pull/21287 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2018-07-12zlib: instance-ify two methodsJon Moss
Both `Params` and `SetDictionary` take `ZCtx` as an arg, so just make them both instance methods on `ZCtx`. PR-URL: https://github.com/nodejs/node/pull/21702 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-11src: make Environment::is_stopping_worker inlineJon Moss
Fixes a TODO comment. PR-URL: https://github.com/nodejs/node/pull/21720 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-10src: add --title command line argumentJames M Snell
Simple utility command line argument for setting the process title on process startup. PR-URL: https://github.com/nodejs/node/pull/21477 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-07-10trace_events: add process_name metadataJames M Snell
PR-URL: https://github.com/nodejs/node/pull/21477 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-07-10zlib: track memory allocated by zlibAnna Henningsen
Provide a custom memory allocator for zlib, and track memory allocated by the library with it. Right now this “only” makes reported external memory usage (much) more accurate and protects against zlib memory leaks, but it generally will enable us to give more accurate memory usage statistics for zlib. PR-URL: https://github.com/nodejs/node/pull/21608 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-09n-api: remove experimental gate from status codesGabriel Schulhof
Re: https://github.com/nodejs/node/pull/21226#discussion_r200534431 PR-URL: https://github.com/nodejs/node/pull/21680 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2018-07-09n-api: create functions directlyGabriel Schulhof
Avoid using `v8::FunctionTemplate::New()` when using `v8::Function::New()` suffices. This ensures that individual functions can be gc-ed and that functions can be created dynamically without running out of memory. PR-URL: https://github.com/nodejs/node/pull/21688 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Kyle Farnung <kfarnung@microsoft.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2018-07-05n-api: restrict exports by versionKyle Farnung
* Move `napi_get_uv_event_loop` into the `NAPI_VERSION >= 2` section * Move `napi_open_callback_scope`, `napi_close_callback_scope`, `napi_fatal_exception`, `napi_add_env_cleanup_hook`, and `napi_remove_env_cleanup_hook` into the `NAPI_VERSION >= 3` section * Added a missing `added` property to `napi_get_uv_event_loop` in the docs * Added a `napiVersion` property to the docs and updated the parser and generator to use it. * Added usage documentation PR-URL: https://github.com/nodejs/node/pull/19962 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-07-05src: remove using directives from spawn_sync.hDaniel Bevenius
I noticed that there were a few using declarations what were unused and instead of just removing them, this commit removes all of them and uses qualified names instead since they are in a header. PR-URL: https://github.com/nodejs/node/pull/21634 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-07-03messaging: fix edge cases with transferring portsTimothy Gu
Currently, transferring the port on which postMessage is called causes a segmentation fault, and transferring the target port causes a subsequent port.onmessage setting to throw, or a deadlock if onmessage is set before the postMessage. Fix both of these behaviors and align the methods more closely with the normative definitions in the HTML Standard. Also, per spec postMessage must not throw just because the ports are disentangled. Implement that behavior. PR-URL: https://github.com/nodejs/node/pull/21540 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-03messaging: use actual DOMException for DataCloneErrorTimothy Gu
PR-URL: https://github.com/nodejs/node/pull/21540 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-03src: add context-aware init macro and docGabriel Schulhof
Introduces macros `NODE_MODULE_INITIALIZER` which expands to the name of the special symbol that process.dlopen() will look for to initialize an addon, and `NODE_MODULE_INIT()` which creates the boilerplate for a context-aware module which can be loaded multiple times via the special symbol mechanism. Additionally, provides an example of using the new macro to construct an addon which stores per-addon-instance data in a heap-allocated structure that gets passed to each binding, rather than in a collection of global static variables. Re: https://github.com/nodejs/node/issues/21291#issuecomment-396729727 PR-URL: https://github.com/nodejs/node/pull/21318 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2018-07-03tls: throw error on bad ciphers optionBrian White
PR-URL: https://github.com/nodejs/node/pull/21557 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-07-03zlib: fix memory leak for unused zlib instancesAnna Henningsen
An oversight in an earlier commit led to a memory leak in the untypical situation that zlib instances are created but never used, because zlib handles no longer started out their life as weak handles. The bug was introduced in bd201102862a194f3f5ce669e0a3c8143eafc900. Refs: https://github.com/nodejs/node/pull/20455 PR-URL: https://github.com/nodejs/node/pull/21607 Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-07-02n-api: fix compiler warningcjihrig
private field 'async_context' is not used [-Wunused-private-field] PR-URL: https://github.com/nodejs/node/pull/21597 Refs: https://github.com/nodejs/node/pull/17887 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-06-30src: remove StreamBase::kFlagHasWritevAnna Henningsen
Since libuv 1.21.0, pipes on Windows support `writev` on the libuv side. This allows for some simplification, and makes the `StreamBase` API more uniform (multi-buffer `Write()` is always supported now, including when used by other non-JS consumers like HTTP/2). PR-URL: https://github.com/nodejs/node/pull/21527 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-06-30src: remove extra `ReadStop()` callAnna Henningsen
This is no longer necessary since libuv 1.21.0. PR-URL: https://github.com/nodejs/node/pull/21528 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-06-29n-api: add API for asynchronous functionsGabriel Schulhof
Bundle a `uv_async_t`, a `uv_idle_t`, a `uv_mutex_t`, a `uv_cond_t`, and a `v8::Persistent<v8::Function>` to make it possible to call into JS from another thread. The API accepts a void data pointer and a callback which will be invoked on the loop thread and which will receive the `napi_value` representing the JavaScript function to call so as to perform the call into JS. The callback is run inside a `node::CallbackScope`. A `std::queue<void*>` is used to store calls from the secondary threads, and an idle loop is started by the `uv_async_t` callback on the loop thread to drain the queue, calling into JS with each item. Items can be added to the queue blockingly or non-blockingly. The thread-safe function can be referenced or unreferenced, with the same semantics as libuv handles. Re: https://github.com/nodejs/help/issues/1035 Re: https://github.com/nodejs/node/issues/20964 Fixes: https://github.com/nodejs/node/issues/13512 PR-URL: https://github.com/nodejs/node/pull/17887 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-06-29src: slightly simplify `FSEventWrap`Anna Henningsen
We don’t need to track `initialized_`, `HandleWrap` already does that for us. PR-URL: https://github.com/nodejs/node/pull/21533 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-06-28src: add null check to GetCategoryGroupEnabled()cjihrig
The input to this function shouldn't be null, and callers are not equipped to deal with a nullptr return value. Change the nullptr return to a CHECK_NOT_NULL(). Also fix the indentation of the function. PR-URL: https://github.com/nodejs/node/pull/21545 Fixes: https://github.com/nodejs/node/issues/19991 Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-06-28inspector: use js_app.html as the landing page for chrome devtoolsGauthamBanasandra
As of this commit in chromium - https://chromium-review.googlesource.com/c/chromium/src/+/905450 a new landing page (js_app.html) has been added and inspector.html has been made as the fallback page. Another motivation for this patch is the following bug in chromium - https://bugs.chromium.org/p/chromium/issues/detail?id=846642 due to which, source maps won't get applied with inspector.html, but works with js_app.html In order to maintain compatibility, this patch adds a URL "devtoolsFrontendUrlCompat" to the response of /json/list REST API so that those using Chrome browsers older than 66.0.3345.0 could use this to open DevTools. PR-URL: https://github.com/nodejs/node/pull/21385 Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=846642 Refs: https://chromium-review.googlesource.com/c/chromium/src/+/905450 Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com>
2018-06-27src: move context bootstrap to jsGus Caplan
PR-URL: https://github.com/nodejs/node/pull/21518 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-06-27fs: undeprecate lchown()cjihrig
uv_fs_lchown() exists, as of libuv 1.21.0. fs.lchown() can now be undeprecated. This commit also adds tests, as there were none. PR-URL: https://github.com/nodejs/node/pull/21498 Fixes: https://github.com/nodejs/node/issues/19868 Reviewed-By: Wyatt Preul <wpreul@gmail.com>
2018-06-27build: speed up startup with V8 code cacheJoyee Cheung
This patch speeds up the startup time and reduce the startup memory footprint by using V8 code cache when comiling builtin modules. The current approach is demonstrated in the `with-code-cache` Makefile target (no corresponding Windows target at the moment). 1. Build the binary normally (`src/node_code_cache_stub.cc` is used), by now `internalBinding('code_cache')` is an empty object 2. Run `tools/generate_code_cache.js` with the binary, which generates the code caches by reading source code of builtin modules off source code exposed by `require('internal/bootstrap/cache').builtinSource` and then generate a C++ file containing static char arrays of the code cache, using a format similar to `node_javascript.cc` 3. Run `configure` with the `--code-cache-path` option so that the newly generated C++ file will be used when compiling the new binary. The generated C++ file will put the cache into the `internalBinding('code_cache')` object with the module ids as keys 4. The new binary tries to read the code cache from `internalBinding('code_cache')` and use it to compile builtin modules. If the cache is used, it will put the id into `require('internal/bootstrap/cache').compiledWithCache` for bookkeeping, otherwise the id will be pushed into `require('internal/bootstrap/cache').compiledWithoutCache` This patch also added tests that verify the code cache is generated and used when compiling builtin modules. The binary with code cache: - Is ~1MB bigger than the binary without code cahe - Consumes ~1MB less memory during start up - Starts up about 60% faster PR-URL: https://github.com/nodejs/node/pull/21405 Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host>