| OLD | NEW | 
|    1 // Copyright 2012 the V8 project authors. All rights reserved. |    1 // Copyright 2012 the V8 project authors. All rights reserved. | 
|    2 // Redistribution and use in source and binary forms, with or without |    2 // Redistribution and use in source and binary forms, with or without | 
|    3 // modification, are permitted provided that the following conditions are |    3 // modification, are permitted provided that the following conditions are | 
|    4 // met: |    4 // met: | 
|    5 // |    5 // | 
|    6 //     * Redistributions of source code must retain the above copyright |    6 //     * Redistributions of source code must retain the above copyright | 
|    7 //       notice, this list of conditions and the following disclaimer. |    7 //       notice, this list of conditions and the following disclaimer. | 
|    8 //     * Redistributions in binary form must reproduce the above |    8 //     * Redistributions in binary form must reproduce the above | 
|    9 //       copyright notice, this list of conditions and the following |    9 //       copyright notice, this list of conditions and the following | 
|   10 //       disclaimer in the documentation and/or other materials provided |   10 //       disclaimer in the documentation and/or other materials provided | 
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  162   } |  162   } | 
|  163   return r; |  163   return r; | 
|  164 } |  164 } | 
|  165  |  165  | 
|  166 // ECMA 262 - 15.8.2.13 |  166 // ECMA 262 - 15.8.2.13 | 
|  167 function MathPow(x, y) { |  167 function MathPow(x, y) { | 
|  168   return %_MathPow(TO_NUMBER_INLINE(x), TO_NUMBER_INLINE(y)); |  168   return %_MathPow(TO_NUMBER_INLINE(x), TO_NUMBER_INLINE(y)); | 
|  169 } |  169 } | 
|  170  |  170  | 
|  171 // ECMA 262 - 15.8.2.14 |  171 // ECMA 262 - 15.8.2.14 | 
 |  172 var rngstate;  // Initialized to a Uint32Array during genesis. | 
|  172 function MathRandom() { |  173 function MathRandom() { | 
|  173   return %_RandomHeapNumber(); |  174   var r0 = (MathImul(18273, rngstate[0] & 0xFFFF) + (rngstate[0] >>> 16)) | 0; | 
 |  175   rngstate[0] = r0; | 
 |  176   var r1 = (MathImul(36969, rngstate[1] & 0xFFFF) + (rngstate[1] >>> 16)) | 0; | 
 |  177   rngstate[1] = r1; | 
 |  178   var x = ((r0 << 16) + (r1 & 0xFFFF)) | 0; | 
 |  179   // Division by 0x100000000 through multiplication by reciprocal. | 
 |  180   return (x < 0 ? (x + 0x100000000) : x) * 2.3283064365386962890625e-10; | 
|  174 } |  181 } | 
|  175  |  182  | 
|  176 // ECMA 262 - 15.8.2.15 |  183 // ECMA 262 - 15.8.2.15 | 
|  177 function MathRound(x) { |  184 function MathRound(x) { | 
|  178   return %RoundNumber(TO_NUMBER_INLINE(x)); |  185   return %RoundNumber(TO_NUMBER_INLINE(x)); | 
|  179 } |  186 } | 
|  180  |  187  | 
|  181 // ECMA 262 - 15.8.2.16 |  188 // ECMA 262 - 15.8.2.16 | 
|  182 function MathSin(x) { |  189 function MathSin(x) { | 
|  183   x = x * 1;  // Convert to number and deal with -0. |  190   x = x * 1;  // Convert to number and deal with -0. | 
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  341     "imul", MathImul |  348     "imul", MathImul | 
|  342   )); |  349   )); | 
|  343  |  350  | 
|  344   %SetInlineBuiltinFlag(MathSin); |  351   %SetInlineBuiltinFlag(MathSin); | 
|  345   %SetInlineBuiltinFlag(MathCos); |  352   %SetInlineBuiltinFlag(MathCos); | 
|  346   %SetInlineBuiltinFlag(MathTan); |  353   %SetInlineBuiltinFlag(MathTan); | 
|  347   %SetInlineBuiltinFlag(TrigonometricInterpolation); |  354   %SetInlineBuiltinFlag(TrigonometricInterpolation); | 
|  348 } |  355 } | 
|  349  |  356  | 
|  350 SetUpMath(); |  357 SetUpMath(); | 
| OLD | NEW |