| Index: runtime/vm/deopt_instructions.cc
|
| diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
|
| index 326076038cdcf46b8ea4850aaf0e691ef077196d..d0ae37b047ed30131ebc100eba9b93c28f298cd0 100644
|
| --- a/runtime/vm/deopt_instructions.cc
|
| +++ b/runtime/vm/deopt_instructions.cc
|
| @@ -26,7 +26,8 @@ DeoptContext::DeoptContext(const StackFrame* frame,
|
| const Code& code,
|
| DestFrameOptions dest_options,
|
| fpu_register_t* fpu_registers,
|
| - intptr_t* cpu_registers)
|
| + intptr_t* cpu_registers,
|
| + bool is_lazy_deopt)
|
| : code_(code.raw()),
|
| object_pool_(code.GetObjectPool()),
|
| deopt_info_(TypedData::null()),
|
| @@ -45,7 +46,8 @@ DeoptContext::DeoptContext(const StackFrame* frame,
|
| timeline_event_(NULL),
|
| deferred_slots_(NULL),
|
| deferred_objects_count_(0),
|
| - deferred_objects_(NULL) {
|
| + deferred_objects_(NULL),
|
| + is_lazy_deopt_(is_lazy_deopt) {
|
| const TypedData& deopt_info = TypedData::Handle(
|
| code.GetDeoptInfoAtPc(frame->pc(), &deopt_reason_, &deopt_flags_));
|
| ASSERT(!deopt_info.IsNull());
|
| @@ -651,6 +653,16 @@ class DeoptPcMarkerInstr : public DeoptInstr {
|
| }
|
|
|
| void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
|
| + Function& function = Function::Handle(deopt_context->zone());
|
| + function ^= deopt_context->ObjectAt(object_table_index_);
|
| + if (function.IsNull()) {
|
| + StubCode* stub_code = deopt_context->thread()->isolate()->stub_code();
|
| + *reinterpret_cast<RawObject**>(dest_addr) =
|
| + deopt_context->is_lazy_deopt() ? stub_code->DeoptimizeLazyCode()
|
| + : stub_code->DeoptimizeCode();
|
| + return;
|
| + }
|
| +
|
| *dest_addr = Smi::RawValue(0);
|
| deopt_context->DeferPcMarkerMaterialization(
|
| object_table_index_, dest_addr);
|
|
|