V8 Project
v8::internal::CodeSerializer Class Reference

#include <serialize.h>

+ Inheritance diagram for v8::internal::CodeSerializer:
+ Collaboration diagram for v8::internal::CodeSerializer:

Public Member Functions

Stringsource ()
 
List< uint32_t > * stub_keys ()
 
- Public Member Functions inherited from v8::internal::Serializer
 Serializer (Isolate *isolate, SnapshotByteSink *sink)
 
 ~Serializer ()
 
void VisitPointers (Object **start, Object **end)
 
int CurrentAllocationAddress (int space) const
 
Isolateisolate () const
 
SerializationAddressMapperaddress_mapper ()
 
void PutRoot (int index, HeapObject *object, HowToCode how, WhereToPoint where, int skip)
 

Static Public Member Functions

static ScriptDataSerialize (Isolate *isolate, Handle< SharedFunctionInfo > info, Handle< String > source)
 
static Handle< SharedFunctionInfoDeserialize (Isolate *isolate, ScriptData *data, Handle< String > source)
 
- Static Public Member Functions inherited from v8::internal::SerializerDeserializer
static void Iterate (Isolate *isolate, ObjectVisitor *visitor)
 
static int nop ()
 

Static Public Attributes

static const int kSourceObjectIndex = 0
 
static const int kCodeStubsBaseIndex = 1
 
- Static Public Attributes inherited from v8::internal::SerializerDeserializer
static const int kNumberOfPreallocatedSpaces = LO_SPACE
 
static const int kNumberOfSpaces = INVALID_SPACE
 

Private Member Functions

 CodeSerializer (Isolate *isolate, SnapshotByteSink *sink, String *source, Code *main_code)
 
virtual void SerializeObject (Object *o, HowToCode how_to_code, WhereToPoint where_to_point, int skip)
 
void SerializeBuiltin (Code *builtin, HowToCode how_to_code, WhereToPoint where_to_point)
 
void SerializeCodeStub (Code *stub, HowToCode how_to_code, WhereToPoint where_to_point)
 
void SerializeSourceObject (HowToCode how_to_code, WhereToPoint where_to_point)
 
void SerializeHeapObject (HeapObject *heap_object, HowToCode how_to_code, WhereToPoint where_to_point)
 
int AddCodeStubKey (uint32_t stub_key)
 
 DISALLOW_COPY_AND_ASSIGN (CodeSerializer)
 

Private Attributes

DisallowHeapAllocation no_gc_
 
Stringsource_
 
Codemain_code_
 
List< uint32_tstub_keys_
 

Additional Inherited Members

- Protected Types inherited from v8::internal::SerializerDeserializer
enum  Where {
  kNewObject = 0 , kRootArray = 0x9 , kPartialSnapshotCache = 0xa , kExternalReference = 0xb ,
  kSkip = 0xc , kBuiltin = 0xd , kAttachedReference = 0xe , kNop = 0xf ,
  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 }
 
- Protected Member Functions inherited from v8::internal::Serializer
int RootIndex (HeapObject *heap_object, HowToCode from)
 
intptr_t root_index_wave_front ()
 
void set_root_index_wave_front (intptr_t value)
 
void SerializeReferenceToPreviousObject (HeapObject *heap_object, HowToCode how_to_code, WhereToPoint where_to_point, int skip)
 
void InitializeAllocators ()
 
int AllocateLargeObject (int size)
 
int Allocate (int space, int size)
 
int EncodeExternalReference (Address addr)
 
int SpaceAreaSize (int space)
 
bool ShouldBeSkipped (Object **current)
 
void Pad ()
 
void InitializeCodeAddressMap ()
 
- Protected Member Functions inherited from v8::internal::SerializerDeserializer
 STATIC_ASSERT (kNumberOfSpaces<=kSpaceMask+1)
 
- Static Protected Member Functions inherited from v8::internal::Serializer
static int SpaceOfObject (HeapObject *object)
 
- Static Protected Member Functions inherited from v8::internal::SerializerDeserializer
static int CodeForRepeats (int repeats)
 
static int RepeatsForCode (int byte_code)
 
static int RootArrayConstantFromByteCode (int byte_code)
 
- Protected Attributes inherited from v8::internal::Serializer
Isolateisolate_
 
int fullness_ [kNumberOfSpaces]
 
SnapshotByteSinksink_
 
ExternalReferenceEncoderexternal_reference_encoder_
 
SerializationAddressMapper address_mapper_
 
intptr_t root_index_wave_front_
 
- Static Protected Attributes inherited from v8::internal::Serializer
static const int kInvalidRootIndex = -1
 
- Static Protected Attributes inherited from v8::internal::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 kAnyOldSpace = -1
 
static const int kSpaceMask = 7
 

Detailed Description

Definition at line 578 of file serialize.h.

Constructor & Destructor Documentation

◆ CodeSerializer()

v8::internal::CodeSerializer::CodeSerializer ( Isolate isolate,
SnapshotByteSink sink,
String source,
Code main_code 
)
inlineprivate

Definition at line 599 of file serialize.h.

601  : Serializer(isolate, sink), source_(source), main_code_(main_code) {
604  }
@ kStrongRootListLength
Definition: heap.h:1073
Serializer(Isolate *isolate, SnapshotByteSink *sink)
Definition: serialize.cc:1214
Isolate * isolate() const
Definition: serialize.h:390
void set_root_index_wave_front(intptr_t value)
Definition: serialize.h:404

References v8::internal::Serializer::InitializeCodeAddressMap(), v8::internal::Heap::kStrongRootListLength, and v8::internal::Serializer::set_root_index_wave_front().

+ Here is the call graph for this function:

Member Function Documentation

◆ AddCodeStubKey()

int v8::internal::CodeSerializer::AddCodeStubKey ( uint32_t  stub_key)
private

Definition at line 2002 of file serialize.cc.

2002  {
2003  // TODO(yangguo) Maybe we need a hash table for a faster lookup than O(n^2).
2004  int index = 0;
2005  while (index < stub_keys_.length()) {
2006  if (stub_keys_[index] == stub_key) return index;
2007  index++;
2008  }
2009  stub_keys_.Add(stub_key);
2010  return index;
2011 }
List< uint32_t > stub_keys_
Definition: serialize.h:622
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
Definition: list-inl.h:17

◆ Deserialize()

Handle< SharedFunctionInfo > v8::internal::CodeSerializer::Deserialize ( Isolate isolate,
ScriptData data,
Handle< String source 
)
static

Definition at line 2024 of file serialize.cc.

2026  {
2027  base::ElapsedTimer timer;
2028  if (FLAG_profile_deserialization) timer.Start();
2029 
2030  Object* root;
2031 
2032  {
2033  HandleScope scope(isolate);
2034 
2035  SerializedCodeData scd(data, *source);
2036  SnapshotByteSource payload(scd.Payload(), scd.PayloadLength());
2037  Deserializer deserializer(&payload);
2038  STATIC_ASSERT(NEW_SPACE == 0);
2039  for (int i = NEW_SPACE; i < kNumberOfSpaces; i++) {
2040  deserializer.set_reservation(i, scd.GetReservation(i));
2041  }
2042 
2043  // Prepare and register list of attached objects.
2044  Vector<const uint32_t> code_stub_keys = scd.CodeStubKeys();
2045  Vector<Handle<Object> > attached_objects = Vector<Handle<Object> >::New(
2046  code_stub_keys.length() + kCodeStubsBaseIndex);
2047  attached_objects[kSourceObjectIndex] = source;
2048  for (int i = 0; i < code_stub_keys.length(); i++) {
2049  attached_objects[i + kCodeStubsBaseIndex] =
2050  CodeStub::GetCode(isolate, code_stub_keys[i]).ToHandleChecked();
2051  }
2052  deserializer.SetAttachedObjects(&attached_objects);
2053 
2054  // Deserialize.
2055  deserializer.DeserializePartial(isolate, &root);
2056  deserializer.FlushICacheForNewCodeObjects();
2057  }
2058 
2059  if (FLAG_profile_deserialization) {
2060  double ms = timer.Elapsed().InMillisecondsF();
2061  int length = data->length();
2062  PrintF("[Deserializing from %d bytes took %0.3f ms]\n", length, ms);
2063  }
2064  return Handle<SharedFunctionInfo>(SharedFunctionInfo::cast(root), isolate);
2065 }
static const int kCodeStubsBaseIndex
Definition: serialize.h:589
static const int kSourceObjectIndex
Definition: serialize.h:588
STATIC_ASSERT(kNumberOfSpaces<=kSpaceMask+1)
friend class Deserializer
Definition: serialize.h:493
kSerializedDataOffset Object
Definition: objects-inl.h:5322
void PrintF(const char *format,...)
Definition: utils.cc:80

References v8::internal::SerializedCodeData::CodeStubKeys(), v8::internal::Deserializer::DeserializePartial(), v8::internal::Deserializer::FlushICacheForNewCodeObjects(), v8::internal::SerializedCodeData::GetReservation(), v8::internal::Serializer::isolate(), v8::internal::SerializerDeserializer::kNumberOfSpaces, v8::internal::ScriptData::length(), v8::internal::Vector< T >::length(), v8::internal::NEW_SPACE, v8::internal::SerializedCodeData::Payload(), v8::internal::SerializedCodeData::PayloadLength(), v8::internal::PrintF(), v8::internal::Deserializer::set_reservation(), v8::internal::Deserializer::SetAttachedObjects(), and v8::internal::SerializerDeserializer::STATIC_ASSERT().

Referenced by v8::internal::Compiler::CompileScript().

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

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::CodeSerializer::DISALLOW_COPY_AND_ASSIGN ( CodeSerializer  )
private

◆ Serialize()

ScriptData * v8::internal::CodeSerializer::Serialize ( Isolate isolate,
Handle< SharedFunctionInfo info,
Handle< String source 
)
static

Definition at line 1836 of file serialize.cc.

1838  {
1839  base::ElapsedTimer timer;
1840  if (FLAG_profile_deserialization) timer.Start();
1841 
1842  // Serialize code object.
1843  List<byte> payload;
1844  ListSnapshotSink list_sink(&payload);
1845  DebugSnapshotSink debug_sink(&list_sink);
1846  SnapshotByteSink* sink = FLAG_trace_code_serializer
1847  ? static_cast<SnapshotByteSink*>(&debug_sink)
1848  : static_cast<SnapshotByteSink*>(&list_sink);
1849  CodeSerializer cs(isolate, sink, *source, info->code());
1850  DisallowHeapAllocation no_gc;
1851  Object** location = Handle<Object>::cast(info).location();
1852  cs.VisitPointer(location);
1853  cs.Pad();
1854 
1855  SerializedCodeData data(&payload, &cs);
1856  ScriptData* script_data = data.GetScriptData();
1857 
1858  if (FLAG_profile_deserialization) {
1859  double ms = timer.Elapsed().InMillisecondsF();
1860  int length = script_data->length();
1861  PrintF("[Serializing to %d bytes took %0.3f ms]\n", length, ms);
1862  }
1863 
1864  return script_data;
1865 }
CodeSerializer(Isolate *isolate, SnapshotByteSink *sink, String *source, Code *main_code)
Definition: serialize.h:599
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110

References v8::internal::Handle< T >::cast(), v8::internal::cs, v8::internal::SerializedCodeData::GetScriptData(), v8::internal::Serializer::isolate(), v8::internal::ScriptData::length(), and v8::internal::PrintF().

Referenced by v8::internal::Compiler::CompileScript().

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

◆ SerializeBuiltin()

void v8::internal::CodeSerializer::SerializeBuiltin ( Code builtin,
HowToCode  how_to_code,
WhereToPoint  where_to_point 
)
private

Definition at line 1962 of file serialize.cc.

1963  {
1964  DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) ||
1965  (how_to_code == kPlain && where_to_point == kInnerPointer) ||
1966  (how_to_code == kFromCode && where_to_point == kInnerPointer));
1967  int builtin_index = builtin->builtin_index();
1968  DCHECK_LT(builtin_index, Builtins::builtin_count);
1969  DCHECK_LE(0, builtin_index);
1970 
1971  if (FLAG_trace_code_serializer) {
1972  PrintF("Encoding builtin: %s\n",
1973  isolate()->builtins()->name(builtin_index));
1974  }
1975 
1976  sink_->Put(kBuiltin + how_to_code + where_to_point, "Builtin");
1977  sink_->PutInt(builtin_index, "builtin_index");
1978 }
SnapshotByteSink * sink_
Definition: serialize.h:485
virtual void Put(byte b, const char *description)=0
void PutInt(uintptr_t integer, const char *description)
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 name
#define DCHECK_LE(v1, v2)
Definition: logging.h:210
#define DCHECK(condition)
Definition: logging.h:205
#define DCHECK_LT(v1, v2)
Definition: logging.h:209

References v8::internal::Builtins::builtin_count, v8::internal::Code::builtin_index(), DCHECK, DCHECK_LE, DCHECK_LT, v8::internal::Serializer::isolate(), v8::internal::SerializerDeserializer::kBuiltin, v8::internal::SerializerDeserializer::kFromCode, v8::internal::SerializerDeserializer::kInnerPointer, v8::internal::SerializerDeserializer::kPlain, v8::internal::SerializerDeserializer::kStartOfObject, name, v8::internal::PrintF(), v8::internal::SnapshotByteSink::Put(), v8::internal::SnapshotByteSink::PutInt(), and v8::internal::Serializer::sink_.

+ Here is the call graph for this function:

◆ SerializeCodeStub()

void v8::internal::CodeSerializer::SerializeCodeStub ( Code stub,
HowToCode  how_to_code,
WhereToPoint  where_to_point 
)
private

Definition at line 1981 of file serialize.cc.

1982  {
1983  DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) ||
1984  (how_to_code == kPlain && where_to_point == kInnerPointer) ||
1985  (how_to_code == kFromCode && where_to_point == kInnerPointer));
1986  uint32_t stub_key = stub->stub_key();
1987  DCHECK(CodeStub::MajorKeyFromKey(stub_key) != CodeStub::NoCache);
1988 
1989  int index = AddCodeStubKey(stub_key) + kCodeStubsBaseIndex;
1990 
1991  if (FLAG_trace_code_serializer) {
1992  PrintF("Encoding code stub %s as %d\n",
1993  CodeStub::MajorName(CodeStub::MajorKeyFromKey(stub_key), false),
1994  index);
1995  }
1996 
1997  sink_->Put(kAttachedReference + how_to_code + where_to_point, "CodeStub");
1998  sink_->PutInt(index, "CodeStub key");
1999 }
int AddCodeStubKey(uint32_t stub_key)
Definition: serialize.cc:2002

References DCHECK, v8::internal::SerializerDeserializer::kAttachedReference, v8::internal::SerializerDeserializer::kFromCode, v8::internal::SerializerDeserializer::kInnerPointer, v8::internal::SerializerDeserializer::kPlain, v8::internal::SerializerDeserializer::kStartOfObject, v8::internal::PrintF(), v8::internal::SnapshotByteSink::Put(), v8::internal::SnapshotByteSink::PutInt(), v8::internal::Serializer::sink_, and v8::internal::Code::stub_key().

+ Here is the call graph for this function:

◆ SerializeHeapObject()

void v8::internal::CodeSerializer::SerializeHeapObject ( HeapObject heap_object,
HowToCode  how_to_code,
WhereToPoint  where_to_point 
)
private

Definition at line 1939 of file serialize.cc.

1941  {
1942  if (heap_object->IsScript()) {
1943  // The wrapper cache uses a Foreign object to point to a global handle.
1944  // However, the object visitor expects foreign objects to point to external
1945  // references. Clear the cache to avoid this issue.
1946  Script::cast(heap_object)->ClearWrapperCache();
1947  }
1948 
1949  if (FLAG_trace_code_serializer) {
1950  PrintF("Encoding heap object: ");
1951  heap_object->ShortPrint();
1952  PrintF("\n");
1953  }
1954 
1955  // Object has not yet been serialized. Serialize it here.
1956  ObjectSerializer serializer(this, heap_object, sink_, how_to_code,
1957  where_to_point);
1958  serializer.Serialize();
1959 }
friend class ObjectSerializer
Definition: serialize.h:492

References v8::internal::PrintF(), v8::internal::Serializer::ObjectSerializer::Serialize(), v8::internal::Object::ShortPrint(), and v8::internal::Serializer::sink_.

+ Here is the call graph for this function:

◆ SerializeObject()

void v8::internal::CodeSerializer::SerializeObject ( Object o,
HowToCode  how_to_code,
WhereToPoint  where_to_point,
int  skip 
)
privatevirtual

Implements v8::internal::Serializer.

Definition at line 1868 of file serialize.cc.

1869  {
1870  HeapObject* heap_object = HeapObject::cast(o);
1871 
1872  int root_index;
1873  if ((root_index = RootIndex(heap_object, how_to_code)) != kInvalidRootIndex) {
1874  PutRoot(root_index, heap_object, how_to_code, where_to_point, skip);
1875  return;
1876  }
1877 
1878  if (address_mapper_.IsMapped(heap_object)) {
1879  SerializeReferenceToPreviousObject(heap_object, how_to_code, where_to_point,
1880  skip);
1881  return;
1882  }
1883 
1884  if (skip != 0) {
1885  sink_->Put(kSkip, "SkipFromSerializeObject");
1886  sink_->PutInt(skip, "SkipDistanceFromSerializeObject");
1887  }
1888 
1889  if (heap_object->IsCode()) {
1890  Code* code_object = Code::cast(heap_object);
1891  switch (code_object->kind()) {
1892  case Code::OPTIMIZED_FUNCTION: // No optimized code compiled yet.
1893  case Code::HANDLER: // No handlers patched in yet.
1894  case Code::REGEXP: // No regexp literals initialized yet.
1895  case Code::NUMBER_OF_KINDS: // Pseudo enum value.
1896  CHECK(false);
1897  case Code::BUILTIN:
1898  SerializeBuiltin(code_object, how_to_code, where_to_point);
1899  return;
1900  case Code::STUB:
1901  SerializeCodeStub(code_object, how_to_code, where_to_point);
1902  return;
1903 #define IC_KIND_CASE(KIND) case Code::KIND:
1905 #undef IC_KIND_CASE
1906  SerializeHeapObject(code_object, how_to_code, where_to_point);
1907  return;
1908  // TODO(yangguo): add special handling to canonicalize ICs.
1909  case Code::FUNCTION:
1910  // Only serialize the code for the toplevel function. Replace code
1911  // of included function literals by the lazy compile builtin.
1912  // This is safe, as checked in Compiler::BuildFunctionInfo.
1913  if (code_object != main_code_) {
1914  Code* lazy = *isolate()->builtins()->CompileLazy();
1915  SerializeBuiltin(lazy, how_to_code, where_to_point);
1916  } else {
1917  SerializeHeapObject(code_object, how_to_code, where_to_point);
1918  }
1919  return;
1920  }
1921  }
1922 
1923  if (heap_object == source_) {
1924  SerializeSourceObject(how_to_code, where_to_point);
1925  return;
1926  }
1927 
1928  // Past this point we should not see any (context-specific) maps anymore.
1929  CHECK(!heap_object->IsMap());
1930  // There should be no references to the global object embedded.
1931  CHECK(!heap_object->IsJSGlobalProxy() && !heap_object->IsGlobalObject());
1932  // There should be no hash table embedded. They would require rehashing.
1933  CHECK(!heap_object->IsHashTable());
1934 
1935  SerializeHeapObject(heap_object, how_to_code, where_to_point);
1936 }
#define BUILTIN(name)
Definition: builtins.cc:122
void SerializeHeapObject(HeapObject *heap_object, HowToCode how_to_code, WhereToPoint where_to_point)
Definition: serialize.cc:1939
void SerializeSourceObject(HowToCode how_to_code, WhereToPoint where_to_point)
Definition: serialize.cc:2014
void SerializeBuiltin(Code *builtin, HowToCode how_to_code, WhereToPoint where_to_point)
Definition: serialize.cc:1962
void SerializeCodeStub(Code *stub, HowToCode how_to_code, WhereToPoint where_to_point)
Definition: serialize.cc:1981
Builtins * builtins()
Definition: isolate.h:947
void SerializeReferenceToPreviousObject(HeapObject *heap_object, HowToCode how_to_code, WhereToPoint where_to_point, int skip)
Definition: serialize.cc:1353
int RootIndex(HeapObject *heap_object, HowToCode from)
Definition: serialize.cc:1336
static const int kInvalidRootIndex
Definition: serialize.h:400
SerializationAddressMapper address_mapper_
Definition: serialize.h:488
void PutRoot(int index, HeapObject *object, HowToCode how, WhereToPoint where, int skip)
Definition: serialize.cc:1428
#define CHECK(condition)
Definition: logging.h:36
#define IC_KIND_LIST(V)
Definition: objects.h:4939
#define IC_KIND_CASE(KIND)

References v8::internal::Serializer::address_mapper_, BUILTIN, v8::internal::Isolate::builtins(), CHECK, IC_KIND_CASE, IC_KIND_LIST, v8::internal::SerializationAddressMapper::IsMapped(), v8::internal::Serializer::isolate(), v8::internal::Code::kind(), v8::internal::Serializer::kInvalidRootIndex, v8::internal::SerializerDeserializer::kSkip, v8::internal::Code::NUMBER_OF_KINDS, v8::internal::SnapshotByteSink::Put(), v8::internal::SnapshotByteSink::PutInt(), v8::internal::Serializer::PutRoot(), v8::internal::Serializer::RootIndex(), v8::internal::Serializer::SerializeReferenceToPreviousObject(), v8::internal::Serializer::sink_, and v8::internal::STUB.

+ Here is the call graph for this function:

◆ SerializeSourceObject()

void v8::internal::CodeSerializer::SerializeSourceObject ( HowToCode  how_to_code,
WhereToPoint  where_to_point 
)
private

Definition at line 2014 of file serialize.cc.

2015  {
2016  if (FLAG_trace_code_serializer) PrintF("Encoding source object\n");
2017 
2018  DCHECK(how_to_code == kPlain && where_to_point == kStartOfObject);
2019  sink_->Put(kAttachedReference + how_to_code + where_to_point, "Source");
2020  sink_->PutInt(kSourceObjectIndex, "kSourceObjectIndex");
2021 }

References DCHECK, v8::internal::SerializerDeserializer::kAttachedReference, v8::internal::SerializerDeserializer::kPlain, v8::internal::SerializerDeserializer::kStartOfObject, v8::internal::PrintF(), v8::internal::SnapshotByteSink::Put(), v8::internal::SnapshotByteSink::PutInt(), and v8::internal::Serializer::sink_.

+ Here is the call graph for this function:

◆ source()

String* v8::internal::CodeSerializer::source ( )
inline

Definition at line 591 of file serialize.h.

591  {
592  DCHECK(!AllowHeapAllocation::IsAllowed());
593  return source_;
594  }

References DCHECK, and source_.

◆ stub_keys()

List<uint32_t>* v8::internal::CodeSerializer::stub_keys ( )
inline

Definition at line 596 of file serialize.h.

596 { return &stub_keys_; }

References stub_keys_.

Member Data Documentation

◆ kCodeStubsBaseIndex

const int v8::internal::CodeSerializer::kCodeStubsBaseIndex = 1
static

Definition at line 589 of file serialize.h.

◆ kSourceObjectIndex

const int v8::internal::CodeSerializer::kSourceObjectIndex = 0
static

Definition at line 588 of file serialize.h.

◆ main_code_

Code* v8::internal::CodeSerializer::main_code_
private

Definition at line 621 of file serialize.h.

◆ no_gc_

DisallowHeapAllocation v8::internal::CodeSerializer::no_gc_
private

Definition at line 619 of file serialize.h.

◆ source_

String* v8::internal::CodeSerializer::source_
private

Definition at line 620 of file serialize.h.

Referenced by source().

◆ stub_keys_

List<uint32_t> v8::internal::CodeSerializer::stub_keys_
private

Definition at line 622 of file serialize.h.

Referenced by stub_keys().


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