| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); | 262 Code::Handle(deopt_context->isolate(), function.unoptimized_code()); |
| 263 uword continue_at_pc = code.GetDeoptBeforePcAtDeoptId(deopt_id_); | 263 uword continue_at_pc = code.GetDeoptBeforePcAtDeoptId(deopt_id_); |
| 264 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); | 264 intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index); |
| 265 *to_addr = continue_at_pc; | 265 *to_addr = continue_at_pc; |
| 266 | 266 |
| 267 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); | 267 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); |
| 268 if (pc != 0) { | 268 if (pc != 0) { |
| 269 // If the deoptimization happened at an IC call, update the IC data | 269 // If the deoptimization happened at an IC call, update the IC data |
| 270 // to avoid repeated deoptimization at the same site next time around. | 270 // to avoid repeated deoptimization at the same site next time around. |
| 271 ICData& ic_data = ICData::Handle(); | 271 ICData& ic_data = ICData::Handle(); |
| 272 CodePatcher::GetInstanceCallAt(pc, &ic_data, NULL); | 272 CodePatcher::GetInstanceCallAt(pc, code, &ic_data, NULL); |
| 273 if (!ic_data.IsNull()) { | 273 if (!ic_data.IsNull()) { |
| 274 ic_data.set_deopt_reason(deopt_context->deopt_reason()); | 274 ic_data.set_deopt_reason(deopt_context->deopt_reason()); |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 } | 277 } |
| 278 | 278 |
| 279 private: | 279 private: |
| 280 static const intptr_t kFieldWidth = kBitsPerWord / 2; | 280 static const intptr_t kFieldWidth = kBitsPerWord / 2; |
| 281 class ObjectTableIndex : public BitField<intptr_t, 0, kFieldWidth> { }; | 281 class ObjectTableIndex : public BitField<intptr_t, 0, kFieldWidth> { }; |
| 282 class DeoptId : public BitField<intptr_t, kFieldWidth, kFieldWidth> { }; | 282 class DeoptId : public BitField<intptr_t, kFieldWidth, kFieldWidth> { }; |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 Smi* offset, | 816 Smi* offset, |
| 817 DeoptInfo* info, | 817 DeoptInfo* info, |
| 818 Smi* reason) { | 818 Smi* reason) { |
| 819 intptr_t i = index * kEntrySize; | 819 intptr_t i = index * kEntrySize; |
| 820 *offset ^= table.At(i); | 820 *offset ^= table.At(i); |
| 821 *info ^= table.At(i + 1); | 821 *info ^= table.At(i + 1); |
| 822 *reason ^= table.At(i + 2); | 822 *reason ^= table.At(i + 2); |
| 823 } | 823 } |
| 824 | 824 |
| 825 } // namespace dart | 825 } // namespace dart |
| OLD | NEW |