Index: runtime/vm/class_table.cc |
diff --git a/runtime/vm/class_table.cc b/runtime/vm/class_table.cc |
index 3b344909d61800df10b8c287bf40293e70de1492..2d14cecab2658306e78524afb043a1bfe9a76415 100644 |
--- a/runtime/vm/class_table.cc |
+++ b/runtime/vm/class_table.cc |
@@ -5,6 +5,7 @@ |
#include "vm/class_table.h" |
#include "vm/flags.h" |
#include "vm/freelist.h" |
+#include "vm/heap_trace.h" |
#include "vm/object.h" |
#include "vm/raw_object.h" |
#include "vm/visitor.h" |
@@ -49,6 +50,9 @@ void ClassTable::Register(const Class& cls) { |
ASSERT(table_[index] == 0); |
ASSERT(index < capacity_); |
table_[index] = cls.raw(); |
+ if (HeapTrace::is_enabled()) { |
+ Isolate::Current()->heap()->trace()->TraceRegisterClass(cls); |
+ } |
// Add the vtable for this predefined class into the static vtable registry |
// if it has not been setup yet. |
cpp_vtable cls_vtable = cls.handle_vtable(); |
@@ -72,6 +76,9 @@ void ClassTable::Register(const Class& cls) { |
ASSERT(top_ < capacity_); |
cls.set_id(top_); |
table_[top_] = cls.raw(); |
+ if (HeapTrace::is_enabled()) { |
+ Isolate::Current()->heap()->trace()->TraceRegisterClass(cls); |
+ } |
top_++; // Increment next index. |
} |
} |