OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 const char* Marking::kWhiteBitPattern = "00"; | 50 const char* Marking::kWhiteBitPattern = "00"; |
51 const char* Marking::kBlackBitPattern = "10"; | 51 const char* Marking::kBlackBitPattern = "10"; |
52 const char* Marking::kGreyBitPattern = "11"; | 52 const char* Marking::kGreyBitPattern = "11"; |
53 const char* Marking::kImpossibleBitPattern = "01"; | 53 const char* Marking::kImpossibleBitPattern = "01"; |
54 | 54 |
55 | 55 |
56 // ------------------------------------------------------------------------- | 56 // ------------------------------------------------------------------------- |
57 // MarkCompactCollector | 57 // MarkCompactCollector |
58 | 58 |
59 MarkCompactCollector::MarkCompactCollector() : // NOLINT | 59 MarkCompactCollector::MarkCompactCollector(Heap* heap) : // NOLINT |
60 #ifdef DEBUG | 60 #ifdef DEBUG |
61 state_(IDLE), | 61 state_(IDLE), |
62 #endif | 62 #endif |
63 sweep_precisely_(false), | 63 sweep_precisely_(false), |
64 reduce_memory_footprint_(false), | 64 reduce_memory_footprint_(false), |
65 abort_incremental_marking_(false), | 65 abort_incremental_marking_(false), |
66 marking_parity_(ODD_MARKING_PARITY), | 66 marking_parity_(ODD_MARKING_PARITY), |
67 compacting_(false), | 67 compacting_(false), |
68 was_marked_incrementally_(false), | 68 was_marked_incrementally_(false), |
69 sweeping_pending_(false), | 69 sweeping_pending_(false), |
70 sequential_sweeping_(false), | 70 sequential_sweeping_(false), |
71 tracer_(NULL), | 71 tracer_(NULL), |
72 migration_slots_buffer_(NULL), | 72 migration_slots_buffer_(NULL), |
73 heap_(NULL), | 73 heap_(heap), |
74 code_flusher_(NULL), | 74 code_flusher_(NULL), |
75 encountered_weak_collections_(NULL), | 75 encountered_weak_collections_(NULL), |
76 have_code_to_deoptimize_(false) { } | 76 have_code_to_deoptimize_(false) { } |
77 | 77 |
78 #ifdef VERIFY_HEAP | 78 #ifdef VERIFY_HEAP |
79 class VerifyMarkingVisitor: public ObjectVisitor { | 79 class VerifyMarkingVisitor: public ObjectVisitor { |
80 public: | 80 public: |
81 explicit VerifyMarkingVisitor(Heap* heap) : heap_(heap) {} | 81 explicit VerifyMarkingVisitor(Heap* heap) : heap_(heap) {} |
82 | 82 |
83 void VisitPointers(Object** start, Object** end) { | 83 void VisitPointers(Object** start, Object** end) { |
(...skipping 4285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4369 while (buffer != NULL) { | 4369 while (buffer != NULL) { |
4370 SlotsBuffer* next_buffer = buffer->next(); | 4370 SlotsBuffer* next_buffer = buffer->next(); |
4371 DeallocateBuffer(buffer); | 4371 DeallocateBuffer(buffer); |
4372 buffer = next_buffer; | 4372 buffer = next_buffer; |
4373 } | 4373 } |
4374 *buffer_address = NULL; | 4374 *buffer_address = NULL; |
4375 } | 4375 } |
4376 | 4376 |
4377 | 4377 |
4378 } } // namespace v8::internal | 4378 } } // namespace v8::internal |
OLD | NEW |