Index: runtime/vm/isolate.h |
=================================================================== |
--- runtime/vm/isolate.h (revision 6423) |
+++ runtime/vm/isolate.h (working copy) |
@@ -33,7 +33,6 @@ |
class StubCode; |
class Zone; |
- |
class Isolate : public BaseIsolate { |
public: |
~Isolate(); |
@@ -144,8 +143,7 @@ |
// value to trigger interrupts. |
uword stack_limit() const { return stack_limit_; } |
- // The true stack limit for this isolate. This does not change |
- // after isolate initialization. |
+ // The true stack limit for this isolate. |
uword saved_stack_limit() const { return saved_stack_limit_; } |
enum { |
@@ -161,9 +159,6 @@ |
MessageHandler* message_handler() const { return message_handler_; } |
void set_message_handler(MessageHandler* value) { message_handler_ = value; } |
- // Returns null on success, a RawError on failure. |
- RawError* StandardRunLoop(); |
- |
intptr_t ast_node_id() const { return ast_node_id_; } |
void set_ast_node_id(int value) { ast_node_id_ = value; } |
@@ -226,6 +221,28 @@ |
DISALLOW_COPY_AND_ASSIGN(Isolate); |
}; |
+class SetIsolateScope { |
siva
2012/04/14 00:29:53
In two out of the three places where this is used
turnidge
2012/04/17 23:46:55
Added a new StartIsolateScope for those cases.
|
+ public: |
+ explicit SetIsolateScope(Isolate* new_isolate) |
+ : new_isolate_(new_isolate), saved_isolate_(Isolate::Current()) { |
+ Isolate::SetCurrent(new_isolate); |
+ if (new_isolate != NULL) { |
+ new_isolate->SetStackLimitFromCurrentTOS(reinterpret_cast<uword>(this)); |
+ } |
+ } |
+ |
+ ~SetIsolateScope() { |
+ ASSERT(Isolate::Current() == new_isolate_); |
+ Isolate::SetCurrent(saved_isolate_); |
+ } |
+ |
+ private: |
+ Isolate* new_isolate_; |
+ Isolate* saved_isolate_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SetIsolateScope); |
+}; |
+ |
} // namespace dart |
#endif // VM_ISOLATE_H_ |