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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 | 531 |
532 bool TryPromoteObject(HeapObject* object, int object_size); | 532 bool TryPromoteObject(HeapObject* object, int object_size); |
533 | 533 |
534 inline Object* encountered_weak_maps() { return encountered_weak_maps_; } | 534 inline Object* encountered_weak_maps() { return encountered_weak_maps_; } |
535 inline void set_encountered_weak_maps(Object* weak_map) { | 535 inline void set_encountered_weak_maps(Object* weak_map) { |
536 encountered_weak_maps_ = weak_map; | 536 encountered_weak_maps_ = weak_map; |
537 } | 537 } |
538 | 538 |
539 void InvalidateCode(Code* code); | 539 void InvalidateCode(Code* code); |
540 | 540 |
541 void ClearMarkbits(); | |
542 | |
543 void TaintMarkbits() { | |
Erik Corry
2011/10/19 17:56:07
I think it would be preferable with a SetTaintMark
| |
544 markbits_are_tainted_ = true; | |
545 } | |
546 | |
547 bool AreMarkbitsTainted() { | |
548 return markbits_are_tainted_; | |
549 } | |
550 | |
551 static inline bool IsLiveBytesUpdateRequired(HeapObject* obj); | |
552 | |
541 private: | 553 private: |
542 MarkCompactCollector(); | 554 MarkCompactCollector(); |
543 ~MarkCompactCollector(); | 555 ~MarkCompactCollector(); |
544 | 556 |
545 bool MarkInvalidatedCode(); | 557 bool MarkInvalidatedCode(); |
546 void RemoveDeadInvalidatedCode(); | 558 void RemoveDeadInvalidatedCode(); |
547 void ProcessInvalidatedCode(ObjectVisitor* visitor); | 559 void ProcessInvalidatedCode(ObjectVisitor* visitor); |
548 | 560 |
549 | 561 |
550 #ifdef DEBUG | 562 #ifdef DEBUG |
(...skipping 16 matching lines...) Expand all Loading... | |
567 bool sweep_precisely_; | 579 bool sweep_precisely_; |
568 | 580 |
569 // True if we are collecting slots to perform evacuation from evacuation | 581 // True if we are collecting slots to perform evacuation from evacuation |
570 // candidates. | 582 // candidates. |
571 bool compacting_; | 583 bool compacting_; |
572 | 584 |
573 bool was_marked_incrementally_; | 585 bool was_marked_incrementally_; |
574 | 586 |
575 bool collect_maps_; | 587 bool collect_maps_; |
576 | 588 |
589 bool markbits_are_tainted_; | |
590 | |
577 // A pointer to the current stack-allocated GC tracer object during a full | 591 // A pointer to the current stack-allocated GC tracer object during a full |
578 // collection (NULL before and after). | 592 // collection (NULL before and after). |
579 GCTracer* tracer_; | 593 GCTracer* tracer_; |
580 | 594 |
581 SlotsBufferAllocator slots_buffer_allocator_; | 595 SlotsBufferAllocator slots_buffer_allocator_; |
582 | 596 |
583 SlotsBuffer* migration_slots_buffer_; | 597 SlotsBuffer* migration_slots_buffer_; |
584 | 598 |
585 // Finishes GC, performs heap verification if enabled. | 599 // Finishes GC, performs heap verification if enabled. |
586 void Finish(); | 600 void Finish(); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
710 void EvacuateNewSpace(); | 724 void EvacuateNewSpace(); |
711 | 725 |
712 void EvacuateLiveObjectsFromPage(Page* p); | 726 void EvacuateLiveObjectsFromPage(Page* p); |
713 | 727 |
714 void EvacuatePages(); | 728 void EvacuatePages(); |
715 | 729 |
716 void EvacuateNewSpaceAndCandidates(); | 730 void EvacuateNewSpaceAndCandidates(); |
717 | 731 |
718 void SweepSpace(PagedSpace* space, SweeperType sweeper); | 732 void SweepSpace(PagedSpace* space, SweeperType sweeper); |
719 | 733 |
720 | |
721 #ifdef DEBUG | 734 #ifdef DEBUG |
722 // ----------------------------------------------------------------------- | 735 // ----------------------------------------------------------------------- |
723 // Debugging variables, functions and classes | 736 // Debugging variables, functions and classes |
724 // Counters used for debugging the marking phase of mark-compact or | 737 // Counters used for debugging the marking phase of mark-compact or |
725 // mark-sweep collection. | 738 // mark-sweep collection. |
726 | 739 |
727 // Size of live objects in Heap::to_space_. | 740 // Size of live objects in Heap::to_space_. |
728 int live_young_objects_size_; | 741 int live_young_objects_size_; |
729 | 742 |
730 // Size of live objects in Heap::old_pointer_space_. | 743 // Size of live objects in Heap::old_pointer_space_. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
765 | 778 |
766 friend class Heap; | 779 friend class Heap; |
767 }; | 780 }; |
768 | 781 |
769 | 782 |
770 const char* AllocationSpaceName(AllocationSpace space); | 783 const char* AllocationSpaceName(AllocationSpace space); |
771 | 784 |
772 } } // namespace v8::internal | 785 } } // namespace v8::internal |
773 | 786 |
774 #endif // V8_MARK_COMPACT_H_ | 787 #endif // V8_MARK_COMPACT_H_ |
OLD | NEW |