js/src/jit-test/tests/auto-regress/bug464116.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 // Binary: cache/js-dbg-32-7d06dac3fe83-linux
     2 // Flags: -j
     3 //
     4 function partOfSHA1(str)
     5 {
     6   var rotate_left = function (n,s) { return ( n<<s ) | (n>>>(32-s)); },
     7   W = [], H0 = 0x67452301,
     8   H1 = 0xEFCDAB89, H2 = 0x98BADCFE,
     9   H3 = 0x10325476, H4 = 0xC3D2E1F0,
    10   A, B, C, D, E, temp, str_len = str.length,
    11   word_array = [];
    12   i = 0x080000000;
    13   word_array.push( (str_len<<3)&0x0ffffffff );
    14   for ( blockstart=0; blockstart<word_array.length; blockstart+=16 ) {
    15     A = H0;
    16     B = H1;
    17     C = H2;
    18     D = H3;
    19     E = H4;
    20     for (i= 0; i<=19; ++i) {
    21       temp = (rotate_left(A,5) + ((B&C) | (~B&D)) + E + W[i] + 0x5A827999) & 0x0ffffffff;
    22       E = D;
    23       D = C;
    24       C = rotate_left(B,30);
    25       B = A;
    26       A = temp;
    27     }
    28   }
    29 }
    31 partOfSHA1(1226369254122);

mercurial