| Index: src/isolate.h
|
| diff --git a/src/isolate.h b/src/isolate.h
|
| index 5612630c0494f909dc42c1a345d016226e812a0c..eb0a631639bb87843f5cf54cb9f67e2fd88d11a5 100644
|
| --- a/src/isolate.h
|
| +++ b/src/isolate.h
|
| @@ -448,19 +448,19 @@ class Isolate {
|
| // not currently set).
|
| static PerIsolateThreadData* CurrentPerIsolateThreadData() {
|
| return reinterpret_cast<PerIsolateThreadData*>(
|
| - Thread::GetThreadLocal(per_isolate_thread_data_key_));
|
| + Thread::GetThreadLocal(per_isolate_thread_data_key()));
|
| }
|
|
|
| // Returns the isolate inside which the current thread is running.
|
| INLINE(static Isolate* Current()) {
|
| Isolate* isolate = reinterpret_cast<Isolate*>(
|
| - Thread::GetExistingThreadLocal(isolate_key_));
|
| + Thread::GetExistingThreadLocal(isolate_key()));
|
| ASSERT(isolate != NULL);
|
| return isolate;
|
| }
|
|
|
| INLINE(static Isolate* UncheckedCurrent()) {
|
| - return reinterpret_cast<Isolate*>(Thread::GetThreadLocal(isolate_key_));
|
| + return reinterpret_cast<Isolate*>(Thread::GetThreadLocal(isolate_key()));
|
| }
|
|
|
| // Usually called by Init(), but can be called early e.g. to allow
|
| @@ -508,14 +508,26 @@ class Isolate {
|
| // Used internally for V8 threads that do not execute JavaScript but still
|
| // are part of the domain of an isolate (like the context switcher).
|
| static Thread::LocalStorageKey isolate_key() {
|
| + EnsureDefaultIsolate();
|
| return isolate_key_;
|
| }
|
|
|
| // Returns the key used to store process-wide thread IDs.
|
| static Thread::LocalStorageKey thread_id_key() {
|
| + EnsureDefaultIsolate();
|
| return thread_id_key_;
|
| }
|
|
|
| + static Thread::LocalStorageKey per_isolate_thread_data_key() {
|
| + EnsureDefaultIsolate();
|
| + return per_isolate_thread_data_key_;
|
| + }
|
| +
|
| + static Isolate::ThreadDataTable* thread_data_table() {
|
| + EnsureDefaultIsolate();
|
| + return thread_data_table_;
|
| + }
|
| +
|
| // If a client attempts to create a Locker without specifying an isolate,
|
| // we assume that the client is using legacy behavior. Set up the current
|
| // thread to be inside the implicit isolate (or fail a check if we have
|
| @@ -1081,10 +1093,6 @@ class Isolate {
|
| DISALLOW_COPY_AND_ASSIGN(EntryStackItem);
|
| };
|
|
|
| - // This mutex protects highest_thread_id_, thread_data_table_ and
|
| - // default_isolate_.
|
| - static Mutex* process_wide_mutex_;
|
| -
|
| static Thread::LocalStorageKey per_isolate_thread_data_key_;
|
| static Thread::LocalStorageKey isolate_key_;
|
| static Thread::LocalStorageKey thread_id_key_;
|
| @@ -1112,7 +1120,7 @@ class Isolate {
|
| // If one does not yet exist, allocate a new one.
|
| PerIsolateThreadData* FindOrAllocatePerThreadDataForThisThread();
|
|
|
| -// PreInits and returns a default isolate. Needed when a new thread tries
|
| + // PreInits and returns a default isolate. Needed when a new thread tries
|
| // to create a Locker for the first time (the lock itself is in the isolate).
|
| static Isolate* GetDefaultIsolateForLocking();
|
|
|
|
|