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

Unified Diff: runtime/vm/class_table.cc

Issue 2032153003: Use clustered serialization for full snapshots. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: round2 Created 4 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/class_table.h ('k') | runtime/vm/clustered_snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_table.cc
diff --git a/runtime/vm/class_table.cc b/runtime/vm/class_table.cc
index 9432a1beeeca0f7e8c84c3fc73ea41bd68379715..b7f894c158b001ce3870a43bb17f480cd59354bd 100644
--- a/runtime/vm/class_table.cc
+++ b/runtime/vm/class_table.cc
@@ -143,10 +143,7 @@ void ClassTable::Register(const Class& cls) {
}
-void ClassTable::RegisterAt(intptr_t index, const Class& cls) {
- ASSERT(Thread::Current()->IsMutatorThread());
- ASSERT(index != kIllegalCid);
- ASSERT(index >= kNumPredefinedCids);
+void ClassTable::AllocateIndex(intptr_t index) {
if (index >= capacity_) {
// Grow the capacity of the class table.
// TODO(koda): Add ClassTable::Grow to share code.
@@ -171,15 +168,24 @@ void ClassTable::RegisterAt(intptr_t index, const Class& cls) {
class_heap_stats_table_ = new_stats_table;
ASSERT(capacity_increment_ >= 1);
}
+
ASSERT(table_[index] == 0);
- cls.set_id(index);
- table_[index] = cls.raw();
if (index >= top_) {
top_ = index + 1;
}
}
+void ClassTable::RegisterAt(intptr_t index, const Class& cls) {
+ ASSERT(Thread::Current()->IsMutatorThread());
+ ASSERT(index != kIllegalCid);
+ ASSERT(index >= kNumPredefinedCids);
+ AllocateIndex(index);
+ cls.set_id(index);
+ table_[index] = cls.raw();
+}
+
+
#if defined(DEBUG)
void ClassTable::Unregister(intptr_t index) {
table_[index] = 0;
« no previous file with comments | « runtime/vm/class_table.h ('k') | runtime/vm/clustered_snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698