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

Unified Diff: src/isolate.cc

Issue 2395233003: [modules] Give Module an internal [hash] field (Closed)
Patch Set: Fix merge 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') | no next file with comments »
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 e8a9fe2061fec74da5649838d2eb566b933fa725..9b8bddad3d269d6223d614f96d95688276e2978a 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698