v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Serializer Class Referenceabstract

#include <serialize.h>

Inheritance diagram for Serializer:
Collaboration diagram for Serializer:

Data Structures

class  ObjectSerializer
 

Public Member Functions

 Serializer (Isolate *isolate, SnapshotByteSink *sink)
 
 ~Serializer ()
 
void VisitPointers (Object **start, Object **end)
 
int CurrentAllocationAddress (int space)
 
Isolateisolate () const
 
SerializationAddressMapperaddress_mapper ()
 
void PutRoot (int index, HeapObject *object, HowToCode how, WhereToPoint where, int skip)
 

Static Public Member Functions

static void Enable (Isolate *isolate)
 
static void Disable ()
 
static void TooLateToEnableNow ()
 
static bool enabled ()
 
- Static Public Member Functions inherited from SerializerDeserializer
static void Iterate (Isolate *isolate, ObjectVisitor *visitor)
 
static int nop ()
 

Protected Member Functions

int RootIndex (HeapObject *heap_object, HowToCode from)
 
virtual bool ShouldBeInThePartialSnapshotCache (HeapObject *o)=0
 
intptr_t root_index_wave_front ()
 
void set_root_index_wave_front (intptr_t value)
 
virtual void SerializeObject (Object *o, HowToCode how_to_code, WhereToPoint where_to_point, int skip)=0
 
void SerializeReferenceToPreviousObject (int space, int address, HowToCode how_to_code, WhereToPoint where_to_point, int skip)
 
void InitializeAllocators ()
 
int Allocate (int space, int size)
 
int EncodeExternalReference (Address addr)
 
int SpaceAreaSize (int space)
 
bool ShouldBeSkipped (Object **current)
 
void Pad ()
 

Static Protected Member Functions

static int SpaceOfObject (HeapObject *object)
 
- Static Protected Member Functions inherited from SerializerDeserializer
static int CodeForRepeats (int repeats)
 
static int RepeatsForCode (int byte_code)
 
static int RootArrayConstantFromByteCode (int byte_code)
 

Protected Attributes

Isolateisolate_
 
int fullness_ [LAST_SPACE+1]
 
SnapshotByteSinksink_
 
ExternalReferenceEncoderexternal_reference_encoder_
 
SerializationAddressMapper address_mapper_
 
intptr_t root_index_wave_front_
 

Static Protected Attributes

static const int kInvalidRootIndex = -1
 
static bool serialization_enabled_ = false
 
static bool too_late_to_enable_now_ = false
 
- Static Protected Attributes inherited from SerializerDeserializer
static const int kRawData = 0x20
 
static const int kSynchronize = 0x70
 
static const int kNativesStringResource = 0x71
 
static const int kRepeat = 0x72
 
static const int kConstantRepeat = 0x73
 
static const int kMaxRepeats = 0x7f - 0x72
 
static const int kRootArrayConstants = 0xa0
 
static const int kRootArrayNumberOfConstantEncodings = 0x20
 
static const int kNumberOfSpaces = LO_SPACE
 
static const int kAnyOldSpace = -1
 
static const int kSpaceMask = 7
 

Friends

class ObjectSerializer
 
class Deserializer
 

Additional Inherited Members

- Protected Types inherited from SerializerDeserializer
enum  Where {
  kNewObject = 0, kRootArray = 0x9, kPartialSnapshotCache = 0xa, kExternalReference = 0xb,
  kSkip = 0xc, kNop = 0xd, kBackref = 0x10, kBackrefWithSkip = 0x18,
  kPointedToMask = 0x3f
}
 
enum  HowToCode { kPlain = 0, kFromCode = 0x40, kHowToCodeMask = 0x40 }
 
enum  WithSkip { kNoSkipDistance = 0, kHasSkipDistance = 0x40, kWithSkipMask = 0x40 }
 
enum  WhereToPoint { kStartOfObject = 0, kInnerPointer = 0x80, kWhereToPointMask = 0x80 }
 

Detailed Description

Definition at line 466 of file serialize.h.

Constructor & Destructor Documentation

Serializer ( Isolate isolate,
SnapshotByteSink sink 
)

Definition at line 1272 of file serialize.cc.

References Serializer::fullness_, and v8::internal::LAST_SPACE.

~Serializer ( )

Definition at line 1285 of file serialize.cc.

References Serializer::external_reference_encoder_.

Member Function Documentation

int Allocate ( int  space,
int  size 
)
protected
int CurrentAllocationAddress ( int  space)
inline
void Disable ( )
static

Definition at line 772 of file serialize.cc.

References v8::internal::NULL, and Serializer::serialization_enabled_.

void Enable ( Isolate isolate)
static
int EncodeExternalReference ( Address  addr)
inlineprotected
void InitializeAllocators ( )
protected
intptr_t root_index_wave_front ( )
inlineprotected

Definition at line 498 of file serialize.h.

References Serializer::root_index_wave_front_.

virtual void SerializeObject ( Object o,
HowToCode  how_to_code,
WhereToPoint  where_to_point,
int  skip 
)
protectedpure virtual
void SerializeReferenceToPreviousObject ( int  space,
int  address,
HowToCode  how_to_code,
WhereToPoint  where_to_point,
int  skip 
)
protected
void set_root_index_wave_front ( intptr_t  value)
inlineprotected

Definition at line 499 of file serialize.h.

References ASSERT, and Serializer::root_index_wave_front_.

Referenced by PartialSerializer::PartialSerializer().

virtual bool ShouldBeInThePartialSnapshotCache ( HeapObject o)
protectedpure virtual

Implemented in PartialSerializer.

bool ShouldBeSkipped ( Object **  current)
protected
static void TooLateToEnableNow ( )
inlinestatic

Definition at line 484 of file serialize.h.

References Serializer::too_late_to_enable_now_.

Friends And Related Function Documentation

friend class Deserializer
friend

Definition at line 591 of file serialize.h.

friend class ObjectSerializer
friend

Definition at line 590 of file serialize.h.

Field Documentation

ExternalReferenceEncoder* external_reference_encoder_
protected

Definition at line 582 of file serialize.h.

Referenced by Serializer::EncodeExternalReference(), and Serializer::~Serializer().

int fullness_[LAST_SPACE+1]
protected
Isolate* isolate_
protected
const int kInvalidRootIndex = -1
staticprotected
intptr_t root_index_wave_front_
protected
bool serialization_enabled_ = false
staticprotected

Definition at line 583 of file serialize.h.

Referenced by Serializer::Disable(), Serializer::Enable(), and Serializer::enabled().

bool too_late_to_enable_now_ = false
staticprotected

Definition at line 585 of file serialize.h.

Referenced by Serializer::Enable(), and Serializer::TooLateToEnableNow().


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