Skip to content

Commit ffaf389

Browse files
committed
fixup! src: simplify NativeModule caching and remove redudant data
1 parent 794327b commit ffaf389

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

benchmark/fixtures/require-cachable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const list = require('internal/bootstrap/cache');
44
const {
55
isMainThread
6-
} = require('internal/worker');
6+
} = require('worker_threads');
77

88
for (const key of list.cachableBuiltins) {
99
if (!isMainThread && key === 'trace_events') {

lib/internal/bootstrap/cache.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const {
1010
getCodeCache, compileFunction
1111
} = internalBinding('native_module');
1212
const { hasTracing, hasInspector } = process.binding('config');
13-
const { getOptionValue } = require('internal/options');
1413

1514
// Modules with source code compiled in js2c that
1615
// cannot be compiled with the code cache.
@@ -64,10 +63,6 @@ if (!process.versions.openssl) {
6463
);
6564
}
6665

67-
if (!getOptionValue('--experimental-worker')) {
68-
cannotUseCache.push('worker_threads');
69-
}
70-
7166
const cachableBuiltins = [];
7267
for (const id of NativeModule.map.keys()) {
7368
if (id.startsWith('internal/deps')) {

test/code-cache/test-code-cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
// Flags: --expose-internals --experimental-worker
3+
// Flags: --expose-internals
44
// This test verifies that if the binary is compiled with code cache,
55
// and the cache is used when built in modules are compiled.
66
// Otherwise, verifies that no cache is used when compiling builtins.

test/parallel/test-internal-module-require.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
const common = require('../common');
1111

1212
if (!common.isMainThread) {
13-
common.skip('Implicit changes to the builtin list from the test runner');
13+
common.skip('Cannot test the existence of --expose-internals from worker');
1414
}
1515

1616
const assert = require('assert');
@@ -69,6 +69,7 @@ const expectedPublicModules = new Set([
6969
'util',
7070
'v8',
7171
'vm',
72+
'worker_threads',
7273
'zlib'
7374
]);
7475

0 commit comments

Comments
 (0)