0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools
Joyee Cheung bd765d61d7
src: compile native modules and their code cache in C++
This patch refactors out a part of NativeModule.prototype.compile
(in JS land) into a C++ NativeModule class, this enables a
couple of possibilities:

1. By moving the code to the C++ land, we have more opportunity
  to specialize the compilation process of the native modules
  (e.g. compilation options, code cache) that is orthogonal to
  how user land modules are compiled
2. We can reuse the code to compile bootstrappers and context
  fixers and enable them to be compiled with the code cache later,
  since they are not loaded by NativeModule in the JS land their
  caching must be done in C++.
3. Since there is no need to pass the static data to JS for
  compilation anymore, this enables us to use
  (std::map<std::string, const char*>) in the generated
  node_code_cache.cc and node_javascript.cc later, and scope
  every actual access to the source of native modules to a
  std::map lookup instead of a lookup on a v8::Object in
  dictionary mode.

This patch also refactor the code cache generator and tests
a bit and trace the `withCodeCache` and `withoutCodeCache`
in a Set instead of an Array, and makes sure that all the cachable
builtins are tested.

PR-URL: https://github.com/nodejs/node/pull/24221
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-11-15 02:30:40 +08:00
..
bootstrap
clang-format tools: add missing package-lock to clang-format 2018-08-25 17:09:59 +02:00
configure.d tools, icu: actually failover if there are multiple URLs 2018-10-24 08:27:19 -07:00
doc tools: update alternative docs versions 2018-11-02 01:04:57 -04:00
eslint-rules tools: add no-duplicate-requires rule 2018-07-12 16:11:11 -05:00
gyp Revert "tools,gyp: don't force build actions with multiple outputs" 2018-10-04 08:53:49 -07:00
icu deps: icu 63.1 bump (CLDR 34) 2018-10-24 08:27:36 -07:00
inspector_protocol inspector: add inspector_protocol as a direct dependency 2018-08-10 18:03:43 -07:00
jinja2 inspector: add inspector_protocol as a direct dependency 2018-08-10 18:03:43 -07:00
macos-installer
markupsafe inspector: add inspector_protocol as a direct dependency 2018-08-10 18:03:43 -07:00
msvs win: add customization warning to tools script 2018-11-14 17:33:29 +00:00
node_modules tools: update ESLint to 5.9.0 2018-11-12 14:14:31 -08:00
node-lint-md-cli-rollup tools: enable 80-char line length markdown linting 2018-11-07 09:27:33 -08:00
pip build: add lint-py which uses flake8 2018-10-24 17:19:28 -04:00
pkgsrc src,tools: use https://nodejs.org URL when possible. 2018-07-14 11:57:59 +02:00
rpm src,tools: use https://nodejs.org URL when possible. 2018-07-14 11:57:59 +02:00
.eslintrc.yaml
build-addons.js build: build addon tests in parallel 2018-06-11 20:09:28 +02:00
certdata.txt
check_macros.py
check-imports.py
compress_json.py
cpplint.py benchmark,doc,lib,src,test,tools: fix typos 2018-10-09 16:53:12 +03:00
create_android_makefiles
create_expfile.sh
dcheck_macros.py
generate_code_cache.js src: compile native modules and their code cache in C++ 2018-11-15 02:30:40 +08:00
genv8constants.py benchmark,doc,lib,src,test,tools: fix typos 2018-10-09 16:53:12 +03:00
getmoduleversion.py
getnodeversion.py tools: make getnodeversion.py python3-compatible 2018-07-19 19:19:30 +02:00
gyp_node.py
install.py tools: remove lldbinit file from install script 2018-09-07 21:07:43 +02:00
js2c.py src: perform integrity checks on built-in code cache 2018-08-18 05:21:52 +08:00
license2rtf.js
license-builder.sh deps: introduce llhttp 2018-11-10 17:54:21 -05:00
lint-js.js benchmark,doc,lib,src,test,tools: fix typos 2018-10-09 16:53:12 +03:00
lint-md.js tools: enable 80-char line length markdown linting 2018-11-07 09:27:33 -08:00
lint-pr-commit-message.sh tools: add script to lint first PR commit message 2018-11-04 00:22:30 -07:00
lsan_suppressions.txt
macos-firewall.sh
make-v8.sh build,tools: update make-v8.sh for s390x 2018-11-09 16:13:46 -08:00
mk-ca-bundle.pl
mkssldef.py
nodcheck_macros.py
osx-codesign.sh
osx-pkg-postinstall.sh
osx-productsign.sh
release.sh
run-valgrind.py
run-worker.js worker: rename to worker_threads 2018-06-06 19:44:15 +02:00
sign.bat
specialize_node_d.py
test-npm-package.js
test-v8.bat
test.py test: move benchmark tests out of main test suite 2018-11-10 22:44:26 -08:00
update-authors.js tools: implement update-authors in JS 2018-09-14 18:58:25 +02:00
update-babel-eslint.sh tools: update dmn to 2.0.0 2018-09-06 13:06:54 -07:00
update-eslint.sh tools: update dmn to 2.0.0 2018-09-06 13:06:54 -07:00
utils.py