V8 Project
v8::internal::DeferredHandleScope Class Reference

#include <handles.h>

+ Collaboration diagram for v8::internal::DeferredHandleScope:

Public Member Functions

 DeferredHandleScope (Isolate *isolate)
 
DeferredHandlesDetach ()
 
 ~DeferredHandleScope ()
 

Private Attributes

Object ** prev_limit_
 
Object ** prev_next_
 
HandleScopeImplementerimpl_
 

Friends

class HandleScopeImplementer
 

Detailed Description

Definition at line 244 of file handles.h.

Constructor & Destructor Documentation

◆ DeferredHandleScope()

v8::internal::DeferredHandleScope::DeferredHandleScope ( Isolate isolate)
explicit

Definition at line 92 of file handles.cc.

93  : impl_(isolate->handle_scope_implementer()) {
95  HandleScopeData* data = impl_->isolate()->handle_scope_data();
96  Object** new_next = impl_->GetSpareOrNewBlock();
97  Object** new_limit = &new_next[kHandleBlockSize];
98  DCHECK(data->limit == &impl_->blocks()->last()[kHandleBlockSize]);
99  impl_->blocks()->Add(new_next);
100 
101 #ifdef DEBUG
102  prev_level_ = data->level;
103 #endif
104  data->level++;
105  prev_limit_ = data->limit;
106  prev_next_ = data->next;
107  data->next = new_next;
108  data->limit = new_limit;
109 }
HandleScopeImplementer * impl_
Definition: handles.h:256
internal::Object ** GetSpareOrNewBlock()
Definition: api.h:636
Isolate * isolate() const
Definition: api.h:538
List< internal::Object ** > * blocks()
Definition: api.h:537
HandleScopeData * handle_scope_data()
Definition: isolate.h:899
#define DCHECK(condition)
Definition: logging.h:205
kSerializedDataOffset Object
Definition: objects-inl.h:5322
const int kHandleBlockSize
Definition: api.h:596

References v8::internal::HandleScopeImplementer::BeginDeferredScope(), v8::internal::HandleScopeImplementer::blocks(), DCHECK, v8::internal::HandleScopeImplementer::GetSpareOrNewBlock(), v8::internal::Isolate::handle_scope_data(), impl_, v8::internal::HandleScopeImplementer::isolate(), v8::internal::kHandleBlockSize, v8::internal::HandleScopeData::level, v8::internal::HandleScopeData::limit, v8::internal::HandleScopeData::next, prev_limit_, and prev_next_.

+ Here is the call graph for this function:

◆ ~DeferredHandleScope()

v8::internal::DeferredHandleScope::~DeferredHandleScope ( )

Definition at line 112 of file handles.cc.

112  {
114  DCHECK(handles_detached_);
115  DCHECK(impl_->isolate()->handle_scope_data()->level == prev_level_);
116 }

References DCHECK, v8::internal::Isolate::handle_scope_data(), impl_, v8::internal::HandleScopeImplementer::isolate(), and v8::internal::HandleScopeData::level.

+ Here is the call graph for this function:

Member Function Documentation

◆ Detach()

DeferredHandles * v8::internal::DeferredHandleScope::Detach ( )

Definition at line 119 of file handles.cc.

119  {
120  DeferredHandles* deferred = impl_->Detach(prev_limit_);
121  HandleScopeData* data = impl_->isolate()->handle_scope_data();
122  data->next = prev_next_;
123  data->limit = prev_limit_;
124 #ifdef DEBUG
125  handles_detached_ = true;
126 #endif
127  return deferred;
128 }
DeferredHandles * Detach(Object **prev_limit)
Definition: api.cc:7605
internal::Object ** next
Definition: handles.h:285

References v8::internal::HandleScopeImplementer::Detach(), v8::internal::Isolate::handle_scope_data(), impl_, v8::internal::HandleScopeImplementer::isolate(), v8::internal::HandleScopeData::limit, v8::internal::HandleScopeData::next, prev_limit_, and prev_next_.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ HandleScopeImplementer

friend class HandleScopeImplementer
friend

Definition at line 263 of file handles.h.

Member Data Documentation

◆ impl_

HandleScopeImplementer* v8::internal::DeferredHandleScope::impl_
private

Definition at line 256 of file handles.h.

Referenced by DeferredHandleScope(), Detach(), and ~DeferredHandleScope().

◆ prev_limit_

Object** v8::internal::DeferredHandleScope::prev_limit_
private

Definition at line 254 of file handles.h.

Referenced by DeferredHandleScope(), and Detach().

◆ prev_next_

Object** v8::internal::DeferredHandleScope::prev_next_
private

Definition at line 255 of file handles.h.

Referenced by DeferredHandleScope(), and Detach().


The documentation for this class was generated from the following files: