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

Function Word32And

deps/v8/test/mjsunit/asm/word32and.js:9–21  ·  view source on GitHub ↗
(rhs)

Source from the content-addressed store, hash-verified

7var heap = new ArrayBuffer(64 * 1024);
8
9function Word32And(rhs) {
10 var name = "and_0x" + Number(rhs).toString(16);
11 var m = eval(
12 'function Module(stdlib, foreign, heap) {\n' +
13 ' "use asm";\n' +
14 ' function ' + name + '(lhs) {\n' +
15 ' lhs = lhs | 0;\n' +
16 ' return (lhs & 0x' + Number(rhs).toString(16) + ') | 0;\n' +
17 ' }\n' +
18 ' return { f: ' + name + '}\n' +
19 '}; Module');
20 return m(stdlib, foreign, heap).f;
21}
22
23var masks = [0xffffffff, 0xf0f0f0f0, 0x80ffffff, 0x07f77f0f, 0xdeadbeef,
24 0x0fffff00, 0x0ff0, 0xff, 0x00];

Callers 1

word32and.jsFile · 0.85

Calls 3

evalFunction · 0.50
mFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected