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

Unified Diff: src/js/collection.js

Issue 2109483004: [builtins] Drop the special MathRandomRaw. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix off-by-one. Created 4 years, 6 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 | « no previous file | src/js/math.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/collection.js
diff --git a/src/js/collection.js b/src/js/collection.js
index bbb7ed247bb5d851b4e96d5b1f64e87ea412f9c9..be6afe0ccfd7d8f251eead6f99b037b933a29ae5 100644
--- a/src/js/collection.js
+++ b/src/js/collection.js
@@ -14,7 +14,7 @@ var GlobalMap = global.Map;
var GlobalObject = global.Object;
var GlobalSet = global.Set;
var hashCodeSymbol = utils.ImportNow("hash_code_symbol");
-var IntRandom;
+var MathRandom;
var MakeTypeError;
var MapIterator;
var NumberIsNaN;
@@ -23,7 +23,7 @@ var speciesSymbol = utils.ImportNow("species_symbol");
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
- IntRandom = from.IntRandom;
+ MathRandom = from.MathRandom;
MakeTypeError = from.MakeTypeError;
MapIterator = from.MapIterator;
NumberIsNaN = from.NumberIsNaN;
@@ -113,7 +113,7 @@ function GetExistingHash(key) {
function GetHash(key) {
var hash = GetExistingHash(key);
if (IS_UNDEFINED(hash)) {
- hash = IntRandom() | 0;
+ hash = (MathRandom() * 0x40000000) | 0;
if (hash === 0) hash = 1;
SET_PRIVATE(key, hashCodeSymbol, hash);
}
« no previous file with comments | « no previous file | src/js/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698