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

Unified Diff: runtime/vm/object.h

Issue 1410573006: Cache initial (empty) ic_data arrays so that they are not repeatedly allocated. Factor out descript… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: address comment Created 5 years, 2 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/dart.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 9ae58737b5076bbf0eb595532deb686034907d04..44fb850c7dc651198fb2d79e09c08752a3ae77f1 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -2012,6 +2012,13 @@ class ICData : public Object {
intptr_t token_pos,
bool is_static_call) const;
+ // Initialize the preallocated empty ICData entry arrays.
+ static void InitOnce();
+
+ enum {
+ kCachedICDataArrayCount = 4
+ };
+
private:
static RawICData* New();
@@ -2051,10 +2058,24 @@ class ICData : public Object {
#endif // DEBUG
intptr_t TestEntryLength() const;
+ static RawArray* NewNonCachedEmptyICDataArray(intptr_t num_args_tested);
+ static RawArray* NewEmptyICDataArray(intptr_t num_args_tested);
+ static RawICData* NewDescriptor(Zone* zone,
+ const Function& owner,
+ const String& target_name,
+ const Array& arguments_descriptor,
+ intptr_t deopt_id,
+ intptr_t num_args_tested);
+
static void WriteSentinel(const Array& data, intptr_t test_entry_length);
+ // A cache of VM heap allocated preinitialized empty ic data entry arrays.
+ static RawArray* cached_icdata_arrays_[kCachedICDataArrayCount];
+
FINAL_HEAP_OBJECT_IMPLEMENTATION(ICData, Object);
friend class Class;
+ friend class SnapshotReader;
+ friend class SnapshotWriter;
};
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698