MCPcopy Create free account
hub / github.com/nodejs/node / Module

Function Module

deps/v8/test/mjsunit/asm/atomics-add.js:5–60  ·  view source on GitHub ↗
(stdlib, foreign, heap, offset)

Source from the content-addressed store, hash-verified

3// found in the LICENSE file.
4
5function Module(stdlib, foreign, heap, offset) {
6 "use asm";
7 var MEM8 = new stdlib.Int8Array(heap, offset);
8 var MEM16 = new stdlib.Int16Array(heap, offset);
9 var MEM32 = new stdlib.Int32Array(heap, offset);
10 var MEMU8 = new stdlib.Uint8Array(heap, offset);
11 var MEMU16 = new stdlib.Uint16Array(heap, offset);
12 var MEMU32 = new stdlib.Uint32Array(heap, offset);
13 var add = stdlib.Atomics.add;
14 var fround = stdlib.Math.fround;
15
16 function addi8(i, x) {
17 i = i | 0;
18 x = x | 0;
19 return add(MEM8, i, x)|0;
20 }
21
22 function addi16(i, x) {
23 i = i | 0;
24 x = x | 0;
25 return add(MEM16, i, x)|0;
26 }
27
28 function addi32(i, x) {
29 i = i | 0;
30 x = x | 0;
31 return add(MEM32, i, x)|0;
32 }
33
34 function addu8(i, x) {
35 i = i | 0;
36 x = x >>> 0;
37 return add(MEMU8, i, x)>>>0;
38 }
39
40 function addu16(i, x) {
41 i = i | 0;
42 x = x >>> 0;
43 return add(MEMU16, i, x)>>>0;
44 }
45
46 function addu32(i, x) {
47 i = i | 0;
48 x = x >>> 0;
49 return add(MEMU32, i, x)>>>0;
50 }
51
52 return {
53 addi8: addi8,
54 addi16: addi16,
55 addi32: addi32,
56 addu8: addu8,
57 addu16: addu16,
58 addu32: addu32,
59 };
60}
61
62function clearArray() {

Callers 1

atomics-add.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected