Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Unified Diff: src/snapshot/deserializer.cc

Issue 2790573002: Encode any deoptimizer entry in serialized data. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.cc ('k') | src/snapshot/serializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/deserializer.cc
diff --git a/src/snapshot/deserializer.cc b/src/snapshot/deserializer.cc
index b74b10b7eff9108d8c2c05cebd1b746f1b6caaf7..ab17b28bb2505196a5fa70716858927ea42f1fae 100644
--- a/src/snapshot/deserializer.cc
+++ b/src/snapshot/deserializer.cc
@@ -7,6 +7,7 @@
#include "src/api.h"
#include "src/assembler-inl.h"
#include "src/bootstrapper.h"
+#include "src/deoptimizer.h"
#include "src/external-reference-table.h"
#include "src/heap/heap-inl.h"
#include "src/isolate.h"
@@ -732,6 +733,33 @@ 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
« no previous file with comments | « src/isolate.cc ('k') | src/snapshot/serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698