Index: runtime/vm/isolate.h |
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h |
index 8356d975e81d9b94c2dbe3f4c24b26b7c81bd5d7..ca835d1683e94bf5ca4ebaf6ae195f5302c891be 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,17 @@ class ObjectIdRing; |
V(TypeParameter) \ |
V(TypeArguments) \ |
+ |
+class IsolateVisitor { |
+ public: |
+ virtual ~IsolateVisitor() {} |
+ |
+ virtual void VisitIsolate(Isolate* isolate) = 0; |
+ |
+ private: |
siva
2014/02/06 00:37:24
DISALLOW stuff here?
Cutch
2014/02/06 17:51:51
Done.
|
+}; |
+ |
+ |
class Isolate : public BaseIsolate { |
public: |
~Isolate(); |
@@ -405,12 +417,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 +490,7 @@ class Isolate : public BaseIsolate { |
IsolateProfilerData* profiler_data_; |
Mutex profiler_data_mutex_; |
+ InterruptableThreadState* thread_state_; |
// Reusable handles support. |
#define REUSABLE_HANDLE_FIELDS(object) \ |
@@ -488,8 +512,22 @@ class Isolate : public BaseIsolate { |
static Dart_IsolateInterruptCallback vmstats_callback_; |
static Dart_ServiceIsolateCreateCalback service_create_callback_; |
+ // Manage list of existing isolates. |
+ static void IsolateCreated(Isolate* isolate); |
+ static void IsolateShutdown(Isolate* isolate); |
siva
2014/02/06 00:37:24
Why not call these functions
AddIsolateToList and
Cutch
2014/02/06 17:51:51
Done.
|
+ static void CheckForDuplicateThreadState(InterruptableThreadState* state); |
+ static Monitor* isolates_monitor_; |
+ static Isolate* isolates_head_; |
siva
2014/02/06 00:37:24
should we call these isolates_list_monitor_ and is
Cutch
2014/02/06 17:51:51
Done.
|
+ Isolate* next_; |
siva
2014/02/06 00:37:24
style guide states this instance field should be g
Cutch
2014/02/06 17:51:51
Done.
|
+ |
friend class ReusableHandleScope; |
friend class ReusableObjectHandleScope; |
+ friend class ThreadInterrupter; |
+ friend class ThreadInterrupterAndroid; |
+ friend class ThreadInterrupterMacOS; |
+ friend class ThreadInterrupterLinux; |
+ friend class ThreadInterrupterWin; |
siva
2014/02/06 00:37:24
Are these friends still needed?
Cutch
2014/02/06 17:51:51
Nope. Removed.
|
+ |
DISALLOW_COPY_AND_ASSIGN(Isolate); |
}; |