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

Unified Diff: runtime/vm/code_generator.cc

Issue 51653006: Track live instance and allocation counts for classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index a3f0c839019a3e61fb1dfc03647720fb78c1ec42..c4b2f2b2c961e158f30ba083d5c906baac671ba2 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -14,6 +14,7 @@
#include "vm/debugger.h"
#include "vm/deopt_instructions.h"
#include "vm/exceptions.h"
+#include "vm/heap_class_stats.h"
#include "vm/intermediate_language.h"
#include "vm/object_store.h"
#include "vm/message.h"
@@ -109,6 +110,8 @@ DEFINE_RUNTIME_ENTRY(AllocateArray, 2) {
// Return value: newly allocated object.
DEFINE_RUNTIME_ENTRY(AllocateObject, 3) {
const Class& cls = Class::CheckedHandle(arguments.ArgAt(0));
+ // Report allocate to heap class stats.
+ isolate->heap_class_stats()->AllocateClass(cls.id());
const Instance& instance = Instance::Handle(Instance::New(cls));
arguments.SetReturn(instance);
if (cls.NumTypeArguments() == 0) {

Powered by Google App Engine
This is Rietveld 408576698