Commit c9a9d825 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[snapshot][cleanup] Remove skipping bytecodes

... as they are no longer needed.

Bug: v8:8794, v8:8562
Change-Id: Ib5d87fce9834839410b0dffce95b4a8ae4f946cc
Reviewed-on: https://chromium-review.googlesource.com/c/1460456Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59457}
parent 1f386f4f
......@@ -98,8 +98,7 @@ ScriptData* CodeSerializer::SerializeSharedFunctionInfo(
bool CodeSerializer::SerializeReadOnlyObject(HeapObject obj,
HowToCode how_to_code,
WhereToPoint where_to_point,
int skip) {
WhereToPoint where_to_point) {
PagedSpace* read_only_space = isolate()->heap()->read_only_space();
if (!read_only_space->Contains(obj)) return false;
......@@ -117,21 +116,19 @@ bool CodeSerializer::SerializeReadOnlyObject(HeapObject obj,
SerializerReference back_reference =
SerializerReference::BackReference(RO_SPACE, chunk_index, chunk_offset);
reference_map()->Add(reinterpret_cast<void*>(obj->ptr()), back_reference);
CHECK(SerializeBackReference(obj, how_to_code, where_to_point, skip));
CHECK(SerializeBackReference(obj, how_to_code, where_to_point));
return true;
}
void CodeSerializer::SerializeObject(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
if (SerializeHotObject(obj, how_to_code, where_to_point, skip)) return;
WhereToPoint where_to_point) {
if (SerializeHotObject(obj, how_to_code, where_to_point)) return;
if (SerializeRoot(obj, how_to_code, where_to_point, skip)) return;
if (SerializeRoot(obj, how_to_code, where_to_point)) return;
if (SerializeBackReference(obj, how_to_code, where_to_point, skip)) return;
if (SerializeBackReference(obj, how_to_code, where_to_point)) return;
if (SerializeReadOnlyObject(obj, how_to_code, where_to_point, skip)) return;
FlushSkip(skip);
if (SerializeReadOnlyObject(obj, how_to_code, where_to_point)) return;
if (obj->IsCode()) {
Code code_object = Code::cast(obj);
......@@ -151,8 +148,8 @@ void CodeSerializer::SerializeObject(HeapObject obj, HowToCode how_to_code,
ReadOnlyRoots roots(isolate());
if (ElideObject(obj)) {
return SerializeObject(roots.undefined_value(), how_to_code, where_to_point,
skip);
return SerializeObject(roots.undefined_value(), how_to_code,
where_to_point);
}
if (obj->IsScript()) {
......
......@@ -69,10 +69,10 @@ class CodeSerializer : public Serializer {
private:
void SerializeObject(HeapObject o, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) override;
WhereToPoint where_to_point) override;
bool SerializeReadOnlyObject(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip);
WhereToPoint where_to_point);
DISALLOW_HEAP_ALLOCATION(no_gc_);
uint32_t source_hash_;
......
......@@ -591,7 +591,6 @@ bool Deserializer::ReadData(UnalignedSlot current, UnalignedSlot limit,
// Find a recently deserialized object using its offset from the current
// allocation point and write a pointer to it to the current object.
ALL_SPACES(kBackref, kPlain, kStartOfObject)
ALL_SPACES(kBackrefWithSkip, kPlain, kStartOfObject)
#if V8_CODE_EMBEDS_OBJECT_POINTER
// Deserialize a new object from pointer found in code and write
// a pointer to it to the current object. Required only for MIPS, PPC, ARM
......@@ -603,14 +602,12 @@ bool Deserializer::ReadData(UnalignedSlot current, UnalignedSlot limit,
// object. Required only for MIPS, PPC, ARM or S390 with embedded
// constant pool.
ALL_SPACES(kBackref, kFromCode, kStartOfObject)
ALL_SPACES(kBackrefWithSkip, kFromCode, kStartOfObject)
#endif
// Find a recently deserialized code object using its offset from the
// current allocation point and write a pointer to its first instruction
// to the current code object or the instruction pointer in a function
// object.
ALL_SPACES(kBackref, kFromCode, kInnerPointer)
ALL_SPACES(kBackrefWithSkip, kFromCode, kInnerPointer)
// Find an object in the roots array and write a pointer to it to the
// current object.
SINGLE_CASE(kRootArray, kPlain, kStartOfObject, 0)
......@@ -638,12 +635,6 @@ bool Deserializer::ReadData(UnalignedSlot current, UnalignedSlot limit,
#undef CASE_BODY
#undef ALL_SPACES
case kSkip: {
int size = source_.GetInt();
current.Advance(size);
break;
}
// Find an external reference and write a pointer to it to the current
// object.
case kExternalReference + kPlain + kStartOfObject:
......@@ -777,13 +768,6 @@ bool Deserializer::ReadData(UnalignedSlot current, UnalignedSlot limit,
STATIC_ASSERT(kNumberOfRootArrayConstants <=
static_cast<int>(RootIndex::kLastImmortalImmovableRoot));
STATIC_ASSERT(kNumberOfRootArrayConstants == 32);
SIXTEEN_CASES(kRootArrayConstantsWithSkip)
SIXTEEN_CASES(kRootArrayConstantsWithSkip + 16) {
int skip = source_.GetInt();
current.Advance(skip);
V8_FALLTHROUGH;
}
SIXTEEN_CASES(kRootArrayConstants)
SIXTEEN_CASES(kRootArrayConstants + 16) {
int id = data & kRootArrayConstantsMask;
......@@ -796,13 +780,6 @@ bool Deserializer::ReadData(UnalignedSlot current, UnalignedSlot limit,
}
STATIC_ASSERT(kNumberOfHotObjects == 8);
FOUR_CASES(kHotObjectWithSkip)
FOUR_CASES(kHotObjectWithSkip + 4) {
int skip = source_.GetInt();
current.Advance(skip);
V8_FALLTHROUGH;
}
FOUR_CASES(kHotObject)
FOUR_CASES(kHotObject + 4) {
int index = data & kHotObjectMask;
......@@ -890,11 +867,6 @@ UnalignedSlot Deserializer::ReadDataCase(Isolate* isolate,
} else if (where == kBackref) {
emit_write_barrier = (space_number == NEW_SPACE);
heap_object = GetBackReferencedObject(data & kSpaceMask);
} else if (where == kBackrefWithSkip) {
int skip = source_.GetInt();
current.Advance(skip);
emit_write_barrier = (space_number == NEW_SPACE);
heap_object = GetBackReferencedObject(data & kSpaceMask);
} else if (where == kRootArray) {
int id = source_.GetInt();
RootIndex root_index = static_cast<RootIndex>(id);
......
......@@ -69,23 +69,23 @@ void PartialSerializer::Serialize(Context* o, bool include_global_proxy) {
}
void PartialSerializer::SerializeObject(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
WhereToPoint where_to_point) {
DCHECK(!ObjectIsBytecodeHandler(obj)); // Only referenced in dispatch table.
if (SerializeHotObject(obj, how_to_code, where_to_point, skip)) return;
if (SerializeHotObject(obj, how_to_code, where_to_point)) return;
if (SerializeRoot(obj, how_to_code, where_to_point, skip)) return;
if (SerializeRoot(obj, how_to_code, where_to_point)) return;
if (SerializeBackReference(obj, how_to_code, where_to_point, skip)) return;
if (SerializeBackReference(obj, how_to_code, where_to_point)) return;
if (startup_serializer_->SerializeUsingReadOnlyObjectCache(
&sink_, obj, how_to_code, where_to_point, skip)) {
&sink_, obj, how_to_code, where_to_point)) {
return;
}
if (ShouldBeInThePartialSnapshotCache(obj)) {
startup_serializer_->SerializeUsingPartialSnapshotCache(
&sink_, obj, how_to_code, where_to_point, skip);
&sink_, obj, how_to_code, where_to_point);
return;
}
......@@ -101,8 +101,6 @@ void PartialSerializer::SerializeObject(HeapObject obj, HowToCode how_to_code,
// We should not end up at another native context.
DCHECK_IMPLIES(obj != context_, !obj->IsNativeContext());
FlushSkip(skip);
// Clear literal boilerplates and feedback.
if (obj->IsFeedbackVector()) FeedbackVector::cast(obj)->ClearSlots(isolate());
......
......@@ -28,7 +28,7 @@ class PartialSerializer : public Serializer {
private:
void SerializeObject(HeapObject o, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) override;
WhereToPoint where_to_point) override;
bool ShouldBeInThePartialSnapshotCache(HeapObject o);
......
......@@ -25,19 +25,16 @@ ReadOnlySerializer::~ReadOnlySerializer() {
}
void ReadOnlySerializer::SerializeObject(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point,
int skip) {
WhereToPoint where_to_point) {
CHECK(isolate()->heap()->read_only_space()->Contains(obj));
CHECK_IMPLIES(obj->IsString(), obj->IsInternalizedString());
if (SerializeHotObject(obj, how_to_code, where_to_point, skip)) return;
if (SerializeHotObject(obj, how_to_code, where_to_point)) return;
if (IsRootAndHasBeenSerialized(obj) &&
SerializeRoot(obj, how_to_code, where_to_point, skip)) {
SerializeRoot(obj, how_to_code, where_to_point)) {
return;
}
if (SerializeBackReference(obj, how_to_code, where_to_point, skip)) return;
FlushSkip(skip);
if (SerializeBackReference(obj, how_to_code, where_to_point)) return;
CheckRehashability(obj);
......@@ -85,7 +82,7 @@ bool ReadOnlySerializer::MustBeDeferred(HeapObject object) {
bool ReadOnlySerializer::SerializeUsingReadOnlyObjectCache(
SnapshotByteSink* sink, HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
WhereToPoint where_to_point) {
if (!isolate()->heap()->read_only_space()->Contains(obj)) return false;
// Get the cache index and serialize it into the read-only snapshot if
......@@ -93,7 +90,6 @@ bool ReadOnlySerializer::SerializeUsingReadOnlyObjectCache(
int cache_index = SerializeInObjectCache(obj);
// Writing out the cache entry into the calling serializer's sink.
FlushSkip(sink, skip);
sink->Put(kReadOnlyObjectCache + how_to_code + where_to_point,
"ReadOnlyObjectCache");
sink->PutInt(cache_index, "read_only_object_cache_index");
......
......@@ -30,11 +30,11 @@ class ReadOnlySerializer : public RootsSerializer {
// successful.
bool SerializeUsingReadOnlyObjectCache(SnapshotByteSink* sink, HeapObject obj,
HowToCode how_to_code,
WhereToPoint where_to_point, int skip);
WhereToPoint where_to_point);
private:
void SerializeObject(HeapObject o, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) override;
WhereToPoint where_to_point) override;
bool MustBeDeferred(HeapObject object) override;
DISALLOW_COPY_AND_ASSIGN(ReadOnlySerializer);
......
......@@ -28,7 +28,7 @@ int RootsSerializer::SerializeInObjectCache(HeapObject heap_object) {
if (!object_cache_index_map_.LookupOrInsert(heap_object, &index)) {
// This object is not part of the object cache yet. Add it to the cache so
// we can refer to it via cache index from the delegating snapshot.
SerializeObject(heap_object, kPlain, kStartOfObject, 0);
SerializeObject(heap_object, kPlain, kStartOfObject);
}
return index;
}
......
......@@ -123,6 +123,8 @@ class SerializerDeserializer : public RootVisitor {
void RestoreExternalReferenceRedirectors(
const std::vector<CallHandlerInfo>& call_handler_infos);
// TODO(ishell): reassign bytecodes and update this list
// once HowToCode and WhereToPoint are gone.
#define UNUSED_SERIALIZER_BYTE_CODES(V) \
V(0x0e) \
V(0x2e) \
......@@ -156,8 +158,6 @@ class SerializerDeserializer : public RootVisitor {
kNewObject = 0x00,
// 0x08..0x0d Reference to previous object from space.
kBackref = 0x08,
// 0x10..0x15 Reference to previous object from space after skip.
kBackrefWithSkip = 0x10,
// 0x06 Object in the partial snapshot cache.
kPartialSnapshotCache = 0x06,
......@@ -200,8 +200,6 @@ class SerializerDeserializer : public RootVisitor {
static const int kWhereToPointMask = 0x40;
// ---------- Misc ----------
// Skip.
static const int kSkip = 0x0f;
// Do nothing, used for padding.
static const int kNop = 0x2f;
// Move to next reserved chunk.
......@@ -247,8 +245,6 @@ class SerializerDeserializer : public RootVisitor {
static const int kNumberOfRootArrayConstants = 0x20;
// 0x80..0x9f
static const int kRootArrayConstants = 0x80;
// 0xa0..0xbf
static const int kRootArrayConstantsWithSkip = 0xa0;
static const int kRootArrayConstantsMask = 0x1f;
// 32 common raw data lengths.
......@@ -268,8 +264,6 @@ class SerializerDeserializer : public RootVisitor {
STATIC_ASSERT(kNumberOfHotObjects == HotObjectsList::kSize);
// 0xf0..0xf7
static const int kHotObject = 0xf0;
// 0xf8..0xff
static const int kHotObjectWithSkip = 0xf8;
static const int kHotObjectMask = 0x07;
// ---------- special values ----------
......
......@@ -110,7 +110,7 @@ void Serializer::SerializeRootObject(Object object) {
if (object->IsSmi()) {
PutSmi(Smi::cast(object));
} else {
SerializeObject(HeapObject::cast(object), kPlain, kStartOfObject, 0);
SerializeObject(HeapObject::cast(object), kPlain, kStartOfObject);
}
}
......@@ -124,19 +124,19 @@ void Serializer::PrintStack() {
#endif // DEBUG
bool Serializer::SerializeRoot(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
WhereToPoint where_to_point) {
RootIndex root_index;
// Derived serializers are responsible for determining if the root has
// actually been serialized before calling this.
if (root_index_map()->Lookup(obj, &root_index)) {
PutRoot(root_index, obj, how_to_code, where_to_point, skip);
PutRoot(root_index, obj, how_to_code, where_to_point);
return true;
}
return false;
}
bool Serializer::SerializeHotObject(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
WhereToPoint where_to_point) {
if (how_to_code != kPlain || where_to_point != kStartOfObject) return false;
// Encode a reference to a hot object by its index in the working set.
int index = hot_objects_.Find(obj);
......@@ -153,7 +153,7 @@ bool Serializer::SerializeHotObject(HeapObject obj, HowToCode how_to_code,
}
bool Serializer::SerializeBackReference(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
WhereToPoint where_to_point) {
SerializerReference reference =
reference_map_.LookupReference(reinterpret_cast<void*>(obj.ptr()));
if (!reference.is_valid()) return false;
......@@ -162,7 +162,6 @@ bool Serializer::SerializeBackReference(HeapObject obj, HowToCode how_to_code,
// offset fromthe start of the deserialized objects or as an offset
// backwards from thecurrent allocation pointer.
if (reference.is_attached_reference()) {
FlushSkip(skip);
if (FLAG_trace_serializer) {
PrintF(" Encoding attached reference %d\n",
reference.attached_reference_index());
......@@ -178,7 +177,6 @@ bool Serializer::SerializeBackReference(HeapObject obj, HowToCode how_to_code,
PutAlignmentPrefix(obj);
AllocationSpace space = reference.space();
// TODO(ishell): remove kBackrefWithSkip
sink_.Put(kBackref + how_to_code + where_to_point + space, "BackRef");
PutBackReference(obj, reference);
}
......@@ -192,8 +190,7 @@ bool Serializer::ObjectIsBytecodeHandler(HeapObject obj) const {
void Serializer::PutRoot(RootIndex root, HeapObject object,
SerializerDeserializer::HowToCode how_to_code,
SerializerDeserializer::WhereToPoint where_to_point,
int skip) {
SerializerDeserializer::WhereToPoint where_to_point) {
int root_index = static_cast<int>(root);
if (FLAG_trace_serializer) {
PrintF(" Encoding root %d:", root_index);
......@@ -210,10 +207,8 @@ void Serializer::PutRoot(RootIndex root, HeapObject object,
if (how_to_code == kPlain && where_to_point == kStartOfObject &&
root_index < kNumberOfRootArrayConstants &&
!Heap::InYoungGeneration(object)) {
// TODO(ishell): remove kRootArrayConstantsWithSkip
sink_.Put(kRootArrayConstants + root_index, "RootConstant");
} else {
FlushSkip(skip);
sink_.Put(kRootArray + how_to_code + where_to_point, "RootSerialization");
sink_.PutInt(root_index, "root_index");
hot_objects_.Add(object);
......@@ -354,7 +349,7 @@ void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space,
back_reference);
// Serialize the map (first word of the object).
serializer_->SerializeObject(map, kPlain, kStartOfObject, 0);
serializer_->SerializeObject(map, kPlain, kStartOfObject);
}
int32_t Serializer::ObjectSerializer::SerializeBackingStore(
......@@ -650,8 +645,6 @@ void Serializer::ObjectSerializer::SerializeContent(Map map, int size) {
OutputCode(size);
// Then iterate references via reloc info.
object_->IterateBody(map, size, this);
// Finally skip to the end.
serializer_->FlushSkip(SkipTo(object_->address() + size));
} else {
// For other objects, iterate references first.
object_->IterateBody(map, size, this);
......@@ -715,30 +708,22 @@ void Serializer::ObjectSerializer::VisitPointers(HeapObject host,
if (reference_type == HeapObjectReferenceType::WEAK) {
sink_->Put(kWeakPrefix, "WeakReference");
}
serializer_->SerializeObject(current_contents, kPlain, kStartOfObject, 0);
serializer_->SerializeObject(current_contents, kPlain, kStartOfObject);
}
}
}
void Serializer::ObjectSerializer::VisitEmbeddedPointer(Code host,
RelocInfo* rinfo) {
// TODO(ishell): remove skip parameter from bytecode.
int skip = 0;
HowToCode how_to_code = rinfo->IsCodedSpecially() ? kFromCode : kPlain;
Object object = rinfo->target_object();
serializer_->SerializeObject(HeapObject::cast(object), how_to_code,
kStartOfObject, skip);
kStartOfObject);
bytes_processed_so_far_ += rinfo->target_address_size();
}
void Serializer::ObjectSerializer::VisitExternalReference(Foreign host,
Address* p) {
// TODO(ishell): handle gap between map field and payload field
// once we shrink kTaggedSize.
STATIC_ASSERT(static_cast<int>(Foreign::kForeignAddressOffset) ==
static_cast<int>(HeapObject::kHeaderSize));
DCHECK_EQ(0, SkipTo(reinterpret_cast<Address>(p)));
Address target = *p;
auto encoded_reference = serializer_->EncodeExternalReference(target);
if (encoded_reference.is_from_api()) {
......@@ -817,10 +802,8 @@ void Serializer::ObjectSerializer::VisitCodeTarget(Code host,
#ifdef V8_TARGET_ARCH_ARM
DCHECK(!RelocInfo::IsRelativeCodeTarget(rinfo->rmode()));
#endif
// TODO(ishell): remove skip parameter from bytecode.
int skip = 0;
Code object = Code::GetCodeFromTargetAddress(rinfo->target_address());
serializer_->SerializeObject(object, kFromCode, kInnerPointer, skip);
serializer_->SerializeObject(object, kFromCode, kInnerPointer);
bytes_processed_so_far_ += rinfo->target_address_size();
}
......@@ -870,18 +853,6 @@ void Serializer::ObjectSerializer::OutputRawData(Address up_to) {
}
}
int Serializer::ObjectSerializer::SkipTo(Address to) {
Address object_start = object_->address();
int up_to_offset = static_cast<int>(to - object_start);
int to_skip = up_to_offset - bytes_processed_so_far_;
bytes_processed_so_far_ += to_skip;
// This assert will fail if the reloc info gives us the target_address_address
// locations in a non-ascending order. We make sure this doesn't happen by
// sorting the relocation info.
DCHECK_GE(to_skip, 0);
return to_skip;
}
void Serializer::ObjectSerializer::OutputCode(int size) {
DCHECK_EQ(kTaggedSize, bytes_processed_so_far_);
Code on_heap_code = Code::cast(object_);
......
......@@ -192,7 +192,7 @@ class Serializer : public SerializerDeserializer {
void SerializeDeferredObjects();
virtual void SerializeObject(HeapObject o, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) = 0;
WhereToPoint where_to_point) = 0;
virtual bool MustBeDeferred(HeapObject object);
......@@ -201,7 +201,7 @@ class Serializer : public SerializerDeserializer {
void SerializeRootObject(Object object);
void PutRoot(RootIndex root_index, HeapObject object, HowToCode how,
WhereToPoint where, int skip);
WhereToPoint where);
void PutSmi(Smi smi);
void PutBackReference(HeapObject object, SerializerReference reference);
void PutAttachedReference(SerializerReference reference,
......@@ -213,25 +213,19 @@ class Serializer : public SerializerDeserializer {
// Returns true if the object was successfully serialized as a root.
bool SerializeRoot(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip);
WhereToPoint where_to_point);
// Returns true if the object was successfully serialized as hot object.
bool SerializeHotObject(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip);
WhereToPoint where_to_point);
// Returns true if the object was successfully serialized as back reference.
bool SerializeBackReference(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip);
WhereToPoint where_to_point);
// Returns true if the given heap object is a bytecode handler code object.
bool ObjectIsBytecodeHandler(HeapObject obj) const;
static inline void FlushSkip(SnapshotByteSink* sink, int skip) {
// TODO(ishell): remove kSkip and friends as they are no longer needed.
}
inline void FlushSkip(int skip) { FlushSkip(&sink_, skip); }
ExternalReferenceEncoder::Value EncodeExternalReference(Address addr) {
return external_reference_encoder_.Encode(addr);
}
......@@ -341,7 +335,6 @@ class Serializer::ObjectSerializer : public ObjectVisitor {
void SerializeContent(Map map, int size);
void OutputRawData(Address up_to);
void OutputCode(int size);
int SkipTo(Address to);
int32_t SerializeBackingStore(void* backing_store, int32_t byte_length);
void SerializeJSTypedArray();
void SerializeJSArrayBuffer();
......
......@@ -70,20 +70,19 @@ bool IsUnexpectedCodeObject(Isolate* isolate, HeapObject obj) {
#endif // DEBUG
void StartupSerializer::SerializeObject(HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
WhereToPoint where_to_point) {
DCHECK(!obj->IsJSFunction());
DCHECK(!IsUnexpectedCodeObject(isolate(), obj));
if (SerializeHotObject(obj, how_to_code, where_to_point, skip)) return;
if (SerializeHotObject(obj, how_to_code, where_to_point)) return;
if (IsRootAndHasBeenSerialized(obj) &&
SerializeRoot(obj, how_to_code, where_to_point, skip))
SerializeRoot(obj, how_to_code, where_to_point))
return;
if (SerializeUsingReadOnlyObjectCache(&sink_, obj, how_to_code,
where_to_point, skip))
where_to_point))
return;
if (SerializeBackReference(obj, how_to_code, where_to_point, skip)) return;
if (SerializeBackReference(obj, how_to_code, where_to_point)) return;
FlushSkip(skip);
bool use_simulator = false;
#ifdef USE_SIMULATOR
use_simulator = true;
......@@ -162,16 +161,14 @@ SerializedHandleChecker::SerializedHandleChecker(Isolate* isolate,
bool StartupSerializer::SerializeUsingReadOnlyObjectCache(
SnapshotByteSink* sink, HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
WhereToPoint where_to_point) {
return read_only_serializer_->SerializeUsingReadOnlyObjectCache(
sink, obj, how_to_code, where_to_point, skip);
sink, obj, how_to_code, where_to_point);
}
void StartupSerializer::SerializeUsingPartialSnapshotCache(
SnapshotByteSink* sink, HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
FlushSkip(sink, skip);
WhereToPoint where_to_point) {
int cache_index = SerializeInObjectCache(obj);
sink->Put(kPartialSnapshotCache + how_to_code + where_to_point,
"PartialSnapshotCache");
......
......@@ -35,18 +35,17 @@ class StartupSerializer : public RootsSerializer {
// successful.
bool SerializeUsingReadOnlyObjectCache(SnapshotByteSink* sink, HeapObject obj,
HowToCode how_to_code,
WhereToPoint where_to_point, int skip);
WhereToPoint where_to_point);
// Adds |obj| to the partial snapshot object cache if not already present and
// emits a PartialSnapshotCache bytecode into |sink|.
void SerializeUsingPartialSnapshotCache(SnapshotByteSink* sink,
HeapObject obj, HowToCode how_to_code,
WhereToPoint where_to_point,
int skip);
WhereToPoint where_to_point);
private:
void SerializeObject(HeapObject o, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) override;
WhereToPoint where_to_point) override;
ReadOnlySerializer* read_only_serializer_;
std::vector<AccessorInfo> accessor_infos_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment