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

Unified Diff: src/v8.cc

Issue 113121: Changed the flags that indicate the status of running vs dead... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 7 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
« src/v8.h ('K') | « src/v8.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8.cc
===================================================================
--- src/v8.cc (revision 1900)
+++ src/v8.cc (working copy)
@@ -35,14 +35,20 @@
namespace v8 { namespace internal {
+bool V8::is_running_ = false;
bool V8::has_been_setup_ = false;
bool V8::has_been_disposed_ = false;
+bool V8::has_fatal_error_ = false;
bool V8::Initialize(Deserializer *des) {
bool create_heap_objects = des == NULL;
- if (HasBeenDisposed()) return false;
- if (HasBeenSetup()) return true;
+ if (has_been_disposed_ || has_fatal_error_) return false;
+ if (IsRunning()) return true;
+
+ is_running_ = true;
has_been_setup_ = true;
+ has_fatal_error_ = false;
+ has_been_disposed_ = false;
#ifdef DEBUG
// The initialization process does not handle memory exhaustion.
DisallowAllocationFailure disallow_allocation_failure;
@@ -58,7 +64,7 @@
// Setup the object heap
ASSERT(!Heap::HasBeenSetup());
if (!Heap::Setup(create_heap_objects)) {
- has_been_setup_ = false;
+ SetFatalError();
return false;
}
@@ -94,9 +100,14 @@
}
+void V8::SetFatalError() {
+ is_running_ = false;
+ has_fatal_error_ = true;
+}
+
+
void V8::TearDown() {
- if (HasBeenDisposed()) return;
- if (!HasBeenSetup()) return;
+ if (!has_been_setup_ || has_been_disposed_) return;
OProfileAgent::TearDown();
@@ -113,8 +124,9 @@
Heap::TearDown();
Logger::TearDown();
- has_been_setup_ = false;
+ is_running_ = false;
has_been_disposed_ = true;
}
+
} } // namespace v8::internal
« src/v8.h ('K') | « src/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698