Chromium Code Reviews| Index: src/handles.cc |
| diff --git a/src/handles.cc b/src/handles.cc |
| index def1604ac7438c5769a0cb6287fd009dee54758d..cffbaf85af02288ad4bbecd73ebcf03a63addda0 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(); |
|
danno
2012/06/24 11:07:03
You should be able to put the code below in the Sc
|
| + v8::ImplementationUtilities::HandleScopeData* current = |
| + isolate->handle_scope_data(); |
| + prev_next_ = current->next; |
| + prev_limit_ = current->limit; |
| + |
| + HandleScopeImplementer* impl = isolate->handle_scope_implementer(); |
| + impl->begin_persistence(); |
| + 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::PersistentExtensions* extensions = |
| + impl->PersistExtensions(prev_limit_); |
|
danno
2012/06/24 11:07:03
All of the code below can be pushed to the impl if
|
| + info_->StorePersistentExtensions(extensions); |
| + |
| + v8::ImplementationUtilities::HandleScopeData* current = |
| + isolate->handle_scope_data(); |
| + current->next = prev_next_; |
| + current->limit = prev_limit_; |
| + |
| + impl->end_persistence(); |
| + current->level--; |
| +} |
| + |
| + |
| } } // namespace v8::internal |