Index: src/handles.cc |
diff --git a/src/handles.cc b/src/handles.cc |
index def1604ac7438c5769a0cb6287fd009dee54758d..39bb95c40b9bd8e79cdd8306d26b4ff0b3a37918 100644 |
--- a/src/handles.cc |
+++ b/src/handles.cc |
@@ -958,4 +958,42 @@ int Utf8Length(Handle<String> str) { |
return len; |
} |
+ |
+GatheringHandleScope::GatheringHandleScope(CompilationInfo* info) |
+ : info_(info) { |
+ Isolate* isolate = info->isolate(); |
+ v8::ImplementationUtilities::HandleScopeData* current = |
+ isolate->handle_scope_data(); |
+ prev_next_ = current->next; |
+ prev_limit_ = current->limit; |
+ |
+ HandleScopeImplementer* impl = isolate->handle_scope_implementer(); |
+ impl->set_last_block_before_compilation(); |
+ Object** new_next = impl->GetSpareOrNewBlock(); |
+ Object** new_limit = &new_next[kHandleBlockSize]; |
+ impl->blocks()->Add(new_next); |
+ |
+ current->next = new_next; |
+ current->limit = new_limit; |
+ current->level++; |
+} |
+ |
+ |
+GatheringHandleScope::~GatheringHandleScope() { |
+ Isolate* isolate = info_->isolate(); |
+ HandleScopeImplementer* impl = isolate->handle_scope_implementer(); |
+ HandleScopeImplementer::HiddenExtensions* extensions = |
+ impl->HideExtensions(prev_limit_); |
+ info_->RememberHiddenExtensions(extensions); |
+ |
+ v8::ImplementationUtilities::HandleScopeData* current = |
+ isolate->handle_scope_data(); |
+ current->next = prev_next_; |
+ current->limit = prev_limit_; |
+ |
+ impl->unset_last_block_before_compilation(); |
+ current->level--; |
+} |
+ |
+ |
} } // namespace v8::internal |