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

Function Module

deps/v8/test/mjsunit/asm/atomics-load.js:5–54  ·  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 load = stdlib.Atomics.load;
14 var fround = stdlib.Math.fround;
15
16 function loadi8(i) {
17 i = i | 0;
18 return load(MEM8, i)|0;
19 }
20
21 function loadi16(i) {
22 i = i | 0;
23 return load(MEM16, i)|0;
24 }
25
26 function loadi32(i) {
27 i = i | 0;
28 return load(MEM32, i)|0;
29 }
30
31 function loadu8(i) {
32 i = i | 0;
33 return load(MEMU8, i)>>>0;
34 }
35
36 function loadu16(i) {
37 i = i | 0;
38 return load(MEMU16, i)>>>0;
39 }
40
41 function loadu32(i) {
42 i = i | 0;
43 return load(MEMU32, i)>>>0;
44 }
45
46 return {
47 loadi8: loadi8,
48 loadi16: loadi16,
49 loadi32: loadi32,
50 loadu8: loadu8,
51 loadu16: loadu16,
52 loadu32: loadu32,
53 };
54}
55
56function clearArray() {
57 var ui8 = new Uint8Array(sab);

Callers 1

atomics-load.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected