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

Unified Diff: src/objects-inl.h

Issue 769453002: add fast path for hashing small cons strings (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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 34c3f2da0b35402d4bc14f1cdcdbc9377d1a0803..7ba756ed2ebcf7e19897667f0d6a26c61242c08c 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6828,9 +6828,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);
- if (cons_string != nullptr) {
- hasher.VisitConsString(cons_string);
- }
+ if (cons_string == nullptr) return hasher.GetHashField();
+ 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