Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index c72857da644eedb55f4ce93002f73ef7e20b29bf..c5c66a799fd5c07e59074f279fb0b480189e65a6 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -53,7 +53,6 @@ |
#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()); \ |
@@ -290,6 +289,7 @@ 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"); |
} |
@@ -5739,9 +5739,8 @@ 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)); |
@@ -5759,7 +5758,7 @@ int HandleScopeImplementer::ArchiveSpacePerThread() { |
char* HandleScopeImplementer::RestoreThread(char* storage) { |
memcpy(this, storage, sizeof(*this)); |
- *Isolate::Current()->handle_scope_data() = handle_scope_data_; |
+ *isolate_->handle_scope_data() = handle_scope_data_; |
return storage + ArchiveSpacePerThread(); |
} |
@@ -5785,7 +5784,7 @@ void HandleScopeImplementer::IterateThis(ObjectVisitor* v) { |
void HandleScopeImplementer::Iterate(ObjectVisitor* v) { |
v8::ImplementationUtilities::HandleScopeData* current = |
- Isolate::Current()->handle_scope_data(); |
+ isolate_->handle_scope_data(); |
handle_scope_data_ = *current; |
IterateThis(v); |
} |