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

Unified Diff: src/objects.cc

Issue 8187: Serendipitously arrange the tags so that String.length() becomes a branch-fre... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 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
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 595)
+++ src/objects.cc (working copy)
@@ -3968,10 +3968,12 @@
} else {
payload = v8::internal::HashField(GetHash(), false);
}
- return (payload & 0x00FFFFFF) | (length_ << String::kShortLengthShift);
+ return (payload & ((1 << String::kShortLengthShift) - 1)) |
+ (length_ << String::kShortLengthShift);
} else if (length_ <= String::kMaxMediumStringSize) {
uint32_t payload = v8::internal::HashField(GetHash(), false);
- return (payload & 0x0000FFFF) | (length_ << String::kMediumLengthShift);
+ return (payload & ((1 << String::kMediumLengthShift) - 1)) |
+ (length_ << String::kMediumLengthShift);
} else {
return v8::internal::HashField(length_, false);
}

Powered by Google App Engine
This is Rietveld 408576698