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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 return Isolate::Current()->current_zone()->PrintToString( | 699 return Isolate::Current()->current_zone()->PrintToString( |
700 "int64 register pair: %s,%s", Assembler::RegisterName(hi_reg_), | 700 "int64 register pair: %s,%s", Assembler::RegisterName(hi_reg_), |
701 Assembler::RegisterName(lo_reg_)); | 701 Assembler::RegisterName(lo_reg_)); |
702 } | 702 } |
703 | 703 |
704 void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) { | 704 void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) { |
705 uint32_t lo_value = deopt_context->RegisterValue(lo_reg_); | 705 uint32_t lo_value = deopt_context->RegisterValue(lo_reg_); |
706 int32_t hi_value = deopt_context->RegisterValue(hi_reg_); | 706 int32_t hi_value = deopt_context->RegisterValue(hi_reg_); |
707 int64_t value = Utils::LowHighTo64Bits(lo_value, hi_value); | 707 int64_t value = Utils::LowHighTo64Bits(lo_value, hi_value); |
708 *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0); | 708 *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0); |
709 if (Smi::IsValid64(value)) { | 709 if (Smi::IsValid(value)) { |
710 *dest_addr = reinterpret_cast<intptr_t>( | 710 *dest_addr = reinterpret_cast<intptr_t>( |
711 Smi::New(static_cast<intptr_t>(value))); | 711 Smi::New(static_cast<intptr_t>(value))); |
712 } else { | 712 } else { |
713 deopt_context->DeferMintMaterialization( | 713 deopt_context->DeferMintMaterialization( |
714 value, reinterpret_cast<RawMint**>(dest_addr)); | 714 value, reinterpret_cast<RawMint**>(dest_addr)); |
715 } | 715 } |
716 } | 716 } |
717 | 717 |
718 static const intptr_t kFieldWidth = kBitsPerWord / 2; | 718 static const intptr_t kFieldWidth = kBitsPerWord / 2; |
719 class LoRegister : public BitField<intptr_t, 0, kFieldWidth> { }; | 719 class LoRegister : public BitField<intptr_t, 0, kFieldWidth> { }; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 intptr_t lo_source_index = | 761 intptr_t lo_source_index = |
762 deopt_context->source_frame_size() - lo_slot_ - 1; | 762 deopt_context->source_frame_size() - lo_slot_ - 1; |
763 int32_t* lo_source_addr = reinterpret_cast<int32_t*>( | 763 int32_t* lo_source_addr = reinterpret_cast<int32_t*>( |
764 deopt_context->GetSourceFrameAddressAt(lo_source_index)); | 764 deopt_context->GetSourceFrameAddressAt(lo_source_index)); |
765 intptr_t hi_source_index = | 765 intptr_t hi_source_index = |
766 deopt_context->source_frame_size() - hi_slot_ - 1; | 766 deopt_context->source_frame_size() - hi_slot_ - 1; |
767 int32_t* hi_source_addr = reinterpret_cast<int32_t*>( | 767 int32_t* hi_source_addr = reinterpret_cast<int32_t*>( |
768 deopt_context->GetSourceFrameAddressAt(hi_source_index)); | 768 deopt_context->GetSourceFrameAddressAt(hi_source_index)); |
769 int64_t value = Utils::LowHighTo64Bits(*lo_source_addr, *hi_source_addr); | 769 int64_t value = Utils::LowHighTo64Bits(*lo_source_addr, *hi_source_addr); |
770 *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0); | 770 *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0); |
771 if (Smi::IsValid64(value)) { | 771 if (Smi::IsValid(value)) { |
772 *dest_addr = reinterpret_cast<intptr_t>( | 772 *dest_addr = reinterpret_cast<intptr_t>( |
773 Smi::New(static_cast<intptr_t>(value))); | 773 Smi::New(static_cast<intptr_t>(value))); |
774 } else { | 774 } else { |
775 deopt_context->DeferMintMaterialization( | 775 deopt_context->DeferMintMaterialization( |
776 value, reinterpret_cast<RawMint**>(dest_addr)); | 776 value, reinterpret_cast<RawMint**>(dest_addr)); |
777 } | 777 } |
778 } | 778 } |
779 | 779 |
780 static const intptr_t kFieldWidth = kBitsPerWord / 2; | 780 static const intptr_t kFieldWidth = kBitsPerWord / 2; |
781 class LoSlot : public BitField<intptr_t, 0, kFieldWidth> { }; | 781 class LoSlot : public BitField<intptr_t, 0, kFieldWidth> { }; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 deopt_context->GetSourceFrameAddressAt(slot_source_index)); | 840 deopt_context->GetSourceFrameAddressAt(slot_source_index)); |
841 int32_t slot_value = *slot_source_addr; | 841 int32_t slot_value = *slot_source_addr; |
842 int32_t reg_value = deopt_context->RegisterValue(reg_); | 842 int32_t reg_value = deopt_context->RegisterValue(reg_); |
843 int64_t value; | 843 int64_t value; |
844 if (flip_) { | 844 if (flip_) { |
845 value = Utils::LowHighTo64Bits(reg_value, slot_value); | 845 value = Utils::LowHighTo64Bits(reg_value, slot_value); |
846 } else { | 846 } else { |
847 value = Utils::LowHighTo64Bits(slot_value, reg_value); | 847 value = Utils::LowHighTo64Bits(slot_value, reg_value); |
848 } | 848 } |
849 *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0); | 849 *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0); |
850 if (Smi::IsValid64(value)) { | 850 if (Smi::IsValid(value)) { |
851 *dest_addr = reinterpret_cast<intptr_t>( | 851 *dest_addr = reinterpret_cast<intptr_t>( |
852 Smi::New(static_cast<intptr_t>(value))); | 852 Smi::New(static_cast<intptr_t>(value))); |
853 } else { | 853 } else { |
854 deopt_context->DeferMintMaterialization( | 854 deopt_context->DeferMintMaterialization( |
855 value, reinterpret_cast<RawMint**>(dest_addr)); | 855 value, reinterpret_cast<RawMint**>(dest_addr)); |
856 } | 856 } |
857 } | 857 } |
858 | 858 |
859 static const intptr_t kFieldWidth = kBitsPerWord / 2; | 859 static const intptr_t kFieldWidth = kBitsPerWord / 2; |
860 class Slot : public BitField<intptr_t, 0, kFieldWidth> { }; | 860 class Slot : public BitField<intptr_t, 0, kFieldWidth> { }; |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 Smi* offset, | 1667 Smi* offset, |
1668 DeoptInfo* info, | 1668 DeoptInfo* info, |
1669 Smi* reason) { | 1669 Smi* reason) { |
1670 intptr_t i = index * kEntrySize; | 1670 intptr_t i = index * kEntrySize; |
1671 *offset ^= table.At(i); | 1671 *offset ^= table.At(i); |
1672 *info ^= table.At(i + 1); | 1672 *info ^= table.At(i + 1); |
1673 *reason ^= table.At(i + 2); | 1673 *reason ^= table.At(i + 2); |
1674 } | 1674 } |
1675 | 1675 |
1676 } // namespace dart | 1676 } // namespace dart |
OLD | NEW |