summaryrefslogtreecommitdiff
path: root/benchmark/fixtures/require-cachable.js
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-04-02 06:04:05 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-04-04 11:16:10 +0800
commite1d55a0cbc9cd921f8403a550cbfae8497d70d1d (patch)
tree5cb588cb3323ce97cd5b599f408d558d28390631 /benchmark/fixtures/require-cachable.js
parentf59ec2abee82f22822b7b3231ca2056fc028a279 (diff)
downloadandroid-node-v8-e1d55a0cbc9cd921f8403a550cbfae8497d70d1d.tar.gz
android-node-v8-e1d55a0cbc9cd921f8403a550cbfae8497d70d1d.tar.bz2
android-node-v8-e1d55a0cbc9cd921f8403a550cbfae8497d70d1d.zip
src: port bootstrap/cache.js to C++
This allows us to query the categories of modules in C++ so we can implement the code cache generator in C++ that does not depend on a Node.js binary. PR-URL: https://github.com/nodejs/node/pull/27046 Refs: https://github.com/nodejs/node/issues/21563 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'benchmark/fixtures/require-cachable.js')
-rw-r--r--benchmark/fixtures/require-cachable.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/benchmark/fixtures/require-cachable.js b/benchmark/fixtures/require-cachable.js
index f651728dc7..4afda3cda4 100644
--- a/benchmark/fixtures/require-cachable.js
+++ b/benchmark/fixtures/require-cachable.js
@@ -1,13 +1,10 @@
'use strict';
-const list = require('internal/bootstrap/cache');
+const { internalBinding } = require('internal/test/binding');
const {
- isMainThread
-} = require('worker_threads');
+ moduleCategories: { canBeRequired }
+} = internalBinding('native_module');
-for (const key of list.cachableBuiltins) {
- if (!isMainThread && key === 'trace_events') {
- continue;
- }
+for (const key of canBeRequired) {
require(key);
}