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 3991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4002 } | 4002 } |
4003 | 4003 |
4004 | 4004 |
4005 void MarkCompactCollector::RecordCodeTargetPatch(Address pc, Code* target) { | 4005 void MarkCompactCollector::RecordCodeTargetPatch(Address pc, Code* target) { |
4006 DCHECK(heap()->gc_state() == Heap::MARK_COMPACT); | 4006 DCHECK(heap()->gc_state() == Heap::MARK_COMPACT); |
4007 if (is_compacting()) { | 4007 if (is_compacting()) { |
4008 Code* host = | 4008 Code* host = |
4009 isolate()->inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer( | 4009 isolate()->inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer( |
4010 pc); | 4010 pc); |
4011 if (ObjectMarking::IsBlack(host)) { | 4011 if (ObjectMarking::IsBlack(host)) { |
4012 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 4012 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); |
4013 // The target is always in old space, we don't have to record the slot in | 4013 // The target is always in old space, we don't have to record the slot in |
4014 // the old-to-new remembered set. | 4014 // the old-to-new remembered set. |
4015 DCHECK(!heap()->InNewSpace(target)); | 4015 DCHECK(!heap()->InNewSpace(target)); |
4016 RecordRelocSlot(host, &rinfo, target); | 4016 RecordRelocSlot(host, &rinfo, target); |
4017 } | 4017 } |
4018 } | 4018 } |
4019 } | 4019 } |
4020 | 4020 |
4021 } // namespace internal | 4021 } // namespace internal |
4022 } // namespace v8 | 4022 } // namespace v8 |
OLD | NEW |