5 #ifndef V8_SERIALIZE_H_
6 #define V8_SERIALIZE_H_
120 if (key == 0)
return NULL;
219 return 0x72 + repeats;
223 return byte_code - 0x72;
229 return byte_code & 0x1f;
255 DCHECK(space_number >= 0);
298 int offset =
source_->GetInt();
345 return static_cast<int>(
reinterpret_cast<intptr_t
>(
351 HashMap::Entry* entry =
358 return static_cast<int32_t>(
reinterpret_cast<intptr_t
>(obj->
address()));
362 return reinterpret_cast<void*
>(obj->
address());
366 return reinterpret_cast<void*
>(v);
533 return o->IsName() || o->IsSharedFunctionInfo() ||
534 o->IsHeapNumber() || o->IsCode() ||
554 isolate->set_serialize_partial_snapshot_cache_length(0);
592 DCHECK(!AllowHeapAllocation::IsAllowed());
668 return payload_length;
An ExternalOneByteStringResource is a wrapper around an one-byte string buffer that resides outside V...
An ExternalStringResource is a wrapper around a two-byte string buffer that resides outside V8's heap...
CodeSerializer(Isolate *isolate, SnapshotByteSink *sink, String *source, Code *main_code)
static const int kCodeStubsBaseIndex
List< uint32_t > * stub_keys()
static ScriptData * Serialize(Isolate *isolate, Handle< SharedFunctionInfo > info, Handle< String > source)
void SerializeHeapObject(HeapObject *heap_object, HowToCode how_to_code, WhereToPoint where_to_point)
void SerializeSourceObject(HowToCode how_to_code, WhereToPoint where_to_point)
List< uint32_t > stub_keys_
void SerializeBuiltin(Code *builtin, HowToCode how_to_code, WhereToPoint where_to_point)
int AddCodeStubKey(uint32_t stub_key)
DisallowHeapAllocation no_gc_
virtual void SerializeObject(Object *o, HowToCode how_to_code, WhereToPoint where_to_point, int skip)
static Handle< SharedFunctionInfo > Deserialize(Isolate *isolate, ScriptData *data, Handle< String > source)
void SerializeCodeStub(Code *stub, HowToCode how_to_code, WhereToPoint where_to_point)
DISALLOW_COPY_AND_ASSIGN(CodeSerializer)
static const int kSourceObjectIndex
ExternalReferenceDecoder * external_reference_decoder_
int reservations_[kNumberOfSpaces]
void ReadChunk(Object **start, Object **end, int space, Address object_address)
Address Allocate(int space_index, int size)
Vector< Handle< Object > > * attached_objects_
List< HeapObject * > deserialized_large_objects_
DISALLOW_COPY_AND_ASSIGN(Deserializer)
HeapObject * GetAddressFromEnd(int space)
void DeserializePartial(Isolate *isolate, Object **root)
static const intptr_t kUninitializedReservation
SnapshotByteSource * source_
void Deserialize(Isolate *isolate)
Deserializer(SnapshotByteSource *source)
bool deserializing_user_code()
Object * ProcessBackRefInSerializedCode(Object *obj)
virtual void VisitRuntimeEntry(RelocInfo *rinfo)
virtual void VisitPointers(Object **start, Object **end)
void RelinkAllocationSite(AllocationSite *site)
HeapObject * ProcessNewObjectFromSerializedCode(HeapObject *obj)
void SetAttachedObjects(Vector< Handle< Object > > *attached_objects)
Address high_water_[kNumberOfPreallocatedSpaces]
void set_reservation(int space_number, int reservation)
void ReadObject(int space_number, Object **write_back)
void FlushICacheForNewCodeObjects()
Address Decode(uint32_t key) const
Address * Lookup(uint32_t key) const
~ExternalReferenceDecoder()
ExternalReferenceDecoder(Isolate *isolate)
void Put(uint32_t key, Address value)
static uint32_t Hash(Address key)
int IndexOf(Address key) const
void Put(Address key, int index)
uint32_t Encode(Address key) const
ExternalReferenceEncoder(Isolate *isolate)
const char * NameOfAddress(Address key) const
void Add(Address address, const char *name)
void AddFromId(TypeCode type, uint16_t id, const char *name, Isolate *isolate)
~ExternalReferenceTable()
List< ExternalReferenceEntry > refs_
static ExternalReferenceTable * instance(Isolate *isolate)
void Add(Address address, TypeCode type, uint16_t id, const char *name)
ExternalReferenceTable(Isolate *isolate)
uint16_t max_id_[kTypeCodeCount]
void PopulateTable(Isolate *isolate)
static HeapObject * FromAddress(Address address)
void Serialize(Object **o)
int PartialSnapshotCacheIndex(HeapObject *o)
Serializer * startup_serializer_
PartialSerializer(Isolate *isolate, Serializer *startup_snapshot_serializer, SnapshotByteSink *sink)
virtual void SerializeObject(Object *o, HowToCode how_to_code, WhereToPoint where_to_point, int skip)
bool ShouldBeInThePartialSnapshotCache(HeapObject *o)
DISALLOW_COPY_AND_ASSIGN(PartialSerializer)
const byte * data() const
SerializationAddressMapper()
HashMap * serialization_map_
static uint32_t Hash(HeapObject *obj)
DISALLOW_COPY_AND_ASSIGN(SerializationAddressMapper)
static void * Key(HeapObject *obj)
static void * Value(int v)
DisallowHeapAllocation no_allocation_
int MappedTo(HeapObject *obj)
bool IsMapped(HeapObject *obj)
void AddMapping(HeapObject *obj, int to)
~SerializationAddressMapper()
static const int kHeaderEntries
SerializedCodeData(ScriptData *data, String *source)
static const int kPayloadLengthOffset
void SetHeaderValue(int offset, int value)
static const int kReservationsOffset
int GetHeaderValue(int offset) const
int PayloadLength() const
static const int kCheckSumOffset
ScriptData * script_data_
Vector< const uint32_t > CodeStubKeys() const
const byte * Payload() const
int CheckSum(String *source)
int GetReservation(int space) const
static const int kNumCodeStubKeysOffset
ScriptData * GetScriptData()
static const int kHeaderSize
bool IsSane(String *source)
static const int kSpaceMask
STATIC_ASSERT(kNumberOfSpaces<=kSpaceMask+1)
static int RootArrayConstantFromByteCode(int byte_code)
static int RepeatsForCode(int byte_code)
static const int kNumberOfSpaces
static const int kNativesStringResource
static const int kRawData
static const int kRootArrayNumberOfConstantEncodings
static void Iterate(Isolate *isolate, ObjectVisitor *visitor)
static int CodeForRepeats(int repeats)
static const int kRootArrayConstants
static const int kMaxRepeats
static const int kNumberOfPreallocatedSpaces
static const int kConstantRepeat
static const int kSynchronize
static const int kAnyOldSpace
int OutputRawData(Address up_to, ReturnSkip return_skip=kIgnoringReturn)
void VisitCell(RelocInfo *rinfo)
ObjectSerializer(Serializer *serializer, Object *o, SnapshotByteSink *sink, HowToCode how_to_code, WhereToPoint where_to_point)
void VisitEmbeddedPointer(RelocInfo *target)
void VisitPointers(Object **start, Object **end)
int bytes_processed_so_far_
void VisitRuntimeEntry(RelocInfo *reloc)
void VisitCodeEntry(Address entry_address)
void VisitExternalOneByteString(v8::String::ExternalOneByteStringResource **resource)
void VisitExternalReference(Address *p)
bool code_has_been_output_
int reference_representation_
void VisitExternalTwoByteString(v8::String::ExternalStringResource **resource)
void VisitCodeTarget(RelocInfo *target)
@ kCanReturnSkipInsteadOfSkipping
void InitializeCodeAddressMap()
void InitializeAllocators()
void SerializeReferenceToPreviousObject(HeapObject *heap_object, HowToCode how_to_code, WhereToPoint where_to_point, int skip)
ExternalReferenceEncoder * external_reference_encoder_
virtual void SerializeObject(Object *o, HowToCode how_to_code, WhereToPoint where_to_point, int skip)=0
int fullness_[kNumberOfSpaces]
int RootIndex(HeapObject *heap_object, HowToCode from)
SerializationAddressMapper * address_mapper()
intptr_t root_index_wave_front_
int Allocate(int space, int size)
void VisitPointers(Object **start, Object **end)
int seen_large_objects_index_
static const int kInvalidRootIndex
CodeAddressMap * code_address_map_
int AllocateLargeObject(int size)
static int SpaceOfObject(HeapObject *object)
int CurrentAllocationAddress(int space) const
Serializer(Isolate *isolate, SnapshotByteSink *sink)
int EncodeExternalReference(Address addr)
Isolate * isolate() const
DISALLOW_COPY_AND_ASSIGN(Serializer)
void set_root_index_wave_front(intptr_t value)
SerializationAddressMapper address_mapper_
int SpaceAreaSize(int space)
bool ShouldBeSkipped(Object **current)
intptr_t root_index_wave_front()
void PutRoot(int index, HeapObject *object, HowToCode how, WhereToPoint where, int skip)
Sink to write snapshot files to.
DISALLOW_COPY_AND_ASSIGN(StartupSerializer)
virtual void SerializeStrongReferences()
virtual void SerializeObject(Object *o, HowToCode how_to_code, WhereToPoint where_to_point, int skip)
StartupSerializer(Isolate *isolate, SnapshotByteSink *sink)
void SerializeWeakReferences()
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi space(in MBytes)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
const int kReferenceTypeShift
const int kDeoptTableSerializeEntryCount
const int kReferenceIdMask
const int kReferenceIdBits
const int kObjectAlignmentBits
Debugger support for the V8 JavaScript engine.