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

Unified Diff: src/snapshot/deserializer.cc

Issue 2790573002: Encode any deoptimizer entry in serialized data. (Closed)
Patch Set: Use special serializer byte codes for deoptimization entries. 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
Index: src/snapshot/deserializer.cc
diff --git a/src/snapshot/deserializer.cc b/src/snapshot/deserializer.cc
index b74b10b7eff9108d8c2c05cebd1b746f1b6caaf7..5ec265bd74458d1cd275fc65954073b67374cae9 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<Address>(current) + skip);
Yang 2017/04/04 07:59:21 Can we cast to intptr_t like everywhere else with
Slava Chigrin 2017/04/04 10:12:24 Done.
+ Deoptimizer::BailoutType bailout_type =
+ static_cast<Deoptimizer::BailoutType>(source_.Get());
+ int entry_id = source_.GetInt();
+ HandleScope scope(isolate);
Yang 2017/04/04 07:59:21 why do we need a handlescope here?
Slava Chigrin 2017/04/04 10:12:24 Deoptimizer::EnsureCodeForDeoptimizationEntry crea
+ 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') | src/snapshot/serializer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698