Chromium Code Reviews| Index: runtime/vm/deopt_instructions.cc |
| =================================================================== |
| --- runtime/vm/deopt_instructions.cc (revision 14704) |
| +++ runtime/vm/deopt_instructions.cc (working copy) |
| @@ -5,6 +5,7 @@ |
| #include "vm/deopt_instructions.h" |
| #include "vm/assembler_macros.h" |
| +#include "vm/code_patcher.h" |
| #include "vm/intermediate_language.h" |
| #include "vm/locations.h" |
| #include "vm/parser.h" |
| @@ -17,7 +18,8 @@ |
| DeoptimizationContext::DeoptimizationContext(intptr_t* to_frame_start, |
| intptr_t to_frame_size, |
| const Array& object_table, |
| - intptr_t num_args) |
| + intptr_t num_args, |
| + DeoptReasonId deopt_reason) |
| : object_table_(object_table), |
| to_frame_(to_frame_start), |
| to_frame_size_(to_frame_size), |
| @@ -26,6 +28,7 @@ |
| registers_copy_(NULL), |
| xmm_registers_copy_(NULL), |
| num_args_(num_args), |
| + deopt_reason_(deopt_reason), |
| isolate_(Isolate::Current()) { |
| from_frame_ = isolate_->deopt_frame_copy(); |
| from_frame_size_ = isolate_->deopt_frame_copy_size(); |
| @@ -256,6 +259,20 @@ |
| uword continue_at_pc = code.GetDeoptBeforePcAtDeoptId(deopt_id_); |
| intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); |
| *to_addr = continue_at_pc; |
| + |
| + const PcDescriptors& descriptors = |
| + PcDescriptors::Handle(code.pc_descriptors()); |
| + ICData& ic_data = ICData::Handle(); |
| + for (intptr_t i = 0; i < descriptors.Length(); i++) { |
| + if ((descriptors.DescriptorKind(i) == PcDescriptors::kIcCall) && |
| + (descriptors.DeoptId(i) == deopt_id_)) { |
| + ic_data = CodePatcher::GetInstanceCallIcDataAt(descriptors.PC(i)); |
| + break; |
| + } |
| + } |
|
srdjan
2012/11/08 21:37:27
This could be:
uword pc = code.GetPcForDeoptId(deo
Florian Schneider
2012/11/08 22:03:00
Done.
|
| + if (!ic_data.IsNull()) { |
| + ic_data.set_deopt_reason(deopt_context->deopt_reason()); |
| + } |
| } |
| private: |