| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/deopt_instructions.h" | 5 #include "vm/deopt_instructions.h" |
| 6 | 6 |
| 7 #include "vm/assembler_macros.h" | 7 #include "vm/assembler_macros.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/locations.h" | 10 #include "vm/locations.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 void Execute(DeoptimizationContext* deopt_context, intptr_t to_index) { | 262 void Execute(DeoptimizationContext* deopt_context, intptr_t to_index) { |
| 263 Function& function = Function::Handle(deopt_context->isolate()); | 263 Function& function = Function::Handle(deopt_context->isolate()); |
| 264 function ^= deopt_context->ObjectAt(object_table_index_); | 264 function ^= deopt_context->ObjectAt(object_table_index_); |
| 265 const Code& code = | 265 const Code& code = |
| 266 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); | 266 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); |
| 267 uword continue_at_pc = code.GetDeoptBeforePcAtDeoptId(deopt_id_); | 267 uword continue_at_pc = code.GetDeoptBeforePcAtDeoptId(deopt_id_); |
| 268 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); | 268 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); |
| 269 *to_addr = continue_at_pc; | 269 *to_addr = continue_at_pc; |
| 270 | 270 |
| 271 | |
| 272 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); | 271 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); |
| 273 if (pc != 0) { | 272 if (pc != 0) { |
| 274 // If the deoptimization happened at an IC call, update the IC data | 273 // If the deoptimization happened at an IC call, update the IC data |
| 275 // to avoid repeated deoptimization at the same site next time around. | 274 // to avoid repeated deoptimization at the same site next time around. |
| 276 ICData& ic_data = ICData::Handle(); | 275 ICData& ic_data = ICData::Handle(); |
| 277 CodePatcher::GetInstanceCallAt(pc, &ic_data, NULL); | 276 CodePatcher::GetInstanceCallAt(pc, &ic_data, NULL); |
| 278 if (!ic_data.IsNull()) { | 277 if (!ic_data.IsNull()) { |
| 279 ic_data.set_deopt_reason(deopt_context->deopt_reason()); | 278 ic_data.set_deopt_reason(deopt_context->deopt_reason()); |
| 280 } | 279 } |
| 281 } | 280 } |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 Smi* offset, | 822 Smi* offset, |
| 824 DeoptInfo* info, | 823 DeoptInfo* info, |
| 825 Smi* reason) { | 824 Smi* reason) { |
| 826 intptr_t i = index * kEntrySize; | 825 intptr_t i = index * kEntrySize; |
| 827 *offset ^= table.At(i); | 826 *offset ^= table.At(i); |
| 828 *info ^= table.At(i + 1); | 827 *info ^= table.At(i + 1); |
| 829 *reason ^= table.At(i + 2); | 828 *reason ^= table.At(i + 2); |
| 830 } | 829 } |
| 831 | 830 |
| 832 } // namespace dart | 831 } // namespace dart |
| OLD | NEW |