V8 Project
v8::internal::AllocationSiteCreationContext Class Reference

#include <allocation-site-scopes.h>

+ Inheritance diagram for v8::internal::AllocationSiteCreationContext:
+ Collaboration diagram for v8::internal::AllocationSiteCreationContext:

Public Member Functions

 AllocationSiteCreationContext (Isolate *isolate)
 
Handle< AllocationSiteEnterNewScope ()
 
void ExitScope (Handle< AllocationSite > site, Handle< JSObject > object)
 
- Public Member Functions inherited from v8::internal::AllocationSiteContext
 AllocationSiteContext (Isolate *isolate)
 
Handle< AllocationSitetop ()
 
Handle< AllocationSitecurrent ()
 
bool ShouldCreateMemento (Handle< JSObject > object)
 
Isolateisolate ()
 

Additional Inherited Members

- Protected Member Functions inherited from v8::internal::AllocationSiteContext
void update_current_site (AllocationSite *site)
 
void InitializeTraversal (Handle< AllocationSite > site)
 

Detailed Description

Definition at line 51 of file allocation-site-scopes.h.

Constructor & Destructor Documentation

◆ AllocationSiteCreationContext()

v8::internal::AllocationSiteCreationContext::AllocationSiteCreationContext ( Isolate isolate)
inlineexplicit

Member Function Documentation

◆ EnterNewScope()

Handle< AllocationSite > v8::internal::AllocationSiteCreationContext::EnterNewScope ( )

Definition at line 11 of file allocation-site-scopes.cc.

11  {
12  Handle<AllocationSite> scope_site;
13  if (top().is_null()) {
14  // We are creating the top level AllocationSite as opposed to a nested
15  // AllocationSite.
16  InitializeTraversal(isolate()->factory()->NewAllocationSite());
17  scope_site = Handle<AllocationSite>(*top(), isolate());
18  if (FLAG_trace_creation_allocation_sites) {
19  PrintF("*** Creating top level AllocationSite %p\n",
20  static_cast<void*>(*scope_site));
21  }
22  } else {
23  DCHECK(!current().is_null());
24  scope_site = isolate()->factory()->NewAllocationSite();
25  if (FLAG_trace_creation_allocation_sites) {
26  PrintF("Creating nested site (top, current, new) (%p, %p, %p)\n",
27  static_cast<void*>(*top()),
28  static_cast<void*>(*current()),
29  static_cast<void*>(*scope_site));
30  }
31  current()->set_nested_site(*scope_site);
32  update_current_site(*scope_site);
33  }
34  DCHECK(!scope_site.is_null());
35  return scope_site;
36 }
void InitializeTraversal(Handle< AllocationSite > site)
void update_current_site(AllocationSite *site)
Factory * factory()
Definition: isolate.h:982
#define DCHECK(condition)
Definition: logging.h:205
void PrintF(const char *format,...)
Definition: utils.cc:80

References v8::internal::AllocationSiteContext::current(), DCHECK, v8::internal::Isolate::factory(), v8::internal::AllocationSiteContext::InitializeTraversal(), v8::internal::Handle< T >::is_null(), v8::internal::AllocationSiteContext::isolate(), v8::internal::PrintF(), v8::internal::AllocationSiteContext::top(), and v8::internal::AllocationSiteContext::update_current_site().

Referenced by v8::internal::GetLiteralAllocationSite(), and v8::internal::RUNTIME_FUNCTION().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExitScope()

void v8::internal::AllocationSiteCreationContext::ExitScope ( Handle< AllocationSite site,
Handle< JSObject object 
)

Definition at line 39 of file allocation-site-scopes.cc.

41  {
42  if (!object.is_null()) {
43  bool top_level = !scope_site.is_null() &&
44  top().is_identical_to(scope_site);
45 
46  scope_site->set_transition_info(*object);
47  if (FLAG_trace_creation_allocation_sites) {
48  if (top_level) {
49  PrintF("*** Setting AllocationSite %p transition_info %p\n",
50  static_cast<void*>(*scope_site),
51  static_cast<void*>(*object));
52  } else {
53  PrintF("Setting AllocationSite (%p, %p) transition_info %p\n",
54  static_cast<void*>(*top()),
55  static_cast<void*>(*scope_site),
56  static_cast<void*>(*object));
57  }
58  }
59  }
60 }

References v8::internal::Handle< T >::is_null(), v8::internal::PrintF(), and v8::internal::AllocationSiteContext::top().

Referenced by v8::internal::GetLiteralAllocationSite(), and v8::internal::RUNTIME_FUNCTION().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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