Commit 06c3f2b7 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[snapshot] remove support for deoptimization entries.

We no longer include hydrogen stubs in the snapshot.

R=jgruber@chromium.org

Change-Id: Id268b416ed839f55d297a1888444ef6323ec9dd9
Reviewed-on: https://chromium-review.googlesource.com/631956Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47570}
parent 92713cc3
......@@ -483,33 +483,6 @@ bool Deserializer::ReadData(Object** current, Object** limit, int source_space,
break;
}
case kDeoptimizerEntryFromCode:
case kDeoptimizerEntryPlain: {
int skip = source_.GetInt();
current = reinterpret_cast<Object**>(
reinterpret_cast<intptr_t>(current) + skip);
Deoptimizer::BailoutType bailout_type =
static_cast<Deoptimizer::BailoutType>(source_.Get());
int entry_id = source_.GetInt();
HandleScope scope(isolate);
Address address = Deoptimizer::GetDeoptimizationEntry(
isolate_, entry_id, bailout_type, Deoptimizer::ENSURE_ENTRY_CODE);
if (data == kDeoptimizerEntryFromCode) {
Address location_of_branch_data = reinterpret_cast<Address>(current);
Assembler::deserialization_set_special_target_at(
isolate, location_of_branch_data,
Code::cast(HeapObject::FromAddress(current_object_address)),
address);
location_of_branch_data += Assembler::kSpecialTargetSize;
current = reinterpret_cast<Object**>(location_of_branch_data);
} else {
Object* new_object = reinterpret_cast<Object*>(address);
UnalignedCopy(current, &new_object);
current++;
}
break;
}
case kInternalReferenceEncoded:
case kInternalReference: {
// Internal reference address is not encoded via skip, but by offset
......
......@@ -353,25 +353,6 @@ bool Serializer::HasNotExceededFirstPageOfEachSpace() {
return true;
}
bool Serializer::ObjectSerializer::TryEncodeDeoptimizationEntry(
HowToCode how_to_code, Address target, int skip) {
for (int bailout_type = 0; bailout_type <= Deoptimizer::kLastBailoutType;
++bailout_type) {
int id = Deoptimizer::GetDeoptimizationId(
serializer_->isolate(), target,
static_cast<Deoptimizer::BailoutType>(bailout_type));
if (id == Deoptimizer::kNotDeoptimizationEntry) continue;
sink_->Put(how_to_code == kPlain ? kDeoptimizerEntryPlain
: kDeoptimizerEntryFromCode,
"DeoptimizationEntry");
sink_->PutInt(skip, "SkipB4DeoptimizationEntry");
sink_->Put(bailout_type, "BailoutType");
sink_->PutInt(id, "EntryId");
return true;
}
return false;
}
void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space,
int size, Map* map) {
if (serializer_->code_address_map_) {
......@@ -746,11 +727,9 @@ void Serializer::ObjectSerializer::VisitExternalReference(Foreign* host,
int skip = OutputRawData(reinterpret_cast<Address>(p),
kCanReturnSkipInsteadOfSkipping);
Address target = *p;
if (!TryEncodeDeoptimizationEntry(kPlain, target, skip)) {
sink_->Put(kExternalReference + kPlain + kStartOfObject, "ExternalRef");
sink_->PutInt(skip, "SkipB4ExternalRef");
sink_->PutInt(serializer_->EncodeExternalReference(target), "reference id");
}
bytes_processed_so_far_ += kPointerSize;
}
......@@ -760,13 +739,10 @@ void Serializer::ObjectSerializer::VisitExternalReference(Code* host,
kCanReturnSkipInsteadOfSkipping);
HowToCode how_to_code = rinfo->IsCodedSpecially() ? kFromCode : kPlain;
Address target = rinfo->target_external_reference();
if (!TryEncodeDeoptimizationEntry(how_to_code, target, skip)) {
sink_->Put(kExternalReference + how_to_code + kStartOfObject,
"ExternalRef");
sink_->Put(kExternalReference + how_to_code + kStartOfObject, "ExternalRef");
sink_->PutInt(skip, "SkipB4ExternalRef");
DCHECK_NOT_NULL(target); // Code does not reference null.
sink_->PutInt(serializer_->EncodeExternalReference(target), "reference id");
}
bytes_processed_so_far_ += rinfo->target_address_size();
}
......@@ -801,12 +777,9 @@ void Serializer::ObjectSerializer::VisitRuntimeEntry(Code* host,
kCanReturnSkipInsteadOfSkipping);
HowToCode how_to_code = rinfo->IsCodedSpecially() ? kFromCode : kPlain;
Address target = rinfo->target_address();
if (!TryEncodeDeoptimizationEntry(how_to_code, target, skip)) {
sink_->Put(kExternalReference + how_to_code + kStartOfObject,
"ExternalRef");
sink_->Put(kExternalReference + how_to_code + kStartOfObject, "ExternalRef");
sink_->PutInt(skip, "SkipB4ExternalRef");
sink_->PutInt(serializer_->EncodeExternalReference(target), "reference id");
}
bytes_processed_so_far_ += rinfo->target_address_size();
}
......
......@@ -321,8 +321,6 @@ class Serializer::ObjectSerializer : public ObjectVisitor {
void VisitRuntimeEntry(Code* host, RelocInfo* reloc) override;
private:
bool TryEncodeDeoptimizationEntry(HowToCode how_to_code, Address target,
int skip);
void SerializePrologue(AllocationSpace space, int size, Map* map);
......
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