Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
73ba853
deps: update V8 to 11.8.172.13
targos Oct 5, 2023
0fef29f
build: reset embedder string to "-node.0"
targos Oct 5, 2023
23bbae2
src: update NODE_MODULE_VERSION to 120
targos Sep 13, 2023
ff43327
deps: always define V8_EXPORT_PRIVATE as no-op
targos Sep 21, 2022
435c47d
deps: silence irrelevant V8 warning
targos Jun 21, 2022
6b80402
deps: disable V8 concurrent sparkplug compilation
targos Apr 6, 2023
ec65678
deps: avoid compilation error with ASan
targos Jul 31, 2023
4b15fec
deps: remove usage of a C++20 feature from V8
targos Aug 10, 2023
525ddd9
deps: patch V8 to avoid duplicated zlib symbol
targos Sep 16, 2023
dc935b6
deps: V8: cherry-pick 1a3ecc2483b2
targos Sep 13, 2023
b32f78b
deps: V8: cherry-pick 93b1a74cbc9b
targos Sep 15, 2023
b3b93c2
deps: V8: cherry-pick b5b5d6c31bb0
targos Sep 22, 2023
aa82ccb
deps: V8: cherry-pick de9a5de2274f
targos Sep 26, 2023
95e9514
deps: V8: cherry-pick 89b3702c92b0
targos Sep 26, 2023
f5f62ef
deps: V8: cherry-pick 8ec2651fbdd8
targos Oct 5, 2023
e4f5a0f
deps: bump minimum ICU version to 73
targos Jul 7, 2023
23e01d9
tools: update V8 gypfiles for 11.4
targos Mar 31, 2023
55e21e0
tools: update V8 gypfiles for 11.5
targos Apr 30, 2023
9485f89
tools: update V8 gypfiles for 11.6
targos Jun 12, 2023
62bd3f6
tools: update V8 gypfiles for 11.7
targos Jul 7, 2023
3a29541
tools: update V8 gypfiles for 11.8
targos Aug 10, 2023
e13172d
tools: add new V8 headers to distribution
targos Mar 31, 2023
4a15c7d
lib: update usage of always on Atomics API
targos Apr 16, 2023
f030296
test: adapt debugger tests to V8 11.4
pfaffe Mar 17, 2023
e12e0ca
test: update flag to disable SharedArrayBuffer
targos Apr 20, 2023
1213ee4
test: adapt test-fs-write to V8 internal changes
targos May 6, 2023
11f1bde
test: adapt REPL test to V8 changes
targos Jul 7, 2023
c37dcaa
test: skip test-tick-processor-arguments on SmartOS
targos Oct 5, 2023
a74cdd8
test: skip v8-updates/test-linux-perf
targos Oct 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lib: update usage of always on Atomics API
  • Loading branch information
targos committed Oct 10, 2023
commit 4a15c7d40292e1d3aef32fb0b18ecb03d87f15c6
4 changes: 0 additions & 4 deletions benchmark/worker/atomics-wait.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ if (typeof SharedArrayBuffer === 'undefined') {
throw new Error('SharedArrayBuffers must be enabled to run this benchmark');
}

if (typeof Atomics === 'undefined') {
throw new Error('Atomics must be enabled to run this benchmark');
}

const common = require('../common.js');
const bench = common.createBenchmark(main, {
n: [1e7],
Expand Down
5 changes: 1 addition & 4 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ rules:
message: Use `const { AbortController } = require('internal/abort_controller');` instead of the global.
- name: AbortSignal
message: Use `const { AbortSignal } = require('internal/abort_controller');` instead of the global.
# Atomics is not available in primordials because it can be
# disabled with --no-harmony-atomics CLI flag.
- name: Atomics
message: Use `const { Atomics } = globalThis;` instead of the global.
- name: Blob
message: Use `const { Blob } = require('buffer');` instead of the global.
- name: BroadcastChannel
Expand Down Expand Up @@ -193,6 +189,7 @@ rules:
- name: AggregateError
- name: Array
- name: ArrayBuffer
- name: Atomics
- name: BigInt
- name: BigInt64Array
- name: BigUint64Array
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/freeze_intrinsics.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const {
ArrayPrototype,
ArrayPrototypeForEach,
ArrayPrototypePush,
Atomics,
BigInt,
BigInt64Array,
BigInt64ArrayPrototype,
Expand Down Expand Up @@ -128,7 +129,6 @@ const {
} = primordials;

const {
Atomics,
Intl,
SharedArrayBuffer,
WebAssembly,
Expand Down
6 changes: 3 additions & 3 deletions lib/internal/main/worker_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const {
ArrayPrototypeForEach,
ArrayPrototypePushApply,
ArrayPrototypeSplice,
AtomicsLoad,
ObjectDefineProperty,
PromisePrototypeThen,
RegExpPrototypeExec,
SafeWeakMap,
globalThis: {
Atomics,
SharedArrayBuffer,
},
} = primordials;
Expand Down Expand Up @@ -112,15 +112,15 @@ port.on('message', (message) => {

require('internal/worker').assignEnvironmentData(environmentData);

if (SharedArrayBuffer !== undefined && Atomics !== undefined) {
if (SharedArrayBuffer !== undefined) {
// The counter is only passed to the workers created by the main thread,
// not to workers created by other workers.
let cachedCwd = '';
let lastCounter = -1;
const originalCwd = process.cwd;

process.cwd = function() {
const currentCounter = Atomics.load(cwdCounter, 0);
const currentCounter = AtomicsLoad(cwdCounter, 0);
if (currentCounter === lastCounter)
return cachedCwd;
lastCounter = currentCounter;
Expand Down
8 changes: 3 additions & 5 deletions lib/internal/modules/esm/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
const {
ArrayPrototypePush,
ArrayPrototypePushApply,
AtomicsLoad,
AtomicsWait,
AtomicsWaitAsync,
Int32Array,
ObjectAssign,
ObjectDefineProperty,
Expand All @@ -15,11 +18,6 @@ const {
} = primordials;

const {
Atomics: {
load: AtomicsLoad,
wait: AtomicsWait,
waitAsync: AtomicsWaitAsync,
},
SharedArrayBuffer,
} = globalThis;

Expand Down
8 changes: 2 additions & 6 deletions lib/internal/modules/esm/worker.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
'use strict';

const {
AtomicsAdd,
AtomicsNotify,
DataViewPrototypeGetBuffer,
Int32Array,
PromisePrototypeThen,
ReflectApply,
SafeSet,
TypedArrayPrototypeGetBuffer,
globalThis: {
Atomics: {
add: AtomicsAdd,
notify: AtomicsNotify,
},
},
} = primordials;
const assert = require('internal/assert');
const { clearImmediate, setImmediate } = require('timers');
Expand Down
1 change: 1 addition & 0 deletions lib/internal/per_context/primordials.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ function copyPrototype(src, dest, prefix) {

// Create copies of the namespace objects
[
'Atomics',
'JSON',
'Math',
'Proxy',
Expand Down
8 changes: 4 additions & 4 deletions lib/internal/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const {
ArrayPrototypeForEach,
ArrayPrototypeMap,
ArrayPrototypePush,
AtomicsAdd,
Float64Array,
FunctionPrototypeBind,
JSONStringify,
Expand All @@ -21,7 +22,7 @@ const {
SymbolFor,
TypedArrayPrototypeFill,
Uint32Array,
globalThis: { Atomics, SharedArrayBuffer },
globalThis: { SharedArrayBuffer },
} = primordials;

const EventEmitter = require('events');
Expand Down Expand Up @@ -101,12 +102,11 @@ let cwdCounter;
const environmentData = new SafeMap();

// SharedArrayBuffers can be disabled with --no-harmony-sharedarraybuffer.
// Atomics can be disabled with --no-harmony-atomics.
if (isMainThread && SharedArrayBuffer !== undefined && Atomics !== undefined) {
if (isMainThread && SharedArrayBuffer !== undefined) {
cwdCounter = new Uint32Array(new SharedArrayBuffer(4));
const originalChdir = process.chdir;
process.chdir = function(path) {
Atomics.add(cwdCounter, 0, 1);
AtomicsAdd(cwdCounter, 0, 1);
originalChdir(path);
};
}
Expand Down
21 changes: 0 additions & 21 deletions test/parallel/test-worker-no-atomics.js

This file was deleted.

6 changes: 3 additions & 3 deletions test/parallel/test-worker-process-cwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (!process.env.HAS_STARTED_WORKER) {
// Normalize the current working dir to also work with the root folder.
process.chdir(__dirname);

assert(!process.cwd.toString().includes('Atomics.load'));
assert.doesNotMatch(process.cwd.toString(), /AtomicsLoad/);

// 1. Start the first worker.
const w = new Worker(__filename);
Expand All @@ -32,7 +32,7 @@ if (!process.env.HAS_STARTED_WORKER) {
// 2. Save the current cwd and verify that `process.cwd` includes the
// Atomics.load call and spawn a new worker.
const cwd = process.cwd();
assert(process.cwd.toString().includes('Atomics.load'));
assert.match(process.cwd.toString(), /AtomicsLoad/);

const w = new Worker(__filename);
w.once('message', common.mustCall((message) => {
Expand All @@ -56,7 +56,7 @@ if (!process.env.HAS_STARTED_WORKER) {
const cwd = process.cwd();
// Send the current cwd to the parent.
parentPort.postMessage(cwd);
assert(process.cwd.toString().includes('Atomics.load'));
assert.match(process.cwd.toString(), /AtomicsLoad/);

parentPort.once('message', common.mustCall((message) => {
// 7. Verify that the current cwd is identical to the received one but
Expand Down