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

Function Module

deps/v8/test/mjsunit/asm/atomics-or.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 or = stdlib.Atomics.or;
14 var fround = stdlib.Math.fround;
15
16 function ori8(i, x) {
17 i = i | 0;
18 x = x | 0;
19 return or(MEM8, i, x)|0;
20 }
21
22 function ori16(i, x) {
23 i = i | 0;
24 x = x | 0;
25 return or(MEM16, i, x)|0;
26 }
27
28 function ori32(i, x) {
29 i = i | 0;
30 x = x | 0;
31 return or(MEM32, i, x)|0;
32 }
33
34 function oru8(i, x) {
35 i = i | 0;
36 x = x >>> 0;
37 return or(MEMU8, i, x)>>>0;
38 }
39
40 function oru16(i, x) {
41 i = i | 0;
42 x = x >>> 0;
43 return or(MEMU16, i, x)>>>0;
44 }
45
46 function oru32(i, x) {
47 i = i | 0;
48 x = x >>> 0;
49 return or(MEMU32, i, x)>>>0;
50 }
51
52 return {
53 ori8: ori8,
54 ori16: ori16,
55 ori32: ori32,
56 oru8: oru8,
57 oru16: oru16,
58 oru32: oru32,
59 };
60}
61
62var sab = new SharedArrayBuffer(16);

Callers 1

atomics-or.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected