Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 #endif | 509 #endif |
| 510 | 510 |
| 511 // Global flag that forces sweeping to be precise, so we can traverse the | 511 // Global flag that forces sweeping to be precise, so we can traverse the |
| 512 // heap. | 512 // heap. |
| 513 bool sweep_precisely_; | 513 bool sweep_precisely_; |
| 514 | 514 |
| 515 // True if we are collecting slots to perform evacuation from evacuation | 515 // True if we are collecting slots to perform evacuation from evacuation |
| 516 // candidates. | 516 // candidates. |
| 517 bool compacting_; | 517 bool compacting_; |
| 518 | 518 |
| 519 bool collect_maps_; | |
| 520 | |
| 519 // A pointer to the current stack-allocated GC tracer object during a full | 521 // A pointer to the current stack-allocated GC tracer object during a full |
| 520 // collection (NULL before and after). | 522 // collection (NULL before and after). |
| 521 GCTracer* tracer_; | 523 GCTracer* tracer_; |
| 522 | 524 |
| 523 SlotsBufferAllocator slots_buffer_allocator_; | 525 SlotsBufferAllocator slots_buffer_allocator_; |
| 524 | 526 |
| 525 SlotsBuffer* migration_slots_buffer_; | 527 SlotsBuffer* migration_slots_buffer_; |
| 526 | 528 |
| 527 // Finishes GC, performs heap verification if enabled. | 529 // Finishes GC, performs heap verification if enabled. |
| 528 void Finish(); | 530 void Finish(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 610 static bool IsUnmarkedHeapObject(Object** p); | 612 static bool IsUnmarkedHeapObject(Object** p); |
| 611 | 613 |
| 612 #ifdef DEBUG | 614 #ifdef DEBUG |
| 613 void UpdateLiveObjectCount(HeapObject* obj); | 615 void UpdateLiveObjectCount(HeapObject* obj); |
| 614 #endif | 616 #endif |
| 615 | 617 |
| 616 // Map transitions from a live map to a dead map must be killed. | 618 // Map transitions from a live map to a dead map must be killed. |
| 617 // We replace them with a null descriptor, with the same key. | 619 // We replace them with a null descriptor, with the same key. |
| 618 void ClearNonLiveTransitions(); | 620 void ClearNonLiveTransitions(); |
| 619 | 621 |
| 622 void ReattachInitialMaps(); | |
|
Lasse Reichstein
2011/07/15 07:00:14
Make a comment saying what the function does, and
| |
| 623 | |
| 620 // ----------------------------------------------------------------------- | 624 // ----------------------------------------------------------------------- |
| 621 // Phase 2: Sweeping to clear mark bits and free non-live objects for | 625 // Phase 2: Sweeping to clear mark bits and free non-live objects for |
| 622 // a non-compacting collection. | 626 // a non-compacting collection. |
| 623 // | 627 // |
| 624 // Before: Live objects are marked and non-live objects are unmarked. | 628 // Before: Live objects are marked and non-live objects are unmarked. |
| 625 // | 629 // |
| 626 // After: Live objects are unmarked, non-live regions have been added to | 630 // After: Live objects are unmarked, non-live regions have been added to |
| 627 // their space's free list. Active eden semispace is compacted by | 631 // their space's free list. Active eden semispace is compacted by |
| 628 // evacuation. | 632 // evacuation. |
| 629 // | 633 // |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 699 | 703 |
| 700 List<Page*> evacuation_candidates_; | 704 List<Page*> evacuation_candidates_; |
| 701 | 705 |
| 702 friend class Heap; | 706 friend class Heap; |
| 703 }; | 707 }; |
| 704 | 708 |
| 705 | 709 |
| 706 } } // namespace v8::internal | 710 } } // namespace v8::internal |
| 707 | 711 |
| 708 #endif // V8_MARK_COMPACT_H_ | 712 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |