Commit c56222c9 authored by ishell's avatar ishell Committed by Commit bot

[ic] Avoid feedback metadata names table reallocations.

An attempt to fix memory regression (r38047) caused another regression
because custom capacity chosen for names dictionary implied reallocations
during initialization in some cases.

BUG=chromium:625894,chromium:632231

Review-Url: https://codereview.chromium.org/2394873002
Cr-Commit-Position: refs/heads/master@{#40006}
parent 7a82be3d
......@@ -102,9 +102,7 @@ Handle<TypeFeedbackMetadata> TypeFeedbackMetadata::New(Isolate* isolate,
Handle<UnseededNumberDictionary> names;
if (name_count) {
names = UnseededNumberDictionary::New(
isolate, base::bits::RoundUpToPowerOfTwo32(name_count), TENURED,
USE_CUSTOM_MINIMUM_CAPACITY);
names = UnseededNumberDictionary::New(isolate, name_count, TENURED);
}
int name_index = 0;
......@@ -114,7 +112,10 @@ Handle<TypeFeedbackMetadata> TypeFeedbackMetadata::New(Isolate* isolate,
if (SlotRequiresName(kind)) {
Handle<String> name = spec->GetName(name_index);
DCHECK(!name.is_null());
names = UnseededNumberDictionary::AtNumberPut(names, i, name);
Handle<UnseededNumberDictionary> new_names =
UnseededNumberDictionary::AtNumberPut(names, i, name);
DCHECK_EQ(*new_names, *names);
names = new_names;
name_index++;
}
}
......
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