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 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 // Skip the weak next code link in a code object, which is visited in | 1406 // Skip the weak next code link in a code object, which is visited in |
1407 // ProcessTopOptimizedFrame. | 1407 // ProcessTopOptimizedFrame. |
1408 void VisitNextCodeLink(Object** p) override {} | 1408 void VisitNextCodeLink(Object** p) override {} |
1409 | 1409 |
1410 private: | 1410 private: |
1411 void MarkObjectByPointer(Object** p) { | 1411 void MarkObjectByPointer(Object** p) { |
1412 if (!(*p)->IsHeapObject()) return; | 1412 if (!(*p)->IsHeapObject()) return; |
1413 | 1413 |
1414 HeapObject* object = HeapObject::cast(*p); | 1414 HeapObject* object = HeapObject::cast(*p); |
1415 | 1415 |
1416 if (collector_->heap()->PurgeLeftTrimmedObject(p)) return; | |
1417 | |
1418 MarkBit mark_bit = Marking::MarkBitFrom(object); | 1416 MarkBit mark_bit = Marking::MarkBitFrom(object); |
1419 if (Marking::IsBlackOrGrey(mark_bit)) return; | 1417 if (Marking::IsBlackOrGrey(mark_bit)) return; |
1420 | 1418 |
1421 Map* map = object->map(); | 1419 Map* map = object->map(); |
1422 // Mark the object. | 1420 // Mark the object. |
1423 collector_->SetMark(object, mark_bit); | 1421 collector_->SetMark(object, mark_bit); |
1424 | 1422 |
1425 // Mark the map pointer and body, and push them on the marking stack. | 1423 // Mark the map pointer and body, and push them on the marking stack. |
1426 MarkBit map_mark = Marking::MarkBitFrom(map); | 1424 MarkBit map_mark = Marking::MarkBitFrom(map); |
1427 collector_->MarkObject(map, map_mark); | 1425 collector_->MarkObject(map, map_mark); |
(...skipping 2668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4096 // The target is always in old space, we don't have to record the slot in | 4094 // The target is always in old space, we don't have to record the slot in |
4097 // the old-to-new remembered set. | 4095 // the old-to-new remembered set. |
4098 DCHECK(!heap()->InNewSpace(target)); | 4096 DCHECK(!heap()->InNewSpace(target)); |
4099 RecordRelocSlot(host, &rinfo, target); | 4097 RecordRelocSlot(host, &rinfo, target); |
4100 } | 4098 } |
4101 } | 4099 } |
4102 } | 4100 } |
4103 | 4101 |
4104 } // namespace internal | 4102 } // namespace internal |
4105 } // namespace v8 | 4103 } // namespace v8 |
OLD | NEW |