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
This commit is contained in:
parent
de5f609da4
commit
7976d95cac
@ -213,18 +213,6 @@ struct StaticInitializer {
|
||||
} 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) {
|
||||
return isolate_addresses_[id];
|
||||
}
|
||||
|
@ -570,12 +570,6 @@ class Isolate {
|
||||
|
||||
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.
|
||||
RecursiveMutex* break_access() { return &break_access_; }
|
||||
|
||||
|
@ -872,7 +872,8 @@ void Deserializer::DeserializePartial(Isolate* isolate, Object** root) {
|
||||
|
||||
|
||||
Deserializer::~Deserializer() {
|
||||
ASSERT(source_->AtEOF());
|
||||
// TODO(svenpanne) Re-enable this assertion when v8 initialization is fixed.
|
||||
// ASSERT(source_->AtEOF());
|
||||
if (external_reference_decoder_) {
|
||||
delete external_reference_decoder_;
|
||||
external_reference_decoder_ = NULL;
|
||||
|
18
src/v8.cc
18
src/v8.cc
@ -60,22 +60,8 @@ v8::Platform* V8::platform_ = NULL;
|
||||
|
||||
bool V8::Initialize(Deserializer* des) {
|
||||
InitializeOncePerProcess();
|
||||
|
||||
// The current thread may not yet had entered an isolate to run.
|
||||
// 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();
|
||||
Isolate* isolate = Isolate::UncheckedCurrent();
|
||||
if (isolate == NULL) return true;
|
||||
if (isolate->IsDead()) return false;
|
||||
if (isolate->IsInitialized()) return true;
|
||||
|
||||
|
@ -74,10 +74,6 @@ void Locker::Initialize(v8::Isolate* isolate) {
|
||||
isolate_->stack_guard()->ClearThread(access);
|
||||
isolate_->stack_guard()->InitThread(access);
|
||||
}
|
||||
if (isolate_->IsDefaultIsolate()) {
|
||||
// This only enters if not yet entered.
|
||||
internal::Isolate::EnterDefaultIsolate();
|
||||
}
|
||||
}
|
||||
ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
|
||||
}
|
||||
@ -98,9 +94,6 @@ bool Locker::IsActive() {
|
||||
Locker::~Locker() {
|
||||
ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
|
||||
if (has_lock_) {
|
||||
if (isolate_->IsDefaultIsolate()) {
|
||||
isolate_->Exit();
|
||||
}
|
||||
if (top_level_) {
|
||||
isolate_->thread_manager()->FreeThreadResources();
|
||||
} else {
|
||||
@ -115,9 +108,6 @@ void Unlocker::Initialize(v8::Isolate* isolate) {
|
||||
ASSERT(isolate != NULL);
|
||||
isolate_ = reinterpret_cast<i::Isolate*>(isolate);
|
||||
ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
|
||||
if (isolate_->IsDefaultIsolate()) {
|
||||
isolate_->Exit();
|
||||
}
|
||||
isolate_->thread_manager()->ArchiveThread();
|
||||
isolate_->thread_manager()->Unlock();
|
||||
}
|
||||
@ -127,9 +117,6 @@ Unlocker::~Unlocker() {
|
||||
ASSERT(!isolate_->thread_manager()->IsLockedByCurrentThread());
|
||||
isolate_->thread_manager()->Lock();
|
||||
isolate_->thread_manager()->RestoreThread();
|
||||
if (isolate_->IsDefaultIsolate()) {
|
||||
isolate_->Enter();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user