OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var rngstate; // Initialized to a Uint32Array during genesis. | |
6 | |
7 (function(global, utils) { | 5 (function(global, utils) { |
8 "use strict"; | 6 "use strict"; |
9 | 7 |
10 %CheckIsBootstrapping(); | 8 %CheckIsBootstrapping(); |
11 | 9 |
12 // ------------------------------------------------------------------- | 10 // ------------------------------------------------------------------- |
13 // Imports | 11 // Imports |
14 | 12 |
15 var GlobalMath = global.Math; | 13 var GlobalMath = global.Math; |
16 var GlobalObject = global.Object; | 14 var GlobalObject = global.Object; |
17 var InternalArray = utils.InternalArray; | 15 var InternalArray = utils.InternalArray; |
18 var NaN = %GetRootNaN(); | 16 var NaN = %GetRootNaN(); |
| 17 var rngstate; |
19 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | 18 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
20 | 19 |
| 20 utils.SetupTypedArray(function(arg1, arg2, arg3) { |
| 21 rngstate = arg1; |
| 22 }); |
| 23 |
21 //------------------------------------------------------------------- | 24 //------------------------------------------------------------------- |
22 | 25 |
23 // ECMA 262 - 15.8.2.1 | 26 // ECMA 262 - 15.8.2.1 |
24 function MathAbs(x) { | 27 function MathAbs(x) { |
25 x = +x; | 28 x = +x; |
26 return (x > 0) ? x : 0 - x; | 29 return (x > 0) ? x : 0 - x; |
27 } | 30 } |
28 | 31 |
29 // ECMA 262 - 15.8.2.2 | 32 // ECMA 262 - 15.8.2.2 |
30 function MathAcosJS(x) { | 33 function MathAcosJS(x) { |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 utils.Export(function(to) { | 348 utils.Export(function(to) { |
346 to.MathAbs = MathAbs; | 349 to.MathAbs = MathAbs; |
347 to.MathExp = MathExp; | 350 to.MathExp = MathExp; |
348 to.MathFloor = MathFloorJS; | 351 to.MathFloor = MathFloorJS; |
349 to.IntRandom = MathRandomRaw; | 352 to.IntRandom = MathRandomRaw; |
350 to.MathMax = MathMax; | 353 to.MathMax = MathMax; |
351 to.MathMin = MathMin; | 354 to.MathMin = MathMin; |
352 }); | 355 }); |
353 | 356 |
354 }) | 357 }) |
OLD | NEW |