Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 4cb204d3e98847c69f2c437964968dc5c6a10eaa..dfc3c8019378a5c344ef33b8e8e40464eb07940a 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -4500,7 +4500,7 @@ void Class::InsertCanonicalNumber(Zone* zone, |
Array& canonical_list = Array::Handle(zone, constants()); |
const intptr_t list_len = canonical_list.Length(); |
if (index >= list_len) { |
- const intptr_t new_length = (list_len == 0) ? 4 : list_len + 4; |
+ const intptr_t new_length = list_len + 4 + (list_len >> 2); |
Vyacheslav Egorov (Google)
2017/04/10 10:59:28
This CL contains seemingly unrelated changes in th
erikcorry
2017/04/19 15:06:41
Done.
|
canonical_list ^= Array::Grow(canonical_list, new_length, Heap::kOld); |
set_constants(canonical_list); |
} |
@@ -5050,8 +5050,7 @@ RawTypeArguments* TypeArguments::InstantiateAndCanonicalizeFrom( |
if ((index + 2) >= length) { |
// Grow the instantiations array. |
// The initial array is Object::zero_array() of length 1. |
- length = (length > 64) ? (length + 64) |
- : ((length == 1) ? 3 : ((length - 1) * 2 + 1)); |
+ length = length + 2 + (length >> 2); |
prior_instantiations = |
Array::Grow(prior_instantiations, length, Heap::kOld); |
set_instantiations(prior_instantiations); |
@@ -10744,7 +10743,7 @@ void Library::AddImport(const Namespace& ns) const { |
Array& imports = Array::Handle(this->imports()); |
intptr_t capacity = imports.Length(); |
if (num_imports() == capacity) { |
- capacity = capacity + kImportsCapacityIncrement; |
+ capacity = capacity + kImportsCapacityIncrement + (capacity >> 2); |
imports = Array::Grow(imports, capacity); |
StorePointer(&raw_ptr()->imports_, imports.raw()); |
} |
@@ -11304,7 +11303,7 @@ void LibraryPrefix::AddImport(const Namespace& import) const { |
const intptr_t length = (imports.IsNull()) ? 0 : imports.Length(); |
// Grow the list if it is full. |
if (num_current_imports >= length) { |
- const intptr_t new_length = length + kIncrementSize; |
+ const intptr_t new_length = length + kIncrementSize + (length >> 2); |
imports = Array::Grow(imports, new_length, Heap::kOld); |
set_imports(imports); |
} |
@@ -13753,19 +13752,6 @@ bool ICData::HasOneTarget() const { |
} |
-bool ICData::HasOnlyDispatcherOrImplicitAccessorTargets() const { |
- const intptr_t len = NumberOfChecks(); |
- Function& target = Function::Handle(); |
- for (intptr_t i = 0; i < len; i++) { |
- target = GetTargetAt(i); |
- if (!target.IsDispatcherOrImplicitAccessor()) { |
- return false; |
- } |
- } |
- return true; |
-} |
- |
- |
void ICData::GetUsedCidsForTwoArgs(GrowableArray<intptr_t>* first, |
GrowableArray<intptr_t>* second) const { |
ASSERT(NumArgsTested() == 2); |