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

Unified Diff: src/objects.cc

Issue 3258001: Fixing build error r5362 (adding missing files). (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 4 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/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 5361)
+++ src/objects.cc (working copy)
@@ -4989,24 +4989,18 @@
}
-static inline uint32_t HashField(uint32_t hash,
- bool is_array_index,
- int length = -1) {
- uint32_t result = (hash << String::kHashShift);
- if (is_array_index) {
- // For array indexes mix the length into the hash as an array index could
- // be zero.
- ASSERT(length > 0);
- ASSERT(length <= String::kMaxArrayIndexSize);
- ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
- (1 << String::kArrayIndexValueBits));
- ASSERT(String::kMaxArrayIndexSize < (1 << String::kArrayIndexValueBits));
- result &= ~String::kIsNotArrayIndexMask;
- result |= length << String::kArrayIndexHashLengthShift;
- } else {
- result |= String::kIsNotArrayIndexMask;
- }
- return result;
+uint32_t StringHasher::MakeCachedArrayIndex(uint32_t value, int length) {
+ value <<= String::kHashShift;
+ // For array indexes mix the length into the hash as an array index could
+ // be zero.
+ ASSERT(length > 0);
+ ASSERT(length <= String::kMaxArrayIndexSize);
+ ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
+ (1 << String::kArrayIndexValueBits));
+ ASSERT(String::kMaxArrayIndexSize < (1 << String::kArrayIndexValueBits));
+ value &= ~String::kIsNotArrayIndexMask;
+ value |= length << String::kArrayIndexHashLengthShift;
+ return value;
}
@@ -5014,14 +5008,11 @@
ASSERT(is_valid());
if (length_ <= String::kMaxHashCalcLength) {
if (is_array_index()) {
- return v8::internal::HashField(array_index(), true, length_);
- } else {
- return v8::internal::HashField(GetHash(), false);
+ return MakeCachedArrayIndex(array_index(), length_);
}
- uint32_t payload = v8::internal::HashField(GetHash(), false);
- return payload;
+ return (GetHash() << String::kHashShift) | String::kIsNotArrayIndexMask;
} else {
- return v8::internal::HashField(length_, false);
+ return (length_ << String::kHashShift) | String::kIsNotArrayIndexMask;
}
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698