| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 void Execute(DeoptimizationContext* deopt_context, intptr_t to_index) { | 254 void Execute(DeoptimizationContext* deopt_context, intptr_t to_index) { |
| 255 Function& function = Function::Handle(deopt_context->isolate()); | 255 Function& function = Function::Handle(deopt_context->isolate()); |
| 256 function ^= deopt_context->ObjectAt(object_table_index_); | 256 function ^= deopt_context->ObjectAt(object_table_index_); |
| 257 const Code& code = | 257 const Code& code = |
| 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 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); | 263 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); |
| 264 const ICData& ic_data = CodePatcher::GetInstanceCallIcData(pc); | 264 const ICData& ic_data = ICData::Handle( |
| 265 CodePatcher::GetInstanceCallIcDataAt(pc)); |
| 265 if (!ic_data.IsNull()) { | 266 if (!ic_data.IsNull()) { |
| 266 ic_data.set_deopt_reason(deopt_context->deopt_reason()); | 267 ic_data.set_deopt_reason(deopt_context->deopt_reason()); |
| 267 } | 268 } |
| 268 } | 269 } |
| 269 | 270 |
| 270 private: | 271 private: |
| 271 static const intptr_t kFieldWidth = kBitsPerWord / 2; | 272 static const intptr_t kFieldWidth = kBitsPerWord / 2; |
| 272 class ObjectTableIndex : public BitField<intptr_t, 0, kFieldWidth> { }; | 273 class ObjectTableIndex : public BitField<intptr_t, 0, kFieldWidth> { }; |
| 273 class DeoptId : public BitField<intptr_t, kFieldWidth, kFieldWidth> { }; | 274 class DeoptId : public BitField<intptr_t, kFieldWidth, kFieldWidth> { }; |
| 274 | 275 |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 Smi* offset, | 789 Smi* offset, |
| 789 DeoptInfo* info, | 790 DeoptInfo* info, |
| 790 Smi* reason) { | 791 Smi* reason) { |
| 791 intptr_t i = index * kEntrySize; | 792 intptr_t i = index * kEntrySize; |
| 792 *offset ^= table.At(i); | 793 *offset ^= table.At(i); |
| 793 *info ^= table.At(i + 1); | 794 *info ^= table.At(i + 1); |
| 794 *reason ^= table.At(i + 2); | 795 *reason ^= table.At(i + 2); |
| 795 } | 796 } |
| 796 | 797 |
| 797 } // namespace dart | 798 } // namespace dart |
| OLD | NEW |