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

Unified Diff: runtime/lib/object_patch.dart

Issue 2912863006: Inline instance object hash code into object header on 64 bit. (Closed)
Patch Set: Created 3 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
Index: runtime/lib/object_patch.dart
diff --git a/runtime/lib/object_patch.dart b/runtime/lib/object_patch.dart
index 603911f3ee7034b0895c0baae47e38db80673eda..98874442f2163792b48a13b45bfed0fef68a9123 100644
--- a/runtime/lib/object_patch.dart
+++ b/runtime/lib/object_patch.dart
@@ -21,10 +21,9 @@ class Object {
var result = _getHash(obj);
if (result == 0) {
// We want the hash to be a Smi value greater than 0.
- result = _hashCodeRnd.nextInt(0x40000000);
- while (result == 0) {
+ do {
result = _hashCodeRnd.nextInt(0x40000000);
- }
+ } while (result == 0);
_setHash(obj, result);
}
return result;
« no previous file with comments | « runtime/lib/object.cc ('k') | runtime/vm/become.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698