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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/math.js
diff --git a/src/math.js b/src/math.js
index 29846b05691b877d1ae886259204eba31893b2d2..fc3bf2fcdabf1b4fd5b0083d4b9a219454e388b7 100644
--- a/src/math.js
+++ b/src/math.js
@@ -5,7 +5,6 @@
var rngstate; // Initialized to a Uint32Array during genesis.
(function(global, utils) {
-
"use strict";
%CheckIsBootstrapping();
@@ -138,6 +137,15 @@ function MathRandom() {
return (x < 0 ? (x + 0x100000000) : x) * 2.3283064365386962890625e-10;
}
+function MathRandomRaw() {
+ var r0 = (MathImul(18030, rngstate[0] & 0xFFFF) + (rngstate[0] >>> 16)) | 0;
+ rngstate[0] = r0;
+ var r1 = (MathImul(36969, rngstate[1] & 0xFFFF) + (rngstate[1] >>> 16)) | 0;
+ rngstate[1] = r1;
+ var x = ((r0 << 16) + (r1 & 0xFFFF)) | 0;
+ return x & 0x3fffffff;
+}
+
// ECMA 262 - 15.8.2.15
function MathRound(x) {
return %RoundNumber(TO_NUMBER_INLINE(x));
@@ -358,6 +366,7 @@ utils.Export(function(to) {
to.MathAbs = MathAbs;
to.MathExp = MathExp;
to.MathFloor = MathFloorJS;
+ to.IntRandom = MathRandomRaw;
to.MathMax = MathMax;
to.MathMin = MathMin;
});
« 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