v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
allocation-site-scopes-inl.h
Go to the documentation of this file.
1// Copyright 2018 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_OBJECTS_ALLOCATION_SITE_SCOPES_INL_H_
6#define V8_OBJECTS_ALLOCATION_SITE_SCOPES_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
12
13namespace v8 {
14namespace internal {
15
17 top_ = site;
18 // {current_} is updated in place to not create unnecessary Handles, hence
19 // we initially need a separate handle.
21}
22
24 if (top().is_null()) {
26 } else {
27 // Advance current site
28 Tagged<Object> nested_site = current()->nested_site();
29 // Something is wrong if we advance to the end of the list here.
31 }
33}
34
37 // This assert ensures that we are pointing at the right sub-object in a
38 // recursive walk of a nested literal.
39 DCHECK(object.is_null() || *object == scope_site->boilerplate());
40}
41
44 if (activated_ && AllocationSite::CanTrack(object->map()->instance_type())) {
45 if (v8_flags.allocation_site_pretenuring ||
46 AllocationSite::ShouldTrack(object->GetElementsKind())) {
47 if (v8_flags.trace_creation_allocation_sites) {
48 PrintF("*** Creating Memento for %s %p\n",
49 IsJSArray(*object) ? "JSArray" : "JSObject",
50 reinterpret_cast<void*>(object->ptr()));
51 }
52 return true;
53 }
54 }
55 return false;
56}
57
58} // namespace internal
59} // namespace v8
60
61#endif // V8_OBJECTS_ALLOCATION_SITE_SCOPES_INL_H_
static V8_INLINE Local< T > New(Isolate *isolate, Local< T > that)
void InitializeTraversal(Handle< AllocationSite > site)
DirectHandle< AllocationSite > current()
DirectHandle< AllocationSite > top()
void update_current_site(Tagged< AllocationSite > site)
void ExitScope(DirectHandle< AllocationSite > scope_site, DirectHandle< JSObject > object)
bool ShouldCreateMemento(DirectHandle< JSObject > object)
static bool ShouldTrack(ElementsKind boilerplate_elements_kind)
static bool CanTrack(InstanceType type)
void PrintF(const char *format,...)
Definition utils.cc:39
V8_EXPORT_PRIVATE FlagValues v8_flags
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
Definition casting.h:150
Local< T > Handle
#define DCHECK(condition)
Definition logging.h:482