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

Unified Diff: src/isolate.cc

Issue 2395233003: [modules] Give Module an internal [hash] field (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | src/objects.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index b8fe6b993b4728e1ef092892efd7c8f766156317..5b5997047b96d141b204d229b4c764143c363cf0 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2883,6 +2883,14 @@ base::RandomNumberGenerator* Isolate::random_number_generator() {
return random_number_generator_;
}
+int Isolate::GenerateIdentityHash(uint32_t mask) {
+ int hash;
+ int attempts = 0;
+ do {
+ hash = random_number_generator()->NextInt() & mask;
+ } while (hash == 0 && attempts++ < 30);
+ return hash != 0 ? hash : 1;
+}
Object* Isolate::FindCodeObject(Address a) {
return inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer(a);
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698