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

Unified Diff: src/code-stub-assembler.cc

Issue 2827263004: Fix HashTable growth strategy to be 2x instead of 4x (Closed)
Patch Set: update CSA; fix test Created 3 years, 8 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 | « no previous file | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 6e1bde011b7525f40e04694850e26cc0c9421a39..ddaf2934c7b777c2a5a4f1c7a1588310d95d15ad 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -4574,9 +4574,10 @@ template Node* CodeStubAssembler::EntryToIndex<GlobalDictionary>(Node*, int);
template Node* CodeStubAssembler::EntryToIndex<SeededNumberDictionary>(Node*,
int);
+// This must be kept in sync with HashTableBase::ComputeCapacity().
Node* CodeStubAssembler::HashTableComputeCapacity(Node* at_least_space_for) {
- Node* capacity = IntPtrRoundUpToPowerOfTwo32(
- WordShl(at_least_space_for, IntPtrConstant(1)));
+ Node* capacity = IntPtrRoundUpToPowerOfTwo32(IntPtrAdd(
+ at_least_space_for, WordShr(at_least_space_for, IntPtrConstant(1))));
return IntPtrMax(capacity, IntPtrConstant(HashTableBase::kMinCapacity));
}
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698