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

Unified Diff: runtime/vm/isolate.h

Issue 9328042: Move the thread local functions to the Thread class in runtime/platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 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/platform/thread_win.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 25b65ecc186747408adae23fee373536c7dd66e0..765f6e86ece7cf5cd8e7d73237f78d22beb1d8c6 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -7,6 +7,7 @@
#include "include/dart_api.h"
#include "platform/assert.h"
+#include "platform/thread.h"
#include "vm/store_buffer.h"
#include "vm/timer.h"
@@ -31,11 +32,15 @@ class StackResource;
class StubCode;
class Zone;
+
class Isolate {
public:
~Isolate();
- static inline Isolate* Current();
+ static inline Isolate* Current() {
+ return reinterpret_cast<Isolate*>(Thread::GetThreadLocal(isolate_key));
+ }
+
static void SetCurrent(Isolate* isolate);
static void InitOnce();
@@ -242,6 +247,7 @@ class Isolate {
static const uword kStackSizeBuffer = (128 * KB);
static const uword kDefaultStackSize = (1 * MB);
+ static ThreadLocalKey isolate_key;
StoreBufferBlock store_buffer_;
Dart_MessageNotifyCallback message_notify_callback_;
char* name_;
@@ -281,14 +287,4 @@ class Isolate {
} // namespace dart
-#if defined(TARGET_OS_LINUX)
-#include "vm/isolate_linux.h"
-#elif defined(TARGET_OS_MACOS)
-#include "vm/isolate_macos.h"
-#elif defined(TARGET_OS_WINDOWS)
-#include "vm/isolate_win.h"
-#else
-#error Unknown target os.
-#endif
-
#endif // VM_ISOLATE_H_
« no previous file with comments | « runtime/platform/thread_win.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698