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

Unified Diff: runtime/vm/snapshot.cc

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/object.cc ('k') | runtime/vm/snapshot_ids.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 9c7997583372c672287080ad6e83e0de8e631cf6..9d794fb6105864c257db464731f247c4f1478a29 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -1333,6 +1333,13 @@ RawObject* SnapshotReader::ReadVMIsolateObject(intptr_t header_value) {
}
}
+ // Check if it is a singleton ICData array object.
+ for (intptr_t i = 0; i < ICData::kCachedICDataArrayCount; i++) {
+ if (object_id == (kCachedICDataArray0 + i)) {
+ return ICData::cached_icdata_arrays_[i];
+ }
+ }
+
ASSERT(Symbols::IsVMSymbolId(object_id));
return Symbols::GetVMSymbol(object_id); // return VM symbol.
}
@@ -1675,6 +1682,14 @@ bool SnapshotWriter::HandleVMIsolateObject(RawObject* rawobj) {
}
}
+ // Check if it is a singleton ICData array object.
+ for (intptr_t i = 0; i < ICData::kCachedICDataArrayCount; i++) {
+ if (rawobj == ICData::cached_icdata_arrays_[i]) {
+ WriteVMIsolateObject(kCachedICDataArray0 + i);
+ return true;
+ }
+ }
+
if (kind() == Snapshot::kFull) {
// Check it is a predefined symbol in the VM isolate.
id = Symbols::LookupVMSymbol(rawobj);
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/snapshot_ids.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698