| 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.h" | 7 #include "vm/assembler.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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 577 |
| 578 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); | 578 uword pc = code.GetPcForDeoptId(deopt_id_, PcDescriptors::kIcCall); |
| 579 if (pc != 0) { | 579 if (pc != 0) { |
| 580 // If the deoptimization happened at an IC call, update the IC data | 580 // If the deoptimization happened at an IC call, update the IC data |
| 581 // to avoid repeated deoptimization at the same site next time around. | 581 // to avoid repeated deoptimization at the same site next time around. |
| 582 ICData& ic_data = ICData::Handle(); | 582 ICData& ic_data = ICData::Handle(); |
| 583 CodePatcher::GetInstanceCallAt(pc, code, &ic_data); | 583 CodePatcher::GetInstanceCallAt(pc, code, &ic_data); |
| 584 if (!ic_data.IsNull()) { | 584 if (!ic_data.IsNull()) { |
| 585 ic_data.set_deopt_reason(deopt_context->deopt_reason()); | 585 ic_data.set_deopt_reason(deopt_context->deopt_reason()); |
| 586 } | 586 } |
| 587 } else if (deopt_context->deopt_reason() == kDeoptHoistedCheckClass) { |
| 588 // Prevent excessive deoptimization. |
| 589 Function::Handle(code.function()).set_allows_hoisting_check_class(false); |
| 587 } | 590 } |
| 588 } | 591 } |
| 589 | 592 |
| 590 intptr_t object_table_index() const { return object_table_index_; } | 593 intptr_t object_table_index() const { return object_table_index_; } |
| 591 intptr_t deopt_id() const { return deopt_id_; } | 594 intptr_t deopt_id() const { return deopt_id_; } |
| 592 | 595 |
| 593 private: | 596 private: |
| 594 static const intptr_t kFieldWidth = kBitsPerWord / 2; | 597 static const intptr_t kFieldWidth = kBitsPerWord / 2; |
| 595 class ObjectTableIndex : public BitField<intptr_t, 0, kFieldWidth> { }; | 598 class ObjectTableIndex : public BitField<intptr_t, 0, kFieldWidth> { }; |
| 596 class DeoptId : public BitField<intptr_t, kFieldWidth, kFieldWidth> { }; | 599 class DeoptId : public BitField<intptr_t, kFieldWidth, kFieldWidth> { }; |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 Smi* offset, | 1410 Smi* offset, |
| 1408 DeoptInfo* info, | 1411 DeoptInfo* info, |
| 1409 Smi* reason) { | 1412 Smi* reason) { |
| 1410 intptr_t i = index * kEntrySize; | 1413 intptr_t i = index * kEntrySize; |
| 1411 *offset ^= table.At(i); | 1414 *offset ^= table.At(i); |
| 1412 *info ^= table.At(i + 1); | 1415 *info ^= table.At(i + 1); |
| 1413 *reason ^= table.At(i + 2); | 1416 *reason ^= table.At(i + 2); |
| 1414 } | 1417 } |
| 1415 | 1418 |
| 1416 } // namespace dart | 1419 } // namespace dart |
| OLD | NEW |