OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ARM64_ASSEMBLER_ARM64_INL_H_ | 5 #ifndef V8_ARM64_ASSEMBLER_ARM64_INL_H_ |
6 #define V8_ARM64_ASSEMBLER_ARM64_INL_H_ | 6 #define V8_ARM64_ASSEMBLER_ARM64_INL_H_ |
7 | 7 |
8 #include "src/arm64/assembler-arm64.h" | 8 #include "src/arm64/assembler-arm64.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) { | 700 Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) { |
701 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 701 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
702 return Handle<HeapObject>( | 702 return Handle<HeapObject>( |
703 reinterpret_cast<HeapObject**>(Assembler::target_address_at(pc_, host_))); | 703 reinterpret_cast<HeapObject**>(Assembler::target_address_at(pc_, host_))); |
704 } | 704 } |
705 | 705 |
706 void RelocInfo::set_target_object(HeapObject* target, | 706 void RelocInfo::set_target_object(HeapObject* target, |
707 WriteBarrierMode write_barrier_mode, | 707 WriteBarrierMode write_barrier_mode, |
708 ICacheFlushMode icache_flush_mode) { | 708 ICacheFlushMode icache_flush_mode) { |
709 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 709 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
710 Assembler::set_target_address_at(isolate_, pc_, host_, | 710 Assembler::set_target_address_at(target->GetIsolate(), pc_, host_, |
711 reinterpret_cast<Address>(target), | 711 reinterpret_cast<Address>(target), |
712 icache_flush_mode); | 712 icache_flush_mode); |
713 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) { | 713 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) { |
714 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this, | 714 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this, |
715 target); | 715 target); |
716 host()->GetHeap()->RecordWriteIntoCode(host(), this, target); | 716 host()->GetHeap()->RecordWriteIntoCode(host(), this, target); |
717 } | 717 } |
718 } | 718 } |
719 | 719 |
720 | 720 |
(...skipping 13 matching lines...) Expand all Loading... |
734 DCHECK(rmode_ == INTERNAL_REFERENCE); | 734 DCHECK(rmode_ == INTERNAL_REFERENCE); |
735 return reinterpret_cast<Address>(pc_); | 735 return reinterpret_cast<Address>(pc_); |
736 } | 736 } |
737 | 737 |
738 | 738 |
739 Address RelocInfo::target_runtime_entry(Assembler* origin) { | 739 Address RelocInfo::target_runtime_entry(Assembler* origin) { |
740 DCHECK(IsRuntimeEntry(rmode_)); | 740 DCHECK(IsRuntimeEntry(rmode_)); |
741 return target_address(); | 741 return target_address(); |
742 } | 742 } |
743 | 743 |
744 | 744 void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target, |
745 void RelocInfo::set_target_runtime_entry(Address target, | |
746 WriteBarrierMode write_barrier_mode, | 745 WriteBarrierMode write_barrier_mode, |
747 ICacheFlushMode icache_flush_mode) { | 746 ICacheFlushMode icache_flush_mode) { |
748 DCHECK(IsRuntimeEntry(rmode_)); | 747 DCHECK(IsRuntimeEntry(rmode_)); |
749 if (target_address() != target) { | 748 if (target_address() != target) { |
750 set_target_address(target, write_barrier_mode, icache_flush_mode); | 749 set_target_address(isolate, target, write_barrier_mode, icache_flush_mode); |
751 } | 750 } |
752 } | 751 } |
753 | 752 |
754 | 753 |
755 Handle<Cell> RelocInfo::target_cell_handle() { | 754 Handle<Cell> RelocInfo::target_cell_handle() { |
756 UNIMPLEMENTED(); | 755 UNIMPLEMENTED(); |
757 Cell *null_cell = NULL; | 756 Cell *null_cell = NULL; |
758 return Handle<Cell>(null_cell); | 757 return Handle<Cell>(null_cell); |
759 } | 758 } |
760 | 759 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 | 799 |
801 | 800 |
802 Address RelocInfo::debug_call_address() { | 801 Address RelocInfo::debug_call_address() { |
803 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); | 802 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); |
804 // For the above sequences the Relocinfo points to the load literal loading | 803 // For the above sequences the Relocinfo points to the load literal loading |
805 // the call address. | 804 // the call address. |
806 STATIC_ASSERT(Assembler::kPatchDebugBreakSlotAddressOffset == 0); | 805 STATIC_ASSERT(Assembler::kPatchDebugBreakSlotAddressOffset == 0); |
807 return Assembler::target_address_at(pc_, host_); | 806 return Assembler::target_address_at(pc_, host_); |
808 } | 807 } |
809 | 808 |
810 | 809 void RelocInfo::set_debug_call_address(Isolate* isolate, Address target) { |
811 void RelocInfo::set_debug_call_address(Address target) { | |
812 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); | 810 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); |
813 STATIC_ASSERT(Assembler::kPatchDebugBreakSlotAddressOffset == 0); | 811 STATIC_ASSERT(Assembler::kPatchDebugBreakSlotAddressOffset == 0); |
814 Assembler::set_target_address_at(isolate_, pc_, host_, target); | 812 Assembler::set_target_address_at(isolate, pc_, host_, target); |
815 if (host() != NULL) { | 813 if (host() != NULL) { |
816 Code* target_code = Code::GetCodeFromTargetAddress(target); | 814 Code* target_code = Code::GetCodeFromTargetAddress(target); |
817 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this, | 815 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this, |
818 target_code); | 816 target_code); |
819 } | 817 } |
820 } | 818 } |
821 | 819 |
822 | 820 void RelocInfo::WipeOut(Isolate* isolate) { |
823 void RelocInfo::WipeOut() { | |
824 DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) || | 821 DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) || |
825 IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) || | 822 IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) || |
826 IsInternalReference(rmode_)); | 823 IsInternalReference(rmode_)); |
827 if (IsInternalReference(rmode_)) { | 824 if (IsInternalReference(rmode_)) { |
828 Memory::Address_at(pc_) = NULL; | 825 Memory::Address_at(pc_) = NULL; |
829 } else { | 826 } else { |
830 Assembler::set_target_address_at(isolate_, pc_, host_, NULL); | 827 Assembler::set_target_address_at(isolate, pc_, host_, NULL); |
831 } | 828 } |
832 } | 829 } |
833 | 830 |
834 template <typename ObjectVisitor> | 831 template <typename ObjectVisitor> |
835 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { | 832 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { |
836 RelocInfo::Mode mode = rmode(); | 833 RelocInfo::Mode mode = rmode(); |
837 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 834 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
838 visitor->VisitEmbeddedPointer(this); | 835 visitor->VisitEmbeddedPointer(this); |
839 } else if (RelocInfo::IsCodeTarget(mode)) { | 836 } else if (RelocInfo::IsCodeTarget(mode)) { |
840 visitor->VisitCodeTarget(this); | 837 visitor->VisitCodeTarget(this); |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 | 1214 |
1218 void Assembler::ClearRecordedAstId() { | 1215 void Assembler::ClearRecordedAstId() { |
1219 recorded_ast_id_ = TypeFeedbackId::None(); | 1216 recorded_ast_id_ = TypeFeedbackId::None(); |
1220 } | 1217 } |
1221 | 1218 |
1222 | 1219 |
1223 } // namespace internal | 1220 } // namespace internal |
1224 } // namespace v8 | 1221 } // namespace v8 |
1225 | 1222 |
1226 #endif // V8_ARM64_ASSEMBLER_ARM64_INL_H_ | 1223 #endif // V8_ARM64_ASSEMBLER_ARM64_INL_H_ |
OLD | NEW |