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

Side by Side Diff: src/math.js

Issue 1143993003: Use shared container to manage imports/exports. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed test for no-snap Created 5 years, 7 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/json.js ('k') | src/messages.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. 5 var rngstate; // Initialized to a Uint32Array during genesis.
6 6
7 var $abs; 7 (function(global, utils) {
8 var $exp;
9 var $floor;
10 var $max;
11 var $min;
12
13 (function(global, shared, exports) {
14 8
15 "use strict"; 9 "use strict";
16 10
17 %CheckIsBootstrapping(); 11 %CheckIsBootstrapping();
18 12
19 // ------------------------------------------------------------------- 13 // -------------------------------------------------------------------
20 // Imports 14 // Imports
21 15
22 var GlobalObject = global.Object; 16 var GlobalObject = global.Object;
23 var InternalArray = shared.InternalArray; 17 var InternalArray = utils.InternalArray;
24 18
25 //------------------------------------------------------------------- 19 //-------------------------------------------------------------------
26 20
27 // ECMA 262 - 15.8.2.1 21 // ECMA 262 - 15.8.2.1
28 function MathAbs(x) { 22 function MathAbs(x) {
29 x = +x; 23 x = +x;
30 return (x > 0) ? x : 0 - x; 24 return (x > 0) ? x : 0 - x;
31 } 25 }
32 26
33 // ECMA 262 - 15.8.2.2 27 // ECMA 262 - 15.8.2.2
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 %SetForceInlineFlag(MathAtanJS); 344 %SetForceInlineFlag(MathAtanJS);
351 %SetForceInlineFlag(MathAtan2JS); 345 %SetForceInlineFlag(MathAtan2JS);
352 %SetForceInlineFlag(MathCeil); 346 %SetForceInlineFlag(MathCeil);
353 %SetForceInlineFlag(MathClz32JS); 347 %SetForceInlineFlag(MathClz32JS);
354 %SetForceInlineFlag(MathFloorJS); 348 %SetForceInlineFlag(MathFloorJS);
355 %SetForceInlineFlag(MathRandom); 349 %SetForceInlineFlag(MathRandom);
356 %SetForceInlineFlag(MathSign); 350 %SetForceInlineFlag(MathSign);
357 %SetForceInlineFlag(MathSqrtJS); 351 %SetForceInlineFlag(MathSqrtJS);
358 %SetForceInlineFlag(MathTrunc); 352 %SetForceInlineFlag(MathTrunc);
359 353
360 // Expose to the global scope. 354 // -------------------------------------------------------------------
361 $abs = MathAbs; 355 // Exports
362 $exp = MathExp; 356
363 $floor = MathFloorJS; 357 utils.Export(function(to) {
364 $max = MathMax; 358 to.MathAbs = MathAbs;
365 $min = MathMin; 359 to.MathExp = MathExp;
360 to.MathFloor = MathFloorJS;
361 to.MathMax = MathMax;
362 to.MathMin = MathMin;
363 });
366 364
367 }) 365 })
OLDNEW
« no previous file with comments | « src/json.js ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698