Commit c1ad4789 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

Resize identity map by doubling instead of quadrupling.

Perf-sheriffs please revert if this causes any performance regressions.

BUG=

Change-Id: I39075482f3c85d69407d6d8e5643d94c1a4425c2
Reviewed-on: https://chromium-review.googlesource.com/461117Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51470}
parent eac4b59f
......@@ -11,7 +11,7 @@ namespace v8 {
namespace internal {
static const int kInitialIdentityMapSize = 4;
static const int kResizeFactor = 4;
static const int kResizeFactor = 2;
IdentityMapBase::~IdentityMapBase() {
// Clear must be called by the subclass to avoid calling the virtual
......@@ -87,7 +87,8 @@ void* IdentityMapBase::DeleteIndex(int index) {
size_--;
DCHECK_GE(size_, 0);
if (size_ * kResizeFactor < capacity_ / kResizeFactor) {
if (capacity_ > kInitialIdentityMapSize &&
size_ * kResizeFactor < capacity_ / kResizeFactor) {
Resize(capacity_ / kResizeFactor);
return ret_value; // No need to fix collisions as resize reinserts keys.
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment