| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); | 258 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); |
| 259 uword continue_at_pc = code.GetDeoptBeforePcAtDeoptId(deopt_id_); | 259 uword continue_at_pc = code.GetDeoptBeforePcAtDeoptId(deopt_id_); |
| 260 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); | 260 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); |
| 261 *to_addr = continue_at_pc; | 261 *to_addr = continue_at_pc; |
| 262 | 262 |
| 263 | 263 |
| 264 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); | 264 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); |
| 265 if (pc != 0) { | 265 if (pc != 0) { |
| 266 // If the deoptimization happened at an IC call, update the IC data | 266 // If the deoptimization happened at an IC call, update the IC data |
| 267 // to avoid repeated deoptimization at the same site next time around. | 267 // to avoid repeated deoptimization at the same site next time around. |
| 268 const ICData& ic_data = ICData::Handle( | 268 ICData& ic_data = ICData::Handle(); |
| 269 CodePatcher::GetInstanceCallIcDataAt(pc)); | 269 CodePatcher::GetInstanceCallAt(pc, &ic_data, NULL); |
| 270 if (!ic_data.IsNull()) { | 270 if (!ic_data.IsNull()) { |
| 271 ic_data.set_deopt_reason(deopt_context->deopt_reason()); | 271 ic_data.set_deopt_reason(deopt_context->deopt_reason()); |
| 272 } | 272 } |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 private: | 276 private: |
| 277 static const intptr_t kFieldWidth = kBitsPerWord / 2; | 277 static const intptr_t kFieldWidth = kBitsPerWord / 2; |
| 278 class ObjectTableIndex : public BitField<intptr_t, 0, kFieldWidth> { }; | 278 class ObjectTableIndex : public BitField<intptr_t, 0, kFieldWidth> { }; |
| 279 class DeoptId : public BitField<intptr_t, kFieldWidth, kFieldWidth> { }; | 279 class DeoptId : public BitField<intptr_t, kFieldWidth, kFieldWidth> { }; |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 Smi* offset, | 794 Smi* offset, |
| 795 DeoptInfo* info, | 795 DeoptInfo* info, |
| 796 Smi* reason) { | 796 Smi* reason) { |
| 797 intptr_t i = index * kEntrySize; | 797 intptr_t i = index * kEntrySize; |
| 798 *offset ^= table.At(i); | 798 *offset ^= table.At(i); |
| 799 *info ^= table.At(i + 1); | 799 *info ^= table.At(i + 1); |
| 800 *reason ^= table.At(i + 2); | 800 *reason ^= table.At(i + 2); |
| 801 } | 801 } |
| 802 | 802 |
| 803 } // namespace dart | 803 } // namespace dart |
| OLD | NEW |