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