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 3915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3926 MarkCompactMarkingVisitor::Initialize(); | 3926 MarkCompactMarkingVisitor::Initialize(); |
3927 IncrementalMarking::Initialize(); | 3927 IncrementalMarking::Initialize(); |
3928 } | 3928 } |
3929 | 3929 |
3930 void MarkCompactCollector::RecordCodeEntrySlot(HeapObject* host, Address slot, | 3930 void MarkCompactCollector::RecordCodeEntrySlot(HeapObject* host, Address slot, |
3931 Code* target) { | 3931 Code* target) { |
3932 Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target)); | 3932 Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target)); |
3933 Page* source_page = Page::FromAddress(reinterpret_cast<Address>(host)); | 3933 Page* source_page = Page::FromAddress(reinterpret_cast<Address>(host)); |
3934 if (target_page->IsEvacuationCandidate() && | 3934 if (target_page->IsEvacuationCandidate() && |
3935 !ShouldSkipEvacuationSlotRecording(host)) { | 3935 !ShouldSkipEvacuationSlotRecording(host)) { |
| 3936 // TODO(ulan): remove this check after investigating crbug.com/414964. |
| 3937 CHECK(target->IsCode()); |
3936 RememberedSet<OLD_TO_OLD>::InsertTyped(source_page, CODE_ENTRY_SLOT, slot); | 3938 RememberedSet<OLD_TO_OLD>::InsertTyped(source_page, CODE_ENTRY_SLOT, slot); |
3937 } | 3939 } |
3938 } | 3940 } |
3939 | 3941 |
3940 | 3942 |
3941 void MarkCompactCollector::RecordCodeTargetPatch(Address pc, Code* target) { | 3943 void MarkCompactCollector::RecordCodeTargetPatch(Address pc, Code* target) { |
3942 DCHECK(heap()->gc_state() == Heap::MARK_COMPACT); | 3944 DCHECK(heap()->gc_state() == Heap::MARK_COMPACT); |
3943 if (is_compacting()) { | 3945 if (is_compacting()) { |
3944 Code* host = | 3946 Code* host = |
3945 isolate()->inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer( | 3947 isolate()->inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer( |
3946 pc); | 3948 pc); |
3947 MarkBit mark_bit = Marking::MarkBitFrom(host); | 3949 MarkBit mark_bit = Marking::MarkBitFrom(host); |
3948 if (Marking::IsBlack(mark_bit)) { | 3950 if (Marking::IsBlack(mark_bit)) { |
3949 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 3951 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
3950 RecordRelocSlot(host, &rinfo, target); | 3952 RecordRelocSlot(host, &rinfo, target); |
3951 } | 3953 } |
3952 } | 3954 } |
3953 } | 3955 } |
3954 | 3956 |
3955 } // namespace internal | 3957 } // namespace internal |
3956 } // namespace v8 | 3958 } // namespace v8 |
OLD | NEW |