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

Unified Diff: runtime/vm/object.h

Issue 2949803002: New growth strategy for growable arrays (Closed)
Patch Set: Branch-free grow size computation. Renamed function names to be clearer. Created 3 years, 6 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 | « runtime/vm/mirrors_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index d5062633402b9c66a7b4e20c46a5eb4e109c01be..6f04341e5cced4d4eb99b47f0ac90e40a29ba7cc 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -7652,7 +7652,10 @@ class Array : public Instance {
// object or a regular Object so that it can be traversed during garbage
// collection. The backing array of the original Growable Object Array is
// set to an empty array.
- static RawArray* MakeArray(const GrowableObjectArray& growable_array);
+ // If the unique parameter is false, the function is allowed to return
+ // a shared Array instance.
+ static RawArray* MakeFixedLength(const GrowableObjectArray& growable_array,
+ bool unique = false);
RawArray* Slice(intptr_t start,
intptr_t count,
@@ -7766,8 +7769,6 @@ class GrowableObjectArray : public Instance {
// reusing the type argument vector of the instantiator.
ASSERT(value.IsNull() || ((value.Length() >= 1) && value.IsInstantiated() &&
value.IsCanonical()));
- const Array& contents = Array::Handle(data());
- contents.SetTypeArguments(value);
StorePointer(&raw_ptr()->type_arguments_, value.raw());
}
@@ -7818,7 +7819,7 @@ class GrowableObjectArray : public Instance {
return &(DataArray()->data()[index]);
}
- static const int kDefaultInitialCapacity = 4;
+ static const int kDefaultInitialCapacity = 0;
FINAL_HEAP_OBJECT_IMPLEMENTATION(GrowableObjectArray, Instance);
friend class Array;
« no previous file with comments | « runtime/vm/mirrors_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698