Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 1a521748211bcb72be2c434189b96d0c103dcf79..9f42fa3cff81f4e53de47aab8c298dd2db878392 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"); |
} |
@@ -5621,9 +5621,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)); |
@@ -5641,7 +5640,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(); |
} |
@@ -5667,7 +5666,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); |
} |