Chromium Code Reviews| Index: src/isolate.h |
| diff --git a/src/isolate.h b/src/isolate.h |
| index 420cf03b5f6a235674e034681801aad71738d862..b95886e04363054065527fdedbdfa58e4ed08d85 100644 |
| --- a/src/isolate.h |
| +++ b/src/isolate.h |
| @@ -495,14 +495,17 @@ class Isolate { |
| static void GlobalTearDown(); |
| - bool IsDefaultIsolate() const { return this == default_isolate_; } |
| + bool IsDefaultIsolate() const { return is_default_isolate_; } |
| static void SetCrashIfDefaultIsolateInitialized(); |
| // Ensures that process-wide resources and the default isolate have been |
| // allocated. It is only necessary to call this method in rare cases, for |
| // example if you are using V8 from within the body of a static initializer. |
| // Safe to call multiple times. |
| - static void EnsureDefaultIsolate(); |
| + static Isolate* EnsureDefaultIsolate(); |
| + |
| + // Initialize all thread local variables |
| + static void InitializeThreadLocalStorage(); |
| // Find the PerThread for this particular (isolate, thread) combination |
| // If one does not yet exist, return null. |
| @@ -1132,8 +1135,12 @@ class Isolate { |
| // Given an address occupied by a live code object, return that object. |
| Object* FindCodeObject(Address a); |
| + static Atomic32 GetLivingIsolates() { |
| + return Acquire_Load(&living_isolates_); |
| + } |
| + |
| private: |
| - Isolate(); |
| + explicit Isolate(bool is_default_isolate = false); |
| friend struct GlobalState; |
| friend struct InitializeGlobalState; |
| @@ -1198,11 +1205,11 @@ class Isolate { |
| static Thread::LocalStorageKey per_isolate_thread_data_key_; |
| static Thread::LocalStorageKey isolate_key_; |
| static Thread::LocalStorageKey thread_id_key_; |
| - static Isolate* default_isolate_; |
| static ThreadDataTable* thread_data_table_; |
| // A global counter for all generated Isolates, might overflow. |
| static Atomic32 isolate_counter_; |
| + static Atomic32 living_isolates_; |
| void Deinit(); |
| @@ -1244,6 +1251,7 @@ class Isolate { |
| // the Error object. |
| bool IsErrorObject(Handle<Object> obj); |
| + bool is_default_isolate_; |
|
Michael Starzinger
2013/10/01 14:19:08
nit: Let's move this down to the other boolean fla
|
| Atomic32 id_; |
| EntryStackItem* entry_stack_; |
| int stack_trace_nesting_level_; |