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

Unified Diff: runtime/vm/isolate.h

Issue 128653004: Use list of isolates in profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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/dart.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.h
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 8356d975e81d9b94c2dbe3f4c24b26b7c81bd5d7..7d3116698afadfd56f870995e325d410b59bd7dc 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -36,6 +36,7 @@ class ICData;
class Instance;
class IsolateProfilerData;
class IsolateSpawnState;
+class InterruptableThreadState;
class LongJumpScope;
class MessageHandler;
class Mutex;
@@ -75,6 +76,19 @@ class ObjectIdRing;
V(TypeParameter) \
V(TypeArguments) \
+
+class IsolateVisitor {
+ public:
+ IsolateVisitor() {}
+ virtual ~IsolateVisitor() {}
+
+ virtual void VisitIsolate(Isolate* isolate) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(IsolateVisitor);
+};
+
+
class Isolate : public BaseIsolate {
public:
~Isolate();
@@ -405,12 +419,23 @@ class Isolate : public BaseIsolate {
profiler_data_ = profiler_data;
}
- IsolateProfilerData* profiler_data() {
+ IsolateProfilerData* profiler_data() const {
return profiler_data_;
}
void PrintToJSONStream(JSONStream* stream);
+ void set_thread_state(InterruptableThreadState* state) {
+ ASSERT((thread_state_ == NULL) || (state == NULL));
+ thread_state_ = state;
+ }
+
+ InterruptableThreadState* thread_state() const {
+ return thread_state_;
+ }
+
+ static void VisitIsolates(IsolateVisitor* visitor);
+
private:
Isolate();
@@ -467,6 +492,10 @@ class Isolate : public BaseIsolate {
IsolateProfilerData* profiler_data_;
Mutex profiler_data_mutex_;
+ InterruptableThreadState* thread_state_;
+
+ // Isolate list next pointer.
+ Isolate* next_;
// Reusable handles support.
#define REUSABLE_HANDLE_FIELDS(object) \
@@ -488,8 +517,16 @@ class Isolate : public BaseIsolate {
static Dart_IsolateInterruptCallback vmstats_callback_;
static Dart_ServiceIsolateCreateCalback service_create_callback_;
+ // Manage list of existing isolates.
+ static void AddIsolateTolist(Isolate* isolate);
+ static void RemoveIsolateFromList(Isolate* isolate);
+ static void CheckForDuplicateThreadState(InterruptableThreadState* state);
+ static Monitor* isolates_list_monitor_;
+ static Isolate* isolates_list_head_;
+
friend class ReusableHandleScope;
friend class ReusableObjectHandleScope;
+
DISALLOW_COPY_AND_ASSIGN(Isolate);
};
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698