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

Unified Diff: runtime/vm/isolate.cc

Issue 464953002: Add VMMetric and some sample metrics (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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/isolate.h ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index eec4191c369d1da9953b42cbd812a695a50016bf..9e89b42e19e5fe1fb190de6c65dd6839417b2697 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -436,6 +436,7 @@ Isolate::Isolate()
thread_state_(NULL),
tag_table_(GrowableObjectArray::null()),
current_tag_(UserTag::null()),
+ metrics_list_head_(NULL),
next_(NULL),
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
@@ -510,9 +511,17 @@ Isolate* Isolate::Init(const char* name_prefix) {
Isolate* result = new Isolate();
ASSERT(result != NULL);
+ // Initialize metrics.
+#define ISOLATE_METRIC_INIT(type, variable, name, unit) \
+ result->metric_##variable##_.Init(result, name, NULL, Metric::unit);
+ ISOLATE_METRIC_LIST(ISOLATE_METRIC_INIT);
+#undef ISOLATE_METRIC_INIT
+
+
// Add to isolate list.
AddIsolateTolist(result);
+
// TODO(5411455): For now just set the recently created isolate as
// the current isolate.
SetCurrent(result);
@@ -1237,6 +1246,18 @@ void Isolate::VisitIsolates(IsolateVisitor* visitor) {
}
+intptr_t Isolate::IsolateListLength() {
+ MonitorLocker ml(isolates_list_monitor_);
+ intptr_t count = 0;
+ Isolate* current = isolates_list_head_;
+ while (current != NULL) {
+ count++;
+ current = current->next_;
+ }
+ return count;
+}
+
+
void Isolate::AddIsolateTolist(Isolate* isolate) {
MonitorLocker ml(isolates_list_monitor_);
ASSERT(isolate != NULL);
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698