v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
setup-heap-internal.cc File Reference
#include "src/api/api-natives.h"
#include "src/api/api.h"
#include "src/builtins/accessors.h"
#include "src/codegen/compilation-cache.h"
#include "src/common/assert-scope.h"
#include "src/execution/isolate.h"
#include "src/execution/protectors.h"
#include "src/heap/factory.h"
#include "src/heap/heap-inl.h"
#include "src/heap/new-spaces.h"
#include "src/ic/handler-configuration.h"
#include "src/init/heap-symbols.h"
#include "src/init/setup-isolate.h"
#include "src/interpreter/interpreter.h"
#include "src/objects/arguments.h"
#include "src/objects/call-site-info.h"
#include "src/objects/cell-inl.h"
#include "src/objects/contexts.h"
#include "src/objects/data-handler-inl.h"
#include "src/objects/debug-objects.h"
#include "src/objects/descriptor-array.h"
#include "src/objects/dictionary.h"
#include "src/objects/foreign.h"
#include "src/objects/heap-number.h"
#include "src/objects/instance-type-inl.h"
#include "src/objects/instance-type.h"
#include "src/objects/js-atomics-synchronization.h"
#include "src/objects/js-generator.h"
#include "src/objects/js-shared-array.h"
#include "src/objects/js-weak-refs.h"
#include "src/objects/literal-objects-inl.h"
#include "src/objects/lookup-cache.h"
#include "src/objects/map.h"
#include "src/objects/microtask.h"
#include "src/objects/objects-inl.h"
#include "src/objects/oddball-inl.h"
#include "src/objects/ordered-hash-table.h"
#include "src/objects/promise.h"
#include "src/objects/property-descriptor-object.h"
#include "src/objects/script.h"
#include "src/objects/shared-function-info.h"
#include "src/objects/smi.h"
#include "src/objects/source-text-module.h"
#include "src/objects/string.h"
#include "src/objects/synthetic-module.h"
#include "src/objects/template-objects-inl.h"
#include "src/objects/templates.h"
#include "src/objects/torque-defined-classes-inl.h"
#include "src/objects/turbofan-types.h"
#include "src/objects/turboshaft-types.h"
#include "src/regexp/regexp.h"
#include "src/roots/roots.h"
#include "src/utils/allocation.h"

Go to the source code of this file.

Namespaces

namespace  v8
 
namespace  v8::internal
 

Macros

#define CONSTANT_STRING_ELEMENT(_, name, contents)
 
#define CONSTANT_STRING_ELEMENT(_, name, contents)
 
#define STRING_TYPE_ELEMENT(type, size, name, CamelName)
 
#define STRUCT_TABLE_ELEMENT(TYPE, Name, name)
 
#define ALLOCATION_SITE_ELEMENT(_, TYPE, Name, Size, name)
 
#define DATA_HANDLER_ELEMENT(_, TYPE, Name, Size, name)
 
#define ALLOCATE_AND_SET_ROOT(Type, name, Size)
 
#define ALLOCATE_PARTIAL_MAP(instance_type, size, field_name)
 
#define ALLOCATE_MAP(instance_type, size, field_name)
 
#define ALLOCATE_VARSIZE_MAP(instance_type, field_name)
 
#define ALLOCATE_PRIMITIVE_MAP(instance_type, size, field_name, constructor_function_index)
 
#define TORQUE_ALLOCATE_MAP(NAME, Name, name)
 
#define TORQUE_ALLOCATE_VARSIZE_MAP(NAME, Name, name)
 
#define ALLOCATE_ALWAYS_SHARED_SPACE_JSOBJECT_MAP(instance_type, size, field_name)
 
#define SYMBOL_INIT(_, name)
 
#define ENSURE_SINGLE_CHAR_STRINGS_ARE_SINGLE_CHAR(_, name, contents)
 
#define PUBLIC_SYMBOL_INIT(_, name, description)
 
#define WELL_KNOWN_SYMBOL_INIT(_, name, description)
 
#define ALLOCATE_SYMBOL_STRING(_, name, description)
 
#define INTERNALIZED_STRING_INIT(_, name, description)
 
#define INIT_ACCESSOR_INFO(_, accessor_name, AccessorName, ...)
 
#define INIT_SIDE_EFFECT_FLAG(_, accessor_name, AccessorName, GetterType, SetterType)
 

Macro Definition Documentation

◆ ALLOCATE_ALWAYS_SHARED_SPACE_JSOBJECT_MAP

#define ALLOCATE_ALWAYS_SHARED_SPACE_JSOBJECT_MAP ( instance_type,
size,
field_name )
Value:
{ \
Tagged<Map> map; \
if (!AllocateMap(AllocationType::kReadOnly, (instance_type), size, \
DICTIONARY_ELEMENTS) \
.To(&map)) { \
return false; \
} \
AlwaysSharedSpaceJSObject::PrepareMapNoEnumerableProperties(map); \
set_##field_name##_map(map); \
}
std::map< const std::string, const std::string > map
ZoneVector< InstructionOperand > * set_

◆ ALLOCATE_AND_SET_ROOT

#define ALLOCATE_AND_SET_ROOT ( Type,
name,
Size )
Value:
{ \
AllocationResult alloc = AllocateRaw(Size, AllocationType::kReadOnly); \
if (!alloc.To(&obj)) return false; \
} \
Tagged<Type> name = UncheckedCast<Type>(obj); \
set_##name(name)
const char * name
Definition builtins.cc:39

◆ ALLOCATE_MAP

#define ALLOCATE_MAP ( instance_type,
size,
field_name )
Value:
{ \
Tagged<Map> map; \
if (!AllocateMap(AllocationType::kReadOnly, (instance_type), size) \
.To(&map)) { \
return false; \
} \
set_##field_name##_map(map); \
}

◆ ALLOCATE_PARTIAL_MAP

#define ALLOCATE_PARTIAL_MAP ( instance_type,
size,
field_name )
Value:
{ \
Tagged<Map> map; \
if (!AllocatePartialMap((instance_type), (size)).To(&map)) return false; \
set_##field_name##_map(map); \
}

◆ ALLOCATE_PRIMITIVE_MAP

#define ALLOCATE_PRIMITIVE_MAP ( instance_type,
size,
field_name,
constructor_function_index )
Value:
{ \
ALLOCATE_MAP((instance_type), (size), field_name); \
roots.field_name##_map()->SetConstructorFunctionIndex( \
(constructor_function_index)); \
}

◆ ALLOCATE_SYMBOL_STRING

#define ALLOCATE_SYMBOL_STRING ( _,
name,
description )
Value:
Handle<String> name##symbol_string = \
factory->InternalizeUtf8String(#description); \
USE(name##symbol_string);

◆ ALLOCATE_VARSIZE_MAP

#define ALLOCATE_VARSIZE_MAP ( instance_type,
field_name )
Value:
ALLOCATE_MAP(instance_type, kVariableSizeSentinel, field_name)
#define ALLOCATE_MAP(instance_type, size, field_name)

◆ ALLOCATION_SITE_ELEMENT

#define ALLOCATION_SITE_ELEMENT ( _,
TYPE,
Name,
Size,
name )
Value:
{TYPE, sizeof(Name##Size), RootIndex::k##Name##Size##Map},

◆ CONSTANT_STRING_ELEMENT [1/2]

#define CONSTANT_STRING_ELEMENT ( _,
name,
contents )
Value:
{{contents, arraysize(contents) - 1}, RootIndex::k##name},
base::Vector< const char > contents
#define arraysize(array)
Definition macros.h:67

◆ CONSTANT_STRING_ELEMENT [2/2]

#define CONSTANT_STRING_ELEMENT ( _,
name,
contents )
Value:
{{contents, arraysize(contents) - 1}, RootIndex::k##name},

◆ DATA_HANDLER_ELEMENT

#define DATA_HANDLER_ELEMENT ( _,
TYPE,
Name,
Size,
name )
Value:
{TYPE, Name::SizeFor(Size), RootIndex::k##Name##Size##Map},

◆ ENSURE_SINGLE_CHAR_STRINGS_ARE_SINGLE_CHAR

#define ENSURE_SINGLE_CHAR_STRINGS_ARE_SINGLE_CHAR ( _,
name,
contents )
Value:
static_assert(arraysize(contents) - 1 == 1);

◆ INIT_ACCESSOR_INFO

#define INIT_ACCESSOR_INFO ( _,
accessor_name,
AccessorName,
... )
Value:
accessor_info = Accessors::Make##AccessorName##Info(isolate); \
roots_table()[RootIndex::k##AccessorName##Accessor] = accessor_info->ptr();

◆ INIT_SIDE_EFFECT_FLAG

#define INIT_SIDE_EFFECT_FLAG ( _,
accessor_name,
AccessorName,
GetterType,
SetterType )
Value:
Cast<AccessorInfo>( \
Tagged<Object>(roots_table()[RootIndex::k##AccessorName##Accessor])) \
->set_getter_side_effect_type(SideEffectType::GetterType); \
Cast<AccessorInfo>( \
Tagged<Object>(roots_table()[RootIndex::k##AccessorName##Accessor])) \
->set_setter_side_effect_type(SideEffectType::SetterType);

◆ INTERNALIZED_STRING_INIT

#define INTERNALIZED_STRING_INIT ( _,
name,
description )
Value:
DirectHandle<String> name = factory->InternalizeUtf8String(description); \
roots_table()[RootIndex::k##name] = name->ptr();

◆ PUBLIC_SYMBOL_INIT

#define PUBLIC_SYMBOL_INIT ( _,
name,
description )
Value:
DirectHandle<Symbol> name = factory->NewSymbol(AllocationType::kReadOnly); \
DirectHandle<String> name##d = factory->InternalizeUtf8String(#description); \
name->set_description(*name##d); \
roots_table()[RootIndex::k##name] = name->ptr();

◆ STRING_TYPE_ELEMENT

#define STRING_TYPE_ELEMENT ( type,
size,
name,
CamelName )
Value:
{type, size, RootIndex::k##CamelName##Map},
InstanceType type

◆ STRUCT_TABLE_ELEMENT

#define STRUCT_TABLE_ELEMENT ( TYPE,
Name,
name )
Value:
{TYPE, StructSize<Name>(), RootIndex::k##Name##Map},

◆ SYMBOL_INIT

#define SYMBOL_INIT ( _,
name )
Value:
{ \
DirectHandle<Symbol> symbol( \
isolate()->factory()->NewPrivateSymbol(AllocationType::kReadOnly)); \
roots_table()[RootIndex::k##name] = symbol->ptr(); \
}
Isolate * isolate

◆ TORQUE_ALLOCATE_MAP

#define TORQUE_ALLOCATE_MAP ( NAME,
Name,
name )
Value:
ALLOCATE_MAP(NAME, Name::SizeFor(), name)
#define NAME(feat,...)

◆ TORQUE_ALLOCATE_VARSIZE_MAP

#define TORQUE_ALLOCATE_VARSIZE_MAP ( NAME,
Name,
name )
Value:
/* The DescriptorArray map is pre-allocated and initialized above. */ \
if (NAME != DESCRIPTOR_ARRAY_TYPE) { \
ALLOCATE_VARSIZE_MAP(NAME, name) \
}

◆ WELL_KNOWN_SYMBOL_INIT

#define WELL_KNOWN_SYMBOL_INIT ( _,
name,
description )
Value:
DirectHandle<Symbol> name = factory->NewSymbol(AllocationType::kReadOnly); \
DirectHandle<String> name##d = factory->InternalizeUtf8String(#description); \
name->set_is_well_known_symbol(true); \
name->set_description(*name##d); \
roots_table()[RootIndex::k##name] = name->ptr();

Variable Documentation

◆ contents

base::Vector<const char> contents

Definition at line 105 of file setup-heap-internal.cc.

◆ index

RootIndex index

Definition at line 106 of file setup-heap-internal.cc.

◆ size

int size

Definition at line 131 of file setup-heap-internal.cc.

◆ type

InstanceType type

Definition at line 130 of file setup-heap-internal.cc.