summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug1791520.js
blob: aca91c2a7f217d8bfe218ea5a1d6619b619c76c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
function testAtomicsAdd() {
  var x;
  for (var i = 0; i < 100; ++i) {
    var a = new BigInt64Array(2);
    x = Atomics.add(a, i & 1, 1n);
  }
  return x;
}

function testAtomicsSub() {
  var x;
  for (var i = 0; i < 100; ++i) {
    var a = new BigInt64Array(2);
    x = Atomics.sub(a, i & 1, 1n);
  }
  return x;
}

function testAtomicsAnd() {
  var x;
  for (var i = 0; i < 100; ++i) {
    var a = new BigInt64Array(2);
    x = Atomics.and(a, i & 1, 1n);
  }
  return x;
}

function testAtomicsOr() {
  var x;
  for (var i = 0; i < 100; ++i) {
    var a = new BigInt64Array(2);
    x = Atomics.or(a, i & 1, 1n);
  }
  return x;
}

function testAtomicsXor() {
  var x;
  for (var i = 0; i < 100; ++i) {
    var a = new BigInt64Array(2);
    x = Atomics.xor(a, i & 1, 1n);
  }
  return x;
}

function testAtomicsExchange() {
  var x;
  for (var i = 0; i < 100; ++i) {
    var a = new BigInt64Array(2);
    x = Atomics.exchange(a, i & 1, 0n);
  }
  return x;
}

function testAtomicsCompareExchange() {
  var x;
  for (var i = 0; i < 100; ++i) {
    var a = new BigInt64Array(2);
    x = Atomics.compareExchange(a, i & 1, 0n, 0n);
  }
  return x;
}

function testAtomicsLoad() {
  var x;
  for (var i = 0; i < 100; ++i) {
    var a = new BigInt64Array(2);
    x = Atomics.load(a, i & 1);
  }
  return x;
}

function testLoadElement() {
  var x;
  for (var i = 0; i < 100; ++i) {
    var a = new BigInt64Array(2);
    x = a[i & 1];
  }
  return x;
}

gczeal(14);

testAtomicsAdd();
testAtomicsSub();
testAtomicsAnd();
testAtomicsOr();
testAtomicsXor();
testAtomicsExchange();
testAtomicsCompareExchange();
testAtomicsLoad();
testLoadElement();