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

Unified Diff: src/isolate.h

Issue 24999002: lazy instantiation of the default isolate (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « src/api.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « src/api.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698