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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 namespace v8 { | 30 namespace v8 { |
31 namespace internal { | 31 namespace internal { |
32 | 32 |
33 | 33 |
34 const char* Marking::kWhiteBitPattern = "00"; | 34 const char* Marking::kWhiteBitPattern = "00"; |
35 const char* Marking::kBlackBitPattern = "10"; | 35 const char* Marking::kBlackBitPattern = "10"; |
36 const char* Marking::kGreyBitPattern = "11"; | 36 const char* Marking::kGreyBitPattern = "11"; |
37 const char* Marking::kImpossibleBitPattern = "01"; | 37 const char* Marking::kImpossibleBitPattern = "01"; |
38 | 38 |
39 | 39 |
| 40 // The following has to hold in order for {Marking::MarkBitFrom} to not produce |
| 41 // invalid {kImpossibleBitPattern} in the marking bitmap by overlapping. |
| 42 STATIC_ASSERT(Heap::kMinObjectSizeInWords >= 2); |
| 43 |
| 44 |
40 // ------------------------------------------------------------------------- | 45 // ------------------------------------------------------------------------- |
41 // MarkCompactCollector | 46 // MarkCompactCollector |
42 | 47 |
43 MarkCompactCollector::MarkCompactCollector(Heap* heap) | 48 MarkCompactCollector::MarkCompactCollector(Heap* heap) |
44 : // NOLINT | 49 : // NOLINT |
45 #ifdef DEBUG | 50 #ifdef DEBUG |
46 state_(IDLE), | 51 state_(IDLE), |
47 #endif | 52 #endif |
48 marking_parity_(ODD_MARKING_PARITY), | 53 marking_parity_(ODD_MARKING_PARITY), |
49 compacting_(false), | 54 compacting_(false), |
(...skipping 4616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4666 SlotsBuffer* buffer = *buffer_address; | 4671 SlotsBuffer* buffer = *buffer_address; |
4667 while (buffer != NULL) { | 4672 while (buffer != NULL) { |
4668 SlotsBuffer* next_buffer = buffer->next(); | 4673 SlotsBuffer* next_buffer = buffer->next(); |
4669 DeallocateBuffer(buffer); | 4674 DeallocateBuffer(buffer); |
4670 buffer = next_buffer; | 4675 buffer = next_buffer; |
4671 } | 4676 } |
4672 *buffer_address = NULL; | 4677 *buffer_address = NULL; |
4673 } | 4678 } |
4674 } // namespace internal | 4679 } // namespace internal |
4675 } // namespace v8 | 4680 } // namespace v8 |
OLD | NEW |