Skip to content

Commit

Permalink
fixup! src: simplify NativeModule caching and remove redudant data
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Jan 9, 2019
1 parent 794327b commit ffaf389
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion benchmark/fixtures/require-cachable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const list = require('internal/bootstrap/cache');
const {
isMainThread
} = require('internal/worker');
} = require('worker_threads');

for (const key of list.cachableBuiltins) {
if (!isMainThread && key === 'trace_events') {
Expand Down
5 changes: 0 additions & 5 deletions lib/internal/bootstrap/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const {
getCodeCache, compileFunction
} = internalBinding('native_module');
const { hasTracing, hasInspector } = process.binding('config');
const { getOptionValue } = require('internal/options');

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

if (!getOptionValue('--experimental-worker')) {
cannotUseCache.push('worker_threads');
}

const cachableBuiltins = [];
for (const id of NativeModule.map.keys()) {
if (id.startsWith('internal/deps')) {
Expand Down
2 changes: 1 addition & 1 deletion test/code-cache/test-code-cache.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

// Flags: --expose-internals --experimental-worker
// Flags: --expose-internals
// This test verifies that if the binary is compiled with code cache,
// and the cache is used when built in modules are compiled.
// Otherwise, verifies that no cache is used when compiling builtins.
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-internal-module-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
const common = require('../common');

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

const assert = require('assert');
Expand Down Expand Up @@ -69,6 +69,7 @@ const expectedPublicModules = new Set([
'util',
'v8',
'vm',
'worker_threads',
'zlib'
]);

Expand Down

0 comments on commit ffaf389

Please sign in to comment.