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

#include <roots-serializer.h>

Inheritance diagram for v8::internal::RootsSerializer:
Collaboration diagram for v8::internal::RootsSerializer:

Public Member Functions

 RootsSerializer (Isolate *isolate, Snapshot::SerializerFlags flags, RootIndex first_root_to_be_serialized)
 
 RootsSerializer (const RootsSerializer &)=delete
 
RootsSerializeroperator= (const RootsSerializer &)=delete
 
bool can_be_rehashed () const
 
bool root_has_been_serialized (RootIndex root_index) const
 
bool IsRootAndHasBeenSerialized (Tagged< HeapObject > obj) const
 
- Public Member Functions inherited from v8::internal::Serializer
 Serializer (Isolate *isolate, Snapshot::SerializerFlags flags)
 
 ~Serializer () override
 
 Serializer (const Serializer &)=delete
 
Serializeroperator= (const Serializer &)=delete
 
const std::vector< uint8_t > * Payload () const
 
bool ReferenceMapContains (DirectHandle< HeapObject > o)
 
Isolateisolate () const
 
PtrComprCageBase cage_base () const
 
int TotalAllocationSize () const
 
- Public Member Functions inherited from v8::internal::RootVisitor
virtual ~RootVisitor ()=default
 
virtual void VisitRootPointer (Root root, const char *description, FullObjectSlot p)
 
virtual void VisitRootPointers (Root root, const char *description, OffHeapObjectSlot start, OffHeapObjectSlot end)
 
virtual void VisitRunningCode (FullObjectSlot code_slot, FullObjectSlot istream_or_smi_zero_slot)
 
virtual GarbageCollector collector () const
 

Protected Member Functions

void CheckRehashability (Tagged< HeapObject > obj)
 
int SerializeInObjectCache (Handle< HeapObject > object)
 
bool object_cache_empty ()
 
- Protected Member Functions inherited from v8::internal::Serializer
V8_INLINE bool IsNotMappedSymbol (Tagged< HeapObject > obj) const
 
void SerializeDeferredObjects ()
 
void SerializeObject (Handle< HeapObject > o, SlotType slot_type)
 
virtual void SerializeObjectImpl (Handle< HeapObject > o, SlotType slot_type)=0
 
virtual bool MustBeDeferred (Tagged< HeapObject > object)
 
void VisitRootPointers (Root root, const char *description, FullObjectSlot start, FullObjectSlot end) override
 
void SerializeRootObject (FullObjectSlot slot)
 
void PutRoot (RootIndex root_index)
 
void PutSmiRoot (FullObjectSlot slot)
 
void PutBackReference (Tagged< HeapObject > object, SerializerReference reference)
 
void PutAttachedReference (SerializerReference reference)
 
void PutNextChunk (SnapshotSpace space)
 
void PutRepeatRoot (int repeat_count, RootIndex root_index)
 
void PutPendingForwardReference (PendingObjectReferences &ref)
 
void ResolvePendingForwardReference (int obj)
 
bool SerializeRoot (Tagged< HeapObject > obj)
 
bool SerializeHotObject (Tagged< HeapObject > obj)
 
bool SerializeBackReference (Tagged< HeapObject > obj)
 
bool SerializePendingObject (Tagged< HeapObject > obj)
 
bool ObjectIsBytecodeHandler (Tagged< HeapObject > obj) const
 
ExternalReferenceEncoder::Value EncodeExternalReference (Address addr)
 
Maybe< ExternalReferenceEncoder::ValueTryEncodeExternalReference (Address addr)
 
bool SerializeReadOnlyObjectReference (Tagged< HeapObject > obj, SnapshotByteSink *sink)
 
void Pad (int padding_offset=0)
 
void InitializeCodeAddressMap ()
 
Tagged< InstructionStreamCopyCode (Tagged< InstructionStream > istream)
 
void QueueDeferredObject (Tagged< HeapObject > obj)
 
void RegisterObjectIsPending (Tagged< HeapObject > obj)
 
void ResolvePendingObject (Tagged< HeapObject > obj)
 
void OutputStatistics (const char *name)
 
void CountAllocation (Tagged< Map > map, int size, SnapshotSpace space)
 
SerializerReferenceMapreference_map ()
 
const RootIndexMaproot_index_map () const
 
bool allow_unknown_external_references_for_testing () const
 
bool allow_active_isolate_for_testing () const
 
bool reconstruct_read_only_and_shared_object_caches_for_testing () const
 
bool deferred_objects_empty ()
 
bool serializer_tracks_serialization_statistics () const
 
void set_serializer_tracks_serialization_statistics (bool v)
 
- Protected Member Functions inherited from v8::internal::SerializerDeserializer
void RestoreExternalReferenceRedirector (Isolate *isolate, Tagged< AccessorInfo > accessor_info)
 
void RestoreExternalReferenceRedirector (Isolate *isolate, Tagged< FunctionTemplateInfo > function_template_info)
 

Private Member Functions

void VisitRootPointers (Root root, const char *description, FullObjectSlot start, FullObjectSlot end) override
 
void Synchronize (VisitorSynchronization::SyncTag tag) override
 

Private Attributes

const RootIndex first_root_to_be_serialized_
 
std::bitset< RootsTable::kEntriesCountroot_has_been_serialized_
 
ObjectCacheIndexMap object_cache_index_map_
 
bool can_be_rehashed_
 

Additional Inherited Members

- Static Public Member Functions inherited from v8::internal::SerializerDeserializer
static void IterateStartupObjectCache (Isolate *isolate, RootVisitor *visitor)
 
static void IterateSharedHeapObjectCache (Isolate *isolate, RootVisitor *visitor)
 
- Static Public Member Functions inherited from v8::internal::RootVisitor
static const char * RootName (Root root)
 
- Protected Types inherited from v8::internal::Serializer
using PendingObjectReferences = std::vector<int>*
 
- Protected Types inherited from v8::internal::SerializerDeserializer
enum class  SlotType { kAnySlot , kMapSlot }
 
enum  Bytecode : uint8_t {
  kNewObject = 0x00 , kBackref = 0x04 , kReadOnlyHeapRef , kStartupObjectCache ,
  kRootArray , kAttachedReference , kSharedHeapObjectCache , kNop ,
  kSynchronize , kVariableRepeatRoot , kOffHeapBackingStore , kOffHeapResizableBackingStore ,
  kEmbedderFieldsData , kApiWrapperFieldsData , kVariableRawData , kApiReference ,
  kExternalReference , kSandboxedApiReference , kSandboxedExternalReference , kSandboxedRawExternalReference ,
  kClearedWeakReference , kWeakPrefix , kRegisterPendingForwardRef , kResolvePendingForwardRef ,
  kNewContextlessMetaMap , kNewContextfulMetaMap , kIndirectPointerPrefix , kInitializeSelfIndirectPointer ,
  kAllocateJSDispatchEntry , kJSDispatchEntry , kProtectedPointerPrefix , kRootArrayConstants = 0x40 ,
  kFixedRawData = 0x60 , kFixedRepeatRoot = 0x80 , kHotObject = 0x90
}
 
template<Bytecode bytecode>
using SpaceEncoder
 
using NewObject = SpaceEncoder<kNewObject>
 
using FixedRawDataWithSize
 
using FixedRepeatRootWithCount
 
using RootArrayConstant
 
using HotObject = BytecodeValueEncoder<kHotObject, 0, kHotObjectCount - 1>
 
- Static Protected Member Functions inherited from v8::internal::SerializerDeserializer
static bool CanBeDeferred (Tagged< HeapObject > o, SlotType slot_type)
 
- Protected Attributes inherited from v8::internal::Serializer
SnapshotByteSink sink_
 
- Static Protected Attributes inherited from v8::internal::SerializerDeserializer
static const int kRootArrayConstantsCount = 0x20
 
static const int kFixedRawDataCount = 0x20
 
static const int kFixedRepeatRootCount = 0x10
 
static const int kHotObjectCount = 8
 
static const int kDoubleAlignmentSentinel = 0
 
static const int kFirstEncodableFixedRawDataSize = 1
 
static const int kLastEncodableFixedRawDataSize
 
static const int kFirstEncodableRepeatRootCount = 2
 
static const int kLastEncodableFixedRepeatRootCount
 
static const int kFirstEncodableVariableRepeatRootCount
 
static const uint32_t kEmptyBackingStoreRefSentinel = 0
 

Detailed Description

Definition at line 23 of file roots-serializer.h.

Constructor & Destructor Documentation

◆ RootsSerializer() [1/2]

v8::internal::RootsSerializer::RootsSerializer ( Isolate * isolate,
Snapshot::SerializerFlags flags,
RootIndex first_root_to_be_serialized )

Definition at line 14 of file roots-serializer.cc.

◆ RootsSerializer() [2/2]

v8::internal::RootsSerializer::RootsSerializer ( const RootsSerializer & )
delete

Member Function Documentation

◆ can_be_rehashed()

bool v8::internal::RootsSerializer::can_be_rehashed ( ) const
inline

Definition at line 32 of file roots-serializer.h.

Here is the caller graph for this function:

◆ CheckRehashability()

void v8::internal::RootsSerializer::CheckRehashability ( Tagged< HeapObject > obj)
protected

Definition at line 60 of file roots-serializer.cc.

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

◆ IsRootAndHasBeenSerialized()

bool v8::internal::RootsSerializer::IsRootAndHasBeenSerialized ( Tagged< HeapObject > obj) const
inline

Definition at line 37 of file roots-serializer.h.

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

◆ object_cache_empty()

bool v8::internal::RootsSerializer::object_cache_empty ( )
inlineprotected

Definition at line 49 of file roots-serializer.h.

Here is the call graph for this function:

◆ operator=()

RootsSerializer & v8::internal::RootsSerializer::operator= ( const RootsSerializer & )
delete

◆ root_has_been_serialized()

bool v8::internal::RootsSerializer::root_has_been_serialized ( RootIndex root_index) const
inline

Definition at line 33 of file roots-serializer.h.

Here is the caller graph for this function:

◆ SerializeInObjectCache()

int v8::internal::RootsSerializer::SerializeInObjectCache ( Handle< HeapObject > object)
protected

Definition at line 27 of file roots-serializer.cc.

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

◆ Synchronize()

void v8::internal::RootsSerializer::Synchronize ( VisitorSynchronization::SyncTag tag)
overrideprivatevirtual

Reimplemented from v8::internal::RootVisitor.

Definition at line 37 of file roots-serializer.cc.

Here is the call graph for this function:

◆ VisitRootPointers()

void v8::internal::RootsSerializer::VisitRootPointers ( Root root,
const char * description,
FullObjectSlot start,
FullObjectSlot end )
overrideprivatevirtual

Implements v8::internal::RootVisitor.

Definition at line 41 of file roots-serializer.cc.

Here is the call graph for this function:

Member Data Documentation

◆ can_be_rehashed_

bool v8::internal::RootsSerializer::can_be_rehashed_
private

Definition at line 61 of file roots-serializer.h.

◆ first_root_to_be_serialized_

const RootIndex v8::internal::RootsSerializer::first_root_to_be_serialized_
private

Definition at line 56 of file roots-serializer.h.

◆ object_cache_index_map_

ObjectCacheIndexMap v8::internal::RootsSerializer::object_cache_index_map_
private

Definition at line 58 of file roots-serializer.h.

◆ root_has_been_serialized_

std::bitset<RootsTable::kEntriesCount> v8::internal::RootsSerializer::root_has_been_serialized_
private

Definition at line 57 of file roots-serializer.h.


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