diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/jit-test/tests/ion/invalidation/framedescriptors.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/ion/invalidation/framedescriptors.js')
-rw-r--r-- | js/src/jit-test/tests/ion/invalidation/framedescriptors.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/invalidation/framedescriptors.js b/js/src/jit-test/tests/ion/invalidation/framedescriptors.js new file mode 100644 index 0000000000..562ddf9f66 --- /dev/null +++ b/js/src/jit-test/tests/ion/invalidation/framedescriptors.js @@ -0,0 +1,40 @@ +var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ +function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} +function core_md5(x, len) { + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + for(var i = 0; i < x.length; i += 16) + c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); +} +function md5_cmn(q, a, b, x, s, t) { + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); +} +function md5_ff(a, b, c, d, x, s, t) { + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); +} +function safe_add(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} +function bit_rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); +} +function str2binl(str) { + var bin = Array(); + var mask = (1 << chrsz) - 1; + for(var i = 0; i < str.length * chrsz; i += chrsz) + bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); + return bin; +} +function binl2hex(binarray) {} +var plainText = "Rebellious subjects, enemies to peace,\n\ +Throw your mistemper'd weapons to the ground,\n\ +To know our further pleasure in this case,\n\ +To old Free-town, our common judgment-place.\n\ +Once more, on pain of death, all men depart." +for (var i = 0; i <4; i++) + plainText += plainText; +var md5Output = hex_md5(plainText); |