| 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 // ------------------------------------------------------------------- |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 var approx_hi = MathFloorJS(%_DoubleHi(x) / 3) + 0x2A9F7893; | 216 var approx_hi = MathFloorJS(%_DoubleHi(x) / 3) + 0x2A9F7893; |
| 217 var approx = %_ConstructDouble(approx_hi | 0, 0); | 217 var approx = %_ConstructDouble(approx_hi | 0, 0); |
| 218 approx = NEWTON_ITERATION_CBRT(x, approx); | 218 approx = NEWTON_ITERATION_CBRT(x, approx); |
| 219 approx = NEWTON_ITERATION_CBRT(x, approx); | 219 approx = NEWTON_ITERATION_CBRT(x, approx); |
| 220 approx = NEWTON_ITERATION_CBRT(x, approx); | 220 approx = NEWTON_ITERATION_CBRT(x, approx); |
| 221 return NEWTON_ITERATION_CBRT(x, approx); | 221 return NEWTON_ITERATION_CBRT(x, approx); |
| 222 } | 222 } |
| 223 | 223 |
| 224 // ------------------------------------------------------------------- | 224 // ------------------------------------------------------------------- |
| 225 | 225 |
| 226 %InstallToContext([ |
| 227 "math_pow", MathPowJS, |
| 228 ]); |
| 229 |
| 226 %AddNamedProperty(GlobalMath, toStringTagSymbol, "Math", READ_ONLY | DONT_ENUM); | 230 %AddNamedProperty(GlobalMath, toStringTagSymbol, "Math", READ_ONLY | DONT_ENUM); |
| 227 | 231 |
| 228 // Set up math constants. | 232 // Set up math constants. |
| 229 utils.InstallConstants(GlobalMath, [ | 233 utils.InstallConstants(GlobalMath, [ |
| 230 // ECMA-262, section 15.8.1.1. | 234 // ECMA-262, section 15.8.1.1. |
| 231 "E", 2.7182818284590452354, | 235 "E", 2.7182818284590452354, |
| 232 // ECMA-262, section 15.8.1.2. | 236 // ECMA-262, section 15.8.1.2. |
| 233 "LN10", 2.302585092994046, | 237 "LN10", 2.302585092994046, |
| 234 // ECMA-262, section 15.8.1.3. | 238 // ECMA-262, section 15.8.1.3. |
| 235 "LN2", 0.6931471805599453, | 239 "LN2", 0.6931471805599453, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // Exports | 290 // Exports |
| 287 | 291 |
| 288 utils.Export(function(to) { | 292 utils.Export(function(to) { |
| 289 to.MathAbs = MathAbs; | 293 to.MathAbs = MathAbs; |
| 290 to.MathExp = MathExp; | 294 to.MathExp = MathExp; |
| 291 to.MathFloor = MathFloorJS; | 295 to.MathFloor = MathFloorJS; |
| 292 to.IntRandom = MathRandomRaw; | 296 to.IntRandom = MathRandomRaw; |
| 293 }); | 297 }); |
| 294 | 298 |
| 295 }) | 299 }) |
| OLD | NEW |