| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include "src/heap/mark-compact.h" | 5 #include "src/heap/mark-compact.h" |
| 6 | 6 |
| 7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/base/sys-info.h" | 9 #include "src/base/sys-info.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2843 void VisitCodeAgeSequence(RelocInfo* rinfo) override { | 2843 void VisitCodeAgeSequence(RelocInfo* rinfo) override { |
| 2844 DCHECK(RelocInfo::IsCodeAgeSequence(rinfo->rmode())); | 2844 DCHECK(RelocInfo::IsCodeAgeSequence(rinfo->rmode())); |
| 2845 Object* stub = rinfo->code_age_stub(); | 2845 Object* stub = rinfo->code_age_stub(); |
| 2846 DCHECK(stub != NULL); | 2846 DCHECK(stub != NULL); |
| 2847 VisitPointer(&stub); | 2847 VisitPointer(&stub); |
| 2848 if (stub != rinfo->code_age_stub()) { | 2848 if (stub != rinfo->code_age_stub()) { |
| 2849 rinfo->set_code_age_stub(Code::cast(stub)); | 2849 rinfo->set_code_age_stub(Code::cast(stub)); |
| 2850 } | 2850 } |
| 2851 } | 2851 } |
| 2852 | 2852 |
| 2853 void VisitCodeEntry(Address entry_address) override { |
| 2854 Object* code = Code::GetObjectFromEntryAddress(entry_address); |
| 2855 Object* old_code = code; |
| 2856 VisitPointer(&code); |
| 2857 if (code != old_code) { |
| 2858 Memory::Address_at(entry_address) = |
| 2859 reinterpret_cast<Code*>(code)->entry(); |
| 2860 } |
| 2861 } |
| 2862 |
| 2853 void VisitDebugTarget(RelocInfo* rinfo) override { | 2863 void VisitDebugTarget(RelocInfo* rinfo) override { |
| 2854 DCHECK(RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && | 2864 DCHECK(RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && |
| 2855 rinfo->IsPatchedDebugBreakSlotSequence()); | 2865 rinfo->IsPatchedDebugBreakSlotSequence()); |
| 2856 Object* target = | 2866 Object* target = |
| 2857 Code::GetCodeFromTargetAddress(rinfo->debug_call_address()); | 2867 Code::GetCodeFromTargetAddress(rinfo->debug_call_address()); |
| 2858 VisitPointer(&target); | 2868 VisitPointer(&target); |
| 2859 rinfo->set_debug_call_address(Code::cast(target)->instruction_start()); | 2869 rinfo->set_debug_call_address(Code::cast(target)->instruction_start()); |
| 2860 } | 2870 } |
| 2861 | 2871 |
| 2862 static inline void UpdateSlot(Heap* heap, Object** slot) { | 2872 static inline void UpdateSlot(Heap* heap, Object** slot) { |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3947 MarkBit mark_bit = Marking::MarkBitFrom(host); | 3957 MarkBit mark_bit = Marking::MarkBitFrom(host); |
| 3948 if (Marking::IsBlack(mark_bit)) { | 3958 if (Marking::IsBlack(mark_bit)) { |
| 3949 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 3959 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
| 3950 RecordRelocSlot(host, &rinfo, target); | 3960 RecordRelocSlot(host, &rinfo, target); |
| 3951 } | 3961 } |
| 3952 } | 3962 } |
| 3953 } | 3963 } |
| 3954 | 3964 |
| 3955 } // namespace internal | 3965 } // namespace internal |
| 3956 } // namespace v8 | 3966 } // namespace v8 |
| OLD | NEW |