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 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 | 1630 |
1631 class MarkCompactCollector::EvacuateVisitorBase | 1631 class MarkCompactCollector::EvacuateVisitorBase |
1632 : public MarkCompactCollector::HeapObjectVisitor { | 1632 : public MarkCompactCollector::HeapObjectVisitor { |
1633 protected: | 1633 protected: |
1634 enum MigrationMode { kFast, kProfiled }; | 1634 enum MigrationMode { kFast, kProfiled }; |
1635 | 1635 |
1636 EvacuateVisitorBase(Heap* heap, CompactionSpaceCollection* compaction_spaces) | 1636 EvacuateVisitorBase(Heap* heap, CompactionSpaceCollection* compaction_spaces) |
1637 : heap_(heap), | 1637 : heap_(heap), |
1638 compaction_spaces_(compaction_spaces), | 1638 compaction_spaces_(compaction_spaces), |
1639 profiling_( | 1639 profiling_( |
1640 heap->isolate()->cpu_profiler()->is_profiling() || | 1640 heap->isolate()->is_profiling() || |
1641 heap->isolate()->logger()->is_logging_code_events() || | 1641 heap->isolate()->logger()->is_logging_code_events() || |
1642 heap->isolate()->heap_profiler()->is_tracking_object_moves()) {} | 1642 heap->isolate()->heap_profiler()->is_tracking_object_moves()) {} |
1643 | 1643 |
1644 inline bool TryEvacuateObject(PagedSpace* target_space, HeapObject* object, | 1644 inline bool TryEvacuateObject(PagedSpace* target_space, HeapObject* object, |
1645 HeapObject** target_object) { | 1645 HeapObject** target_object) { |
1646 #ifdef VERIFY_HEAP | 1646 #ifdef VERIFY_HEAP |
1647 if (AbortCompactionForTesting(object)) return false; | 1647 if (AbortCompactionForTesting(object)) return false; |
1648 #endif // VERIFY_HEAP | 1648 #endif // VERIFY_HEAP |
1649 int size = object->Size(); | 1649 int size = object->Size(); |
1650 AllocationAlignment alignment = object->RequiredAlignment(); | 1650 AllocationAlignment alignment = object->RequiredAlignment(); |
(...skipping 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3993 MarkBit mark_bit = Marking::MarkBitFrom(host); | 3993 MarkBit mark_bit = Marking::MarkBitFrom(host); |
3994 if (Marking::IsBlack(mark_bit)) { | 3994 if (Marking::IsBlack(mark_bit)) { |
3995 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 3995 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
3996 RecordRelocSlot(host, &rinfo, target); | 3996 RecordRelocSlot(host, &rinfo, target); |
3997 } | 3997 } |
3998 } | 3998 } |
3999 } | 3999 } |
4000 | 4000 |
4001 } // namespace internal | 4001 } // namespace internal |
4002 } // namespace v8 | 4002 } // namespace v8 |
OLD | NEW |