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 |