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

Unified Diff: runtime/vm/isolate.h

Issue 9924015: Use the ThreadPool for all isolates and native ports. Previously, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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/isolate.h
===================================================================
--- runtime/vm/isolate.h (revision 5987)
+++ runtime/vm/isolate.h (working copy)
@@ -32,7 +32,6 @@
class StubCode;
class Zone;
-
class Isolate {
public:
~Isolate();
@@ -206,8 +205,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 {
@@ -223,9 +221,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; }
@@ -295,6 +290,28 @@
DISALLOW_COPY_AND_ASSIGN(Isolate);
};
+class SetIsolateScope {
+ public:
+ explicit SetIsolateScope(Isolate* new_isolate)
+ : new_isolate_(new_isolate), saved_isolate_(Isolate::Current()) {
+ Isolate::SetCurrent(new_isolate);
+ if (new_isolate) {
Ivan Posva 2012/04/08 22:58:27 if (new_isolate != NULL) {
turnidge 2012/04/11 19:37:16 Done.
+ 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_

Powered by Google App Engine
This is Rietveld 408576698