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 (function(global, utils) { | 5 (function(global, utils) { |
6 "use strict"; | 6 "use strict"; |
7 | 7 |
8 %CheckIsBootstrapping(); | 8 %CheckIsBootstrapping(); |
9 | 9 |
10 // ------------------------------------------------------------------- | 10 // ------------------------------------------------------------------- |
11 // Imports | 11 // Imports |
12 | 12 |
13 // The first two slots are reserved to persist PRNG state. | 13 // The first two slots are reserved to persist PRNG state. |
14 define kRandomNumberStart = 2; | 14 define kRandomNumberStart = 2; |
15 | 15 |
16 var GlobalFloat64Array = global.Float64Array; | 16 var GlobalFloat64Array = global.Float64Array; |
17 var GlobalMath = global.Math; | 17 var GlobalMath = global.Math; |
18 var GlobalObject = global.Object; | 18 var GlobalObject = global.Object; |
19 var InternalArray = utils.InternalArray; | |
20 var NaN = %GetRootNaN(); | 19 var NaN = %GetRootNaN(); |
21 var nextRandomIndex = 0; | 20 var nextRandomIndex = 0; |
22 var randomNumbers = UNDEFINED; | 21 var randomNumbers = UNDEFINED; |
23 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | 22 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
24 | 23 |
25 //------------------------------------------------------------------- | 24 //------------------------------------------------------------------- |
26 | 25 |
27 // ECMA 262 - 15.8.2.1 | 26 // ECMA 262 - 15.8.2.1 |
28 function MathAbs(x) { | 27 function MathAbs(x) { |
29 x = +x; | 28 x = +x; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // ------------------------------------------------------------------- | 214 // ------------------------------------------------------------------- |
216 // Exports | 215 // Exports |
217 | 216 |
218 utils.Export(function(to) { | 217 utils.Export(function(to) { |
219 to.MathAbs = MathAbs; | 218 to.MathAbs = MathAbs; |
220 to.MathExp = MathExp; | 219 to.MathExp = MathExp; |
221 to.IntRandom = MathRandomRaw; | 220 to.IntRandom = MathRandomRaw; |
222 }); | 221 }); |
223 | 222 |
224 }) | 223 }) |
OLD | NEW |