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 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 } | 1399 } |
1400 | 1400 |
1401 // Skip the weak next code link in a code object, which is visited in | 1401 // Skip the weak next code link in a code object, which is visited in |
1402 // ProcessTopOptimizedFrame. | 1402 // ProcessTopOptimizedFrame. |
1403 void VisitNextCodeLink(Object** p) override {} | 1403 void VisitNextCodeLink(Object** p) override {} |
1404 | 1404 |
1405 private: | 1405 private: |
1406 void MarkObjectByPointer(Object** p) { | 1406 void MarkObjectByPointer(Object** p) { |
1407 if (!(*p)->IsHeapObject()) return; | 1407 if (!(*p)->IsHeapObject()) return; |
1408 | 1408 |
1409 // Replace flat cons strings in place. | |
1410 HeapObject* object = HeapObject::cast(*p); | 1409 HeapObject* object = HeapObject::cast(*p); |
| 1410 |
1411 MarkBit mark_bit = Marking::MarkBitFrom(object); | 1411 MarkBit mark_bit = Marking::MarkBitFrom(object); |
1412 if (Marking::IsBlackOrGrey(mark_bit)) return; | 1412 if (Marking::IsBlackOrGrey(mark_bit)) return; |
1413 | 1413 |
1414 Map* map = object->map(); | 1414 Map* map = object->map(); |
1415 // Mark the object. | 1415 // Mark the object. |
1416 collector_->SetMark(object, mark_bit); | 1416 collector_->SetMark(object, mark_bit); |
1417 | 1417 |
1418 // Mark the map pointer and body, and push them on the marking stack. | 1418 // Mark the map pointer and body, and push them on the marking stack. |
1419 MarkBit map_mark = Marking::MarkBitFrom(map); | 1419 MarkBit map_mark = Marking::MarkBitFrom(map); |
1420 collector_->MarkObject(map, map_mark); | 1420 collector_->MarkObject(map, map_mark); |
(...skipping 2529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3950 MarkBit mark_bit = Marking::MarkBitFrom(host); | 3950 MarkBit mark_bit = Marking::MarkBitFrom(host); |
3951 if (Marking::IsBlack(mark_bit)) { | 3951 if (Marking::IsBlack(mark_bit)) { |
3952 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 3952 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
3953 RecordRelocSlot(host, &rinfo, target); | 3953 RecordRelocSlot(host, &rinfo, target); |
3954 } | 3954 } |
3955 } | 3955 } |
3956 } | 3956 } |
3957 | 3957 |
3958 } // namespace internal | 3958 } // namespace internal |
3959 } // namespace v8 | 3959 } // namespace v8 |
OLD | NEW |