v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::LocalFactory Class Reference

#include <local-factory.h>

Inheritance diagram for v8::internal::LocalFactory:
Collaboration diagram for v8::internal::LocalFactory:

Public Member Functions

 LocalFactory (Isolate *isolate)
 
ReadOnlyRoots read_only_roots () const
 
DirectHandle< Object > NewInvalidStringLengthError ()
 
DirectHandle< Object > NewRangeError (MessageTemplate template_index)
 
int NumberToStringCacheHash (Tagged< Smi > number)
 
int NumberToStringCacheHash (double number)
 
void NumberToStringCacheSet (DirectHandle< Object > number, int hash, DirectHandle< String > js_string)
 
Handle< Object > NumberToStringCacheGet (Tagged< Object > number, int hash)
 
- Public Member Functions inherited from v8::internal::FactoryBase< LocalFactory >
Handle< Code > NewCode (const NewCodeOptions &options)
 
DirectHandle< CodeWrapper > NewCodeWrapper ()
 
Handle< Boolean > ToBoolean (bool value)
 
Handle< Number > NewNumber (double value)
 
Handle< Number > NewNumberFromInt (int32_t value)
 
Handle< Number > NewNumberFromUint (uint32_t value)
 
DirectHandle< Number > NewNumberFromSize (size_t value)
 
DirectHandle< Number > NewNumberFromInt64 (int64_t value)
 
Handle< HeapNumber > NewHeapNumber (double value)
 
Handle< HeapNumber > NewHeapNumber ()
 
Handle< HeapNumber > NewHeapNumberFromBits (uint64_t bits)
 
Handle< HeapNumber > NewHeapNumberWithHoleNaN ()
 
Handle< HeapNumber > NewHeapInt32 (int32_t value)
 
Handle< Struct > NewStruct (InstanceType type, AllocationType allocation=AllocationType::kYoung)
 
Handle< AccessorPair > NewAccessorPair ()
 
Handle< FixedArray > NewFixedArray (int length, AllocationType allocation=AllocationType::kYoung)
 
Handle< TrustedFixedArray > NewTrustedFixedArray (int length, AllocationType allocation=AllocationType::kTrusted)
 
Handle< ProtectedFixedArray > NewProtectedFixedArray (int length)
 
Handle< FixedArray > NewFixedArrayWithMap (DirectHandle< Map > map, int length, AllocationType allocation=AllocationType::kYoung)
 
Handle< FixedArray > NewFixedArrayWithHoles (int length, AllocationType allocation=AllocationType::kYoung)
 
DirectHandle< FixedArray > NewFixedArrayWithZeroes (int length, AllocationType allocation=AllocationType::kYoung)
 
Handle< FixedArrayBase > NewFixedDoubleArray (int length, AllocationType allocation=AllocationType::kYoung)
 
Handle< WeakFixedArray > NewWeakFixedArrayWithMap (Tagged< Map > map, int length, AllocationType allocation=AllocationType::kYoung)
 
Handle< WeakFixedArray > NewWeakFixedArray (int length, AllocationType allocation=AllocationType::kYoung)
 
Handle< TrustedWeakFixedArray > NewTrustedWeakFixedArray (int length)
 
Handle< ProtectedWeakFixedArray > NewProtectedWeakFixedArray (int length)
 
Handle< ByteArray > NewByteArray (int length, AllocationType allocation=AllocationType::kYoung)
 
Handle< TrustedByteArray > NewTrustedByteArray (int length, AllocationType allocation_type=AllocationType::kTrusted)
 
DirectHandle< DeoptimizationLiteralArray > NewDeoptimizationLiteralArray (int length)
 
DirectHandle< DeoptimizationFrameTranslation > NewDeoptimizationFrameTranslation (int length)
 
Handle< BytecodeArray > NewBytecodeArray (int length, const uint8_t *raw_bytecodes, int frame_size, uint16_t parameter_count, uint16_t max_arguments, DirectHandle< TrustedFixedArray > constant_pool, DirectHandle< TrustedByteArray > handler_table, AllocationType allocation=AllocationType::kTrusted)
 
DirectHandle< BytecodeWrapper > NewBytecodeWrapper (AllocationType allocation=AllocationType::kOld)
 
Handle< ObjectBoilerplateDescription > NewObjectBoilerplateDescription (int boilerplate, int all_properties, int index_keys, bool has_seen_proto)
 
Handle< ArrayBoilerplateDescription > NewArrayBoilerplateDescription (ElementsKind elements_kind, DirectHandle< FixedArrayBase > constant_values)
 
DirectHandle< RegExpDataWrapper > NewRegExpDataWrapper ()
 
DirectHandle< RegExpBoilerplateDescription > NewRegExpBoilerplateDescription (DirectHandle< RegExpData > data, DirectHandle< String > source, Tagged< Smi > flags)
 
Handle< TemplateObjectDescription > NewTemplateObjectDescription (DirectHandle< FixedArray > raw_strings, DirectHandle< FixedArray > cooked_strings)
 
Handle< Script > NewScript (DirectHandle< UnionOf< String, Undefined > > source, ScriptEventType event_type=ScriptEventType::kCreate)
 
Handle< Script > NewScriptWithId (DirectHandle< UnionOf< String, Undefined > > source, int script_id, ScriptEventType event_type=ScriptEventType::kCreate)
 
DirectHandle< SloppyArgumentsElements > NewSloppyArgumentsElements (int length, DirectHandle< Context > context, DirectHandle< FixedArray > arguments, AllocationType allocation=AllocationType::kYoung)
 
DirectHandle< ArrayList > NewArrayList (int size, AllocationType allocation=AllocationType::kYoung)
 
Handle< SharedFunctionInfo > NewSharedFunctionInfoForLiteral (FunctionLiteral *literal, DirectHandle< Script > script, bool is_toplevel)
 
Handle< SharedFunctionInfo > CloneSharedFunctionInfo (DirectHandle< SharedFunctionInfo > other)
 
DirectHandle< SharedFunctionInfoWrapper > NewSharedFunctionInfoWrapper (DirectHandle< SharedFunctionInfo > sfi)
 
Handle< PreparseData > NewPreparseData (int data_length, int children_length)
 
DirectHandle< UncompiledDataWithoutPreparseData > NewUncompiledDataWithoutPreparseData (Handle< String > inferred_name, int32_t start_position, int32_t end_position)
 
DirectHandle< UncompiledDataWithPreparseData > NewUncompiledDataWithPreparseData (Handle< String > inferred_name, int32_t start_position, int32_t end_position, Handle< PreparseData >)
 
DirectHandle< UncompiledDataWithoutPreparseDataWithJob > NewUncompiledDataWithoutPreparseDataWithJob (Handle< String > inferred_name, int32_t start_position, int32_t end_position)
 
DirectHandle< UncompiledDataWithPreparseDataAndJob > NewUncompiledDataWithPreparseDataAndJob (Handle< String > inferred_name, int32_t start_position, int32_t end_position, Handle< PreparseData >)
 
Handle< FeedbackMetadata > NewFeedbackMetadata (int slot_count, int create_closure_slot_count, AllocationType allocation=AllocationType::kOld)
 
Handle< CoverageInfo > NewCoverageInfo (const ZoneVector< SourceRange > &slots)
 
Handle< String > InternalizeString (base::Vector< const uint8_t > string, bool convert_encoding=false)
 
Handle< String > InternalizeString (base::Vector< const uint16_t > string, bool convert_encoding=false)
 
Handle< String > InternalizeStringWithKey (StringTableKey *key)
 
Handle< SeqOneByteString > NewOneByteInternalizedString (base::Vector< const uint8_t > str, uint32_t raw_hash_field)
 
Handle< SeqTwoByteString > NewTwoByteInternalizedString (base::Vector< const base::uc16 > str, uint32_t raw_hash_field)
 
DirectHandle< SeqOneByteString > NewOneByteInternalizedStringFromTwoByte (base::Vector< const base::uc16 > str, uint32_t raw_hash_field)
 
Handle< SeqOneByteString > AllocateRawOneByteInternalizedString (int length, uint32_t raw_hash_field)
 
Handle< SeqTwoByteString > AllocateRawTwoByteInternalizedString (int length, uint32_t raw_hash_field)
 
Handle< String > LookupSingleCharacterStringFromCode (uint16_t code)
 
MaybeHandle< String > NewStringFromOneByte (base::Vector< const uint8_t > string, AllocationType allocation=AllocationType::kYoung)
 
Handle< String > NewStringFromAsciiChecked (const char *str, AllocationType allocation=AllocationType::kYoung)
 
Handle< String > NewStringFromAsciiChecked (std::string_view str, AllocationType allocation=AllocationType::kYoung)
 
V8_WARN_UNUSED_RESULT MaybeHandle< SeqOneByteString > NewRawOneByteString (int length, AllocationType allocation=AllocationType::kYoung)
 
V8_WARN_UNUSED_RESULT MaybeHandle< SeqTwoByteString > NewRawTwoByteString (int length, AllocationType allocation=AllocationType::kYoung)
 
V8_WARN_UNUSED_RESULT HandleType< String >::MaybeType NewConsString (HandleType< String > left, HandleType< String > right, AllocationType allocation=AllocationType::kYoung)
 
V8_WARN_UNUSED_RESULT Handle< String > NewConsString (DirectHandle< String > left, DirectHandle< String > right, int length, bool one_byte, AllocationType allocation=AllocationType::kYoung)
 
HandleType< String >::MaybeType NewConsString (HandleType< String > left, HandleType< String > right, AllocationType allocation)
 
V8_WARN_UNUSED_RESULT Handle< String > NumberToString (DirectHandle< Object > number, NumberCacheMode mode=NumberCacheMode::kBoth)
 
V8_WARN_UNUSED_RESULT Handle< String > HeapNumberToString (DirectHandle< HeapNumber > number, double value, NumberCacheMode mode=NumberCacheMode::kBoth)
 
V8_WARN_UNUSED_RESULT Handle< String > SmiToString (Tagged< Smi > number, NumberCacheMode mode=NumberCacheMode::kBoth)
 
V8_WARN_UNUSED_RESULT MaybeHandle< SeqOneByteString > NewRawSharedOneByteString (int length)
 
V8_WARN_UNUSED_RESULT MaybeHandle< SeqTwoByteString > NewRawSharedTwoByteString (int length)
 
Handle< FreshlyAllocatedBigInt > NewBigInt (uint32_t length, AllocationType allocation=AllocationType::kYoung)
 
Handle< ScopeInfo > NewScopeInfo (int length, AllocationType type=AllocationType::kOld)
 
DirectHandle< SourceTextModuleInfo > NewSourceTextModuleInfo ()
 
Handle< DescriptorArray > NewDescriptorArray (int number_of_descriptors, int slack=0, AllocationType allocation=AllocationType::kYoung)
 
Handle< ClassPositions > NewClassPositions (int start, int end)
 
Handle< SwissNameDictionary > NewSwissNameDictionary (int at_least_space_for=kSwissNameDictionaryInitialCapacity, AllocationType allocation=AllocationType::kYoung)
 
Handle< SwissNameDictionary > NewSwissNameDictionaryWithCapacity (int capacity, AllocationType allocation)
 
DirectHandle< FunctionTemplateRareData > NewFunctionTemplateRareData ()
 
MaybeDirectHandle< Map > GetInPlaceInternalizedStringMap (Tagged< Map > from_string_map)
 
AllocationType RefineAllocationTypeForInPlaceInternalizableString (AllocationType allocation, Tagged< Map > string_map)
 

Private Member Functions

Tagged< HeapObject > AllocateRaw (int size, AllocationType allocation, AllocationAlignment alignment=kTaggedAligned)
 
LocalIsolate * isolate ()
 
bool CanAllocateInReadOnlySpace ()
 
bool EmptyStringRootIsInitialized ()
 
AllocationType AllocationTypeForInPlaceInternalizableString ()
 
void ProcessNewScript (DirectHandle< Script > script, ScriptEventType script_event_type)
 

Private Attributes

ReadOnlyRoots roots_
 

Friends

class FactoryBase< LocalFactory >
 

Additional Inherited Members

- Protected Member Functions inherited from v8::internal::FactoryBase< LocalFactory >
Tagged< HeapObject > AllocateRawArray (int size, AllocationType allocation)
 
Tagged< HeapObject > AllocateRawFixedArray (int length, AllocationType allocation)
 
Tagged< HeapObject > AllocateRawWeakArrayList (int length, AllocationType allocation)
 
Tagged< StructType > NewStructInternal (InstanceType type, AllocationType allocation)
 
Tagged< Struct > NewStructInternal (ReadOnlyRoots roots, Tagged< Map > map, int size, AllocationType allocation)
 
Tagged< HeapObject > AllocateRawWithImmortalMap (int size, AllocationType allocation, Tagged< Map > map, AllocationAlignment alignment=kTaggedAligned)
 
Tagged< HeapObject > NewWithImmortalMap (Tagged< Map > map, AllocationType allocation)
 
Handle< FixedArray > NewFixedArrayWithFiller (DirectHandle< Map > map, int length, DirectHandle< HeapObject > filler, AllocationType allocation)
 
Handle< SharedFunctionInfo > NewSharedFunctionInfo (AllocationType allocation)
 
Handle< SharedFunctionInfo > NewSharedFunctionInfo (MaybeDirectHandle< String > maybe_name, MaybeDirectHandle< HeapObject > maybe_function_data, Builtin builtin, int len, AdaptArguments adapt, FunctionKind kind=FunctionKind::kNormalFunction)
 
Handle< String > MakeOrFindTwoCharacterString (uint16_t c1, uint16_t c2)
 
MaybeHandle< SeqStringT > NewRawStringWithMap (int length, Tagged< Map > map, AllocationType allocation)
 
- Static Protected Attributes inherited from v8::internal::FactoryBase< LocalFactory >
static constexpr int kNumberToStringBufferSize
 

Detailed Description

Definition at line 25 of file local-factory.h.

Constructor & Destructor Documentation

◆ LocalFactory()

v8::internal::LocalFactory::LocalFactory ( Isolate * isolate)
explicit

Definition at line 24 of file local-factory.cc.

Member Function Documentation

◆ AllocateRaw()

Tagged< HeapObject > v8::internal::LocalFactory::AllocateRaw ( int size,
AllocationType allocation,
AllocationAlignment alignment = kTaggedAligned )
private

Definition at line 48 of file local-factory.cc.

Here is the call graph for this function:

◆ AllocationTypeForInPlaceInternalizableString()

AllocationType v8::internal::LocalFactory::AllocationTypeForInPlaceInternalizableString ( )
inlineprivate

Definition at line 25 of file local-factory-inl.h.

Here is the call graph for this function:

◆ CanAllocateInReadOnlySpace()

bool v8::internal::LocalFactory::CanAllocateInReadOnlySpace ( )
inlineprivate

Definition at line 73 of file local-factory.h.

◆ EmptyStringRootIsInitialized()

bool v8::internal::LocalFactory::EmptyStringRootIsInitialized ( )
inlineprivate

Definition at line 74 of file local-factory.h.

◆ isolate()

LocalIsolate * v8::internal::LocalFactory::isolate ( )
inlineprivate

Definition at line 65 of file local-factory.h.

Here is the caller graph for this function:

◆ NewInvalidStringLengthError()

DirectHandle< Object > v8::internal::LocalFactory::NewInvalidStringLengthError ( )
inline

Definition at line 41 of file local-factory.h.

◆ NewRangeError()

DirectHandle< Object > v8::internal::LocalFactory::NewRangeError ( MessageTemplate template_index)
inline

Definition at line 42 of file local-factory.h.

◆ NumberToStringCacheGet()

Handle< Object > v8::internal::LocalFactory::NumberToStringCacheGet ( Tagged< Object > number,
int hash )

Definition at line 65 of file local-factory.cc.

◆ NumberToStringCacheHash() [1/2]

int v8::internal::LocalFactory::NumberToStringCacheHash ( double number)

Definition at line 60 of file local-factory.cc.

◆ NumberToStringCacheHash() [2/2]

int v8::internal::LocalFactory::NumberToStringCacheHash ( Tagged< Smi > number)

Definition at line 58 of file local-factory.cc.

◆ NumberToStringCacheSet()

void v8::internal::LocalFactory::NumberToStringCacheSet ( DirectHandle< Object > number,
int hash,
DirectHandle< String > js_string )

Definition at line 62 of file local-factory.cc.

◆ ProcessNewScript()

void v8::internal::LocalFactory::ProcessNewScript ( DirectHandle< Script > script,
ScriptEventType script_event_type )
private

Definition at line 26 of file local-factory.cc.

◆ read_only_roots()

ReadOnlyRoots v8::internal::LocalFactory::read_only_roots ( ) const
inline

Definition at line 29 of file local-factory.h.

Friends And Related Symbol Documentation

◆ FactoryBase< LocalFactory >

friend class FactoryBase< LocalFactory >
friend

Definition at line 54 of file local-factory.h.

Member Data Documentation

◆ roots_

ReadOnlyRoots v8::internal::LocalFactory::roots_
private

Definition at line 82 of file local-factory.h.


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