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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 // variable. | 770 // variable. |
771 tracer_ = tracer; | 771 tracer_ = tracer; |
772 | 772 |
773 #ifdef DEBUG | 773 #ifdef DEBUG |
774 ASSERT(state_ == IDLE); | 774 ASSERT(state_ == IDLE); |
775 state_ = PREPARE_GC; | 775 state_ = PREPARE_GC; |
776 #endif | 776 #endif |
777 | 777 |
778 ASSERT(!FLAG_never_compact || !FLAG_always_compact); | 778 ASSERT(!FLAG_never_compact || !FLAG_always_compact); |
779 | 779 |
780 #ifdef ENABLE_GDB_JIT_INTERFACE | |
781 if (FLAG_gdbjit) { | |
782 // If GDBJIT interface is active disable compaction. | |
783 compacting_collection_ = false; | |
784 } | |
785 #endif | |
786 | |
787 // Clear marking bits if incremental marking is aborted. | 780 // Clear marking bits if incremental marking is aborted. |
788 if (was_marked_incrementally_ && abort_incremental_marking_) { | 781 if (was_marked_incrementally_ && abort_incremental_marking_) { |
789 heap()->incremental_marking()->Abort(); | 782 heap()->incremental_marking()->Abort(); |
790 ClearMarkbits(); | 783 ClearMarkbits(); |
791 AbortCompaction(); | 784 AbortCompaction(); |
792 was_marked_incrementally_ = false; | 785 was_marked_incrementally_ = false; |
793 } | 786 } |
794 | 787 |
| 788 bool never_compact = FLAG_never_compact; |
| 789 |
| 790 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 791 never_compact = never_compact || FLAG_gdbjit; |
| 792 #endif |
| 793 |
795 // Don't start compaction if we are in the middle of incremental | 794 // Don't start compaction if we are in the middle of incremental |
796 // marking cycle. We did not collect any slots. | 795 // marking cycle. We did not collect any slots. |
797 if (!FLAG_never_compact && !was_marked_incrementally_) { | 796 if (!never_compact && !was_marked_incrementally_) { |
798 StartCompaction(NON_INCREMENTAL_COMPACTION); | 797 StartCompaction(NON_INCREMENTAL_COMPACTION); |
799 } | 798 } |
800 | 799 |
801 PagedSpaces spaces; | 800 PagedSpaces spaces; |
802 for (PagedSpace* space = spaces.next(); | 801 for (PagedSpace* space = spaces.next(); |
803 space != NULL; | 802 space != NULL; |
804 space = spaces.next()) { | 803 space = spaces.next()) { |
805 space->PrepareForMarkCompact(); | 804 space->PrepareForMarkCompact(); |
806 } | 805 } |
807 | 806 |
(...skipping 3334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4142 while (buffer != NULL) { | 4141 while (buffer != NULL) { |
4143 SlotsBuffer* next_buffer = buffer->next(); | 4142 SlotsBuffer* next_buffer = buffer->next(); |
4144 DeallocateBuffer(buffer); | 4143 DeallocateBuffer(buffer); |
4145 buffer = next_buffer; | 4144 buffer = next_buffer; |
4146 } | 4145 } |
4147 *buffer_address = NULL; | 4146 *buffer_address = NULL; |
4148 } | 4147 } |
4149 | 4148 |
4150 | 4149 |
4151 } } // namespace v8::internal | 4150 } } // namespace v8::internal |
OLD | NEW |