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

Unified Diff: src/objects-inl.h

Issue 762773002: Don't use ConsStringIterator to compute string hashes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 9172257e6d8c884e5448605c4b7ee6ded30c698c..03aea64736d818f456c748f76a31d583593dc664 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6787,13 +6787,8 @@ uint32_t IteratingStringHasher::Hash(String* string, uint32_t seed) {
// Nothing to do.
if (hasher.has_trivial_hash()) return hasher.GetHashField();
ConsString* cons_string = String::VisitFlat(&hasher, string);
- // The string was flat.
- if (cons_string == NULL) return hasher.GetHashField();
- // This is a ConsString, iterate across it.
- ConsStringIterator iter(cons_string);
- int offset;
- while (NULL != (string = iter.Next(&offset))) {
- String::VisitFlat(&hasher, string, offset);
+ if (cons_string != nullptr) {
+ hasher.VisitConsString(cons_string);
}
return hasher.GetHashField();
}
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698