| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 } | 829 } |
| 830 } | 830 } |
| 831 } | 831 } |
| 832 | 832 |
| 833 // ------------------------------------------------------------------------- | 833 // ------------------------------------------------------------------------- |
| 834 // Phase 2: Encode forwarding addresses. | 834 // Phase 2: Encode forwarding addresses. |
| 835 // When compacting, forwarding addresses for objects in old space and map | 835 // When compacting, forwarding addresses for objects in old space and map |
| 836 // space are encoded in their map pointer word (along with an encoding of | 836 // space are encoded in their map pointer word (along with an encoding of |
| 837 // their map pointers). | 837 // their map pointers). |
| 838 // | 838 // |
| 839 // 31 21 20 10 9 0 | 839 // The excact encoding is described in the comments for class MapWord in |
| 840 // +-----------------+------------------+-----------------+ | 840 // objects.h. |
| 841 // |forwarding offset|page offset of map|page index of map| | |
| 842 // +-----------------+------------------+-----------------+ | |
| 843 // 11 bits 11 bits 10 bits | |
| 844 // | 841 // |
| 845 // An address range [start, end) can have both live and non-live objects. | 842 // An address range [start, end) can have both live and non-live objects. |
| 846 // Maximal non-live regions are marked so they can be skipped on subsequent | 843 // Maximal non-live regions are marked so they can be skipped on subsequent |
| 847 // sweeps of the heap. A distinguished map-pointer encoding is used to mark | 844 // sweeps of the heap. A distinguished map-pointer encoding is used to mark |
| 848 // free regions of one-word size (in which case the next word is the start | 845 // free regions of one-word size (in which case the next word is the start |
| 849 // of a live object). A second distinguished map-pointer encoding is used | 846 // of a live object). A second distinguished map-pointer encoding is used |
| 850 // to mark free regions larger than one word, and the size of the free | 847 // to mark free regions larger than one word, and the size of the free |
| 851 // region (including the first word) is written to the second word of the | 848 // region (including the first word) is written to the second word of the |
| 852 // region. | 849 // region. |
| 853 // | 850 // |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1757 | 1754 |
| 1758 void MarkCompactCollector::RebuildRSets() { | 1755 void MarkCompactCollector::RebuildRSets() { |
| 1759 #ifdef DEBUG | 1756 #ifdef DEBUG |
| 1760 ASSERT(state_ == RELOCATE_OBJECTS); | 1757 ASSERT(state_ == RELOCATE_OBJECTS); |
| 1761 state_ = REBUILD_RSETS; | 1758 state_ = REBUILD_RSETS; |
| 1762 #endif | 1759 #endif |
| 1763 Heap::RebuildRSets(); | 1760 Heap::RebuildRSets(); |
| 1764 } | 1761 } |
| 1765 | 1762 |
| 1766 } } // namespace v8::internal | 1763 } } // namespace v8::internal |
| OLD | NEW |