Skip to content

Commit e3f5693

Browse files
committed
Implement Atomics functions
1 parent 5c6791a commit e3f5693

7 files changed

Lines changed: 1574 additions & 516 deletions

File tree

ci/runner.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ async function runAll() {
365365
let scheduledCount = 0;
366366
const running = new Set();
367367

368-
async function runSingleComposedTest(f, tmpPath, cleanupTmp, testCwd, isModule, expectedNegative) {
368+
async function runSingleComposedTest(f, tmpPath, cleanupTmp, testCwd, isModule, expectedNegative, needsAgent) {
369369
let currentSucceeds = false;
370370
try {
371371
log(`RUN ${f}`);
@@ -516,7 +516,6 @@ async function runAll() {
516516
}
517517
}
518518
}
519-
if (flagsBlock && flagsBlock.includes('CanBlockIsFalse')) { skip++; log(`SKIP (CanBlockIsFalse) ${f}`); continue; }
520519

521520
// Feature detection
522521
const feats = (meta.match(/features:\s*\[(.*?)\]/s) || [])[1];
@@ -537,13 +536,10 @@ async function runAll() {
537536
// Read test source once and reuse for all checks below
538537
const testSrc = fs.readFileSync(f, 'utf8');
539538

540-
// Detect tests that require $262.agent (multi-threaded worker support)
539+
// Detect tests that require $262.agent (multi-threaded worker support).
540+
// These require an engine-side host implementation. Do not route them through Node,
541+
// because that tests the host shim rather than the Rust engine.
541542
const needsAgent = /\$262\.agent\b/.test(testSrc);
542-
if (needsAgent) {
543-
skip++;
544-
log(`SKIP (agent unsupported in vm mode) ${f}`);
545-
continue;
546-
}
547543

548544
// Handle includes
549545
const includes = parseList(meta, 'includes');
@@ -611,7 +607,7 @@ async function runAll() {
611607

612608
const testCwd = path.dirname(tmpPath);
613609

614-
const p = runSingleComposedTest(f, tmpPath, cleanupTmp, testCwd, isModule, expectedNegative)
610+
const p = runSingleComposedTest(f, tmpPath, cleanupTmp, testCwd, isModule, expectedNegative, needsAgent)
615611
.finally(() => running.delete(p));
616612
running.add(p);
617613
scheduledCount++;

src/core/function_id.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ pub(crate) const BUILTIN_ATOMICS_LOAD: FunctionID = 491;
339339
pub(crate) const BUILTIN_ATOMICS_STORE: FunctionID = 492;
340340
pub(crate) const BUILTIN_ATOMICS_COMPAREEXCHANGE: FunctionID = 493;
341341
pub(crate) const BUILTIN_ATOMICS_ADD: FunctionID = 494;
342+
pub(crate) const BUILTIN_ATOMICS_SUB: FunctionID = 500;
343+
pub(crate) const BUILTIN_ATOMICS_AND: FunctionID = 501;
344+
pub(crate) const BUILTIN_ATOMICS_OR: FunctionID = 502;
345+
pub(crate) const BUILTIN_ATOMICS_XOR: FunctionID = 503;
342346
pub(crate) const BUILTIN_ATOMICS_EXCHANGE: FunctionID = 495;
343347
pub(crate) const BUILTIN_ATOMICS_WAIT: FunctionID = 496;
344348
pub(crate) const BUILTIN_ATOMICS_NOTIFY: FunctionID = 497;

0 commit comments

Comments
 (0)