Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 0ec27fe423d05562e0bee744d2e3349fe8d5361f..84c0be46c901a64bad6c9d859057028c84b7e264 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -53,6 +53,7 @@ |
#define LOG_API(isolate, expr) LOG(isolate, ApiEntryCall(expr)) |
+// TODO(isolates): avoid repeated TLS reads in function prologues. |
#ifdef ENABLE_VMSTATE_TRACKING |
#define ENTER_V8(isolate) \ |
ASSERT((isolate)->IsInitialized()); \ |
@@ -289,7 +290,6 @@ static inline bool EnsureInitializedForIsolate(i::Isolate* isolate, |
if (isolate != NULL) { |
if (isolate->IsInitialized()) return true; |
} |
- ASSERT(isolate == i::Isolate::Current()); |
return ApiCheck(InitializeHelper(), location, "Error initializing V8"); |
} |
@@ -5687,8 +5687,9 @@ void HandleScopeImplementer::FreeThreadResources() { |
char* HandleScopeImplementer::ArchiveThread(char* storage) { |
+ Isolate* isolate = Isolate::Current(); |
v8::ImplementationUtilities::HandleScopeData* current = |
- isolate_->handle_scope_data(); |
+ isolate->handle_scope_data(); |
handle_scope_data_ = *current; |
memcpy(storage, this, sizeof(*this)); |
@@ -5706,7 +5707,7 @@ int HandleScopeImplementer::ArchiveSpacePerThread() { |
char* HandleScopeImplementer::RestoreThread(char* storage) { |
memcpy(this, storage, sizeof(*this)); |
- *isolate_->handle_scope_data() = handle_scope_data_; |
+ *Isolate::Current()->handle_scope_data() = handle_scope_data_; |
return storage + ArchiveSpacePerThread(); |
} |
@@ -5732,7 +5733,7 @@ void HandleScopeImplementer::IterateThis(ObjectVisitor* v) { |
void HandleScopeImplementer::Iterate(ObjectVisitor* v) { |
v8::ImplementationUtilities::HandleScopeData* current = |
- isolate_->handle_scope_data(); |
+ Isolate::Current()->handle_scope_data(); |
handle_scope_data_ = *current; |
IterateThis(v); |
} |