Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: src/js/math.js

Issue 1420473002: Move math-related typed arrays off js builtins object.. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/js/prologue.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 })
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/js/prologue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698