diff --git a/src/identity-map.cc b/src/identity-map.cc index 14d4a850e1..45969a60a2 100644 --- a/src/identity-map.cc +++ b/src/identity-map.cc @@ -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 @@ -86,7 +86,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. }