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

Side by Side Diff: src/math.js

Issue 1149863005: Move hash code from hidden string to a private symbol (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge 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/isolate.cc ('k') | src/mips/macro-assembler-mips.cc » ('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 (function(global, utils) { 7 (function(global, utils) {
8
9 "use strict"; 8 "use strict";
10 9
11 %CheckIsBootstrapping(); 10 %CheckIsBootstrapping();
12 11
13 // ------------------------------------------------------------------- 12 // -------------------------------------------------------------------
14 // Imports 13 // Imports
15 14
16 var GlobalObject = global.Object; 15 var GlobalObject = global.Object;
17 var InternalArray = utils.InternalArray; 16 var InternalArray = utils.InternalArray;
18 17
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 function MathRandom() { 130 function MathRandom() {
132 var r0 = (MathImul(18030, rngstate[0] & 0xFFFF) + (rngstate[0] >>> 16)) | 0; 131 var r0 = (MathImul(18030, rngstate[0] & 0xFFFF) + (rngstate[0] >>> 16)) | 0;
133 rngstate[0] = r0; 132 rngstate[0] = r0;
134 var r1 = (MathImul(36969, rngstate[1] & 0xFFFF) + (rngstate[1] >>> 16)) | 0; 133 var r1 = (MathImul(36969, rngstate[1] & 0xFFFF) + (rngstate[1] >>> 16)) | 0;
135 rngstate[1] = r1; 134 rngstate[1] = r1;
136 var x = ((r0 << 16) + (r1 & 0xFFFF)) | 0; 135 var x = ((r0 << 16) + (r1 & 0xFFFF)) | 0;
137 // Division by 0x100000000 through multiplication by reciprocal. 136 // Division by 0x100000000 through multiplication by reciprocal.
138 return (x < 0 ? (x + 0x100000000) : x) * 2.3283064365386962890625e-10; 137 return (x < 0 ? (x + 0x100000000) : x) * 2.3283064365386962890625e-10;
139 } 138 }
140 139
140 function MathRandomRaw() {
141 var r0 = (MathImul(18030, rngstate[0] & 0xFFFF) + (rngstate[0] >>> 16)) | 0;
142 rngstate[0] = r0;
143 var r1 = (MathImul(36969, rngstate[1] & 0xFFFF) + (rngstate[1] >>> 16)) | 0;
144 rngstate[1] = r1;
145 var x = ((r0 << 16) + (r1 & 0xFFFF)) | 0;
146 return x & 0x3fffffff;
147 }
148
141 // ECMA 262 - 15.8.2.15 149 // ECMA 262 - 15.8.2.15
142 function MathRound(x) { 150 function MathRound(x) {
143 return %RoundNumber(TO_NUMBER_INLINE(x)); 151 return %RoundNumber(TO_NUMBER_INLINE(x));
144 } 152 }
145 153
146 // ECMA 262 - 15.8.2.17 154 // ECMA 262 - 15.8.2.17
147 function MathSqrtJS(x) { 155 function MathSqrtJS(x) {
148 return %_MathSqrt(+x); 156 return %_MathSqrt(+x);
149 } 157 }
150 158
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 %SetForceInlineFlag(MathSqrtJS); 359 %SetForceInlineFlag(MathSqrtJS);
352 %SetForceInlineFlag(MathTrunc); 360 %SetForceInlineFlag(MathTrunc);
353 361
354 // ------------------------------------------------------------------- 362 // -------------------------------------------------------------------
355 // Exports 363 // Exports
356 364
357 utils.Export(function(to) { 365 utils.Export(function(to) {
358 to.MathAbs = MathAbs; 366 to.MathAbs = MathAbs;
359 to.MathExp = MathExp; 367 to.MathExp = MathExp;
360 to.MathFloor = MathFloorJS; 368 to.MathFloor = MathFloorJS;
369 to.IntRandom = MathRandomRaw;
361 to.MathMax = MathMax; 370 to.MathMax = MathMax;
362 to.MathMin = MathMin; 371 to.MathMin = MathMin;
363 }); 372 });
364 373
365 }) 374 })
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698