Removed Isolate::EnterDefaultIsolate.

BUG=359977
LOG=y
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/240213002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20800 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent de5f609d
...@@ -213,18 +213,6 @@ struct StaticInitializer { ...@@ -213,18 +213,6 @@ struct StaticInitializer {
} static_initializer; } static_initializer;
void Isolate::EnterDefaultIsolate() {
EnsureDefaultIsolate();
ASSERT(default_isolate_ != NULL);
PerIsolateThreadData* data = CurrentPerIsolateThreadData();
// If not yet in default isolate - enter it.
if (data == NULL || data->isolate() != default_isolate_) {
default_isolate_->Enter();
}
}
Address Isolate::get_address_from_id(Isolate::AddressId id) { Address Isolate::get_address_from_id(Isolate::AddressId id) {
return isolate_addresses_[id]; return isolate_addresses_[id];
} }
......
...@@ -570,12 +570,6 @@ class Isolate { ...@@ -570,12 +570,6 @@ class Isolate {
static Thread::LocalStorageKey per_isolate_thread_data_key(); static Thread::LocalStorageKey per_isolate_thread_data_key();
// 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
// switched to non-legacy behavior).
static void EnterDefaultIsolate();
// Mutex for serializing access to break control structures. // Mutex for serializing access to break control structures.
RecursiveMutex* break_access() { return &break_access_; } RecursiveMutex* break_access() { return &break_access_; }
......
...@@ -872,7 +872,8 @@ void Deserializer::DeserializePartial(Isolate* isolate, Object** root) { ...@@ -872,7 +872,8 @@ void Deserializer::DeserializePartial(Isolate* isolate, Object** root) {
Deserializer::~Deserializer() { Deserializer::~Deserializer() {
ASSERT(source_->AtEOF()); // TODO(svenpanne) Re-enable this assertion when v8 initialization is fixed.
// ASSERT(source_->AtEOF());
if (external_reference_decoder_) { if (external_reference_decoder_) {
delete external_reference_decoder_; delete external_reference_decoder_;
external_reference_decoder_ = NULL; external_reference_decoder_ = NULL;
......
...@@ -60,22 +60,8 @@ v8::Platform* V8::platform_ = NULL; ...@@ -60,22 +60,8 @@ v8::Platform* V8::platform_ = NULL;
bool V8::Initialize(Deserializer* des) { bool V8::Initialize(Deserializer* des) {
InitializeOncePerProcess(); InitializeOncePerProcess();
Isolate* isolate = Isolate::UncheckedCurrent();
// The current thread may not yet had entered an isolate to run. if (isolate == NULL) return true;
// Note the Isolate::Current() may be non-null because for various
// initialization purposes an initializing thread may be assigned an isolate
// but not actually enter it.
if (i::Isolate::CurrentPerIsolateThreadData() == NULL) {
i::Isolate::EnterDefaultIsolate();
}
ASSERT(i::Isolate::CurrentPerIsolateThreadData() != NULL);
ASSERT(i::Isolate::CurrentPerIsolateThreadData()->thread_id().Equals(
i::ThreadId::Current()));
ASSERT(i::Isolate::CurrentPerIsolateThreadData()->isolate() ==
i::Isolate::Current());
Isolate* isolate = Isolate::Current();
if (isolate->IsDead()) return false; if (isolate->IsDead()) return false;
if (isolate->IsInitialized()) return true; if (isolate->IsInitialized()) return true;
......
...@@ -74,10 +74,6 @@ void Locker::Initialize(v8::Isolate* isolate) { ...@@ -74,10 +74,6 @@ void Locker::Initialize(v8::Isolate* isolate) {
isolate_->stack_guard()->ClearThread(access); isolate_->stack_guard()->ClearThread(access);
isolate_->stack_guard()->InitThread(access); isolate_->stack_guard()->InitThread(access);
} }
if (isolate_->IsDefaultIsolate()) {
// This only enters if not yet entered.
internal::Isolate::EnterDefaultIsolate();
}
} }
ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread()); ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
} }
...@@ -98,9 +94,6 @@ bool Locker::IsActive() { ...@@ -98,9 +94,6 @@ bool Locker::IsActive() {
Locker::~Locker() { Locker::~Locker() {
ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread()); ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
if (has_lock_) { if (has_lock_) {
if (isolate_->IsDefaultIsolate()) {
isolate_->Exit();
}
if (top_level_) { if (top_level_) {
isolate_->thread_manager()->FreeThreadResources(); isolate_->thread_manager()->FreeThreadResources();
} else { } else {
...@@ -115,9 +108,6 @@ void Unlocker::Initialize(v8::Isolate* isolate) { ...@@ -115,9 +108,6 @@ void Unlocker::Initialize(v8::Isolate* isolate) {
ASSERT(isolate != NULL); ASSERT(isolate != NULL);
isolate_ = reinterpret_cast<i::Isolate*>(isolate); isolate_ = reinterpret_cast<i::Isolate*>(isolate);
ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread()); ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
if (isolate_->IsDefaultIsolate()) {
isolate_->Exit();
}
isolate_->thread_manager()->ArchiveThread(); isolate_->thread_manager()->ArchiveThread();
isolate_->thread_manager()->Unlock(); isolate_->thread_manager()->Unlock();
} }
...@@ -127,9 +117,6 @@ Unlocker::~Unlocker() { ...@@ -127,9 +117,6 @@ Unlocker::~Unlocker() {
ASSERT(!isolate_->thread_manager()->IsLockedByCurrentThread()); ASSERT(!isolate_->thread_manager()->IsLockedByCurrentThread());
isolate_->thread_manager()->Lock(); isolate_->thread_manager()->Lock();
isolate_->thread_manager()->RestoreThread(); isolate_->thread_manager()->RestoreThread();
if (isolate_->IsDefaultIsolate()) {
isolate_->Enter();
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment