| 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 } | 881 } |
| 882 } | 882 } |
| 883 } | 883 } |
| 884 | 884 |
| 885 // ------------------------------------------------------------------------- | 885 // ------------------------------------------------------------------------- |
| 886 // Phase 2: Encode forwarding addresses. | 886 // Phase 2: Encode forwarding addresses. |
| 887 // When compacting, forwarding addresses for objects in old space and map | 887 // When compacting, forwarding addresses for objects in old space and map |
| 888 // space are encoded in their map pointer word (along with an encoding of | 888 // space are encoded in their map pointer word (along with an encoding of |
| 889 // their map pointers). | 889 // their map pointers). |
| 890 // | 890 // |
| 891 // 31 21 20 10 9 0 | 891 // The excact encoding is described in the comments for class MapWord in |
| 892 // +-----------------+------------------+-----------------+ | 892 // objects.h. |
| 893 // |forwarding offset|page offset of map|page index of map| | |
| 894 // +-----------------+------------------+-----------------+ | |
| 895 // 11 bits 11 bits 10 bits | |
| 896 // | 893 // |
| 897 // An address range [start, end) can have both live and non-live objects. | 894 // An address range [start, end) can have both live and non-live objects. |
| 898 // Maximal non-live regions are marked so they can be skipped on subsequent | 895 // Maximal non-live regions are marked so they can be skipped on subsequent |
| 899 // sweeps of the heap. A distinguished map-pointer encoding is used to mark | 896 // sweeps of the heap. A distinguished map-pointer encoding is used to mark |
| 900 // free regions of one-word size (in which case the next word is the start | 897 // free regions of one-word size (in which case the next word is the start |
| 901 // of a live object). A second distinguished map-pointer encoding is used | 898 // of a live object). A second distinguished map-pointer encoding is used |
| 902 // to mark free regions larger than one word, and the size of the free | 899 // to mark free regions larger than one word, and the size of the free |
| 903 // region (including the first word) is written to the second word of the | 900 // region (including the first word) is written to the second word of the |
| 904 // region. | 901 // region. |
| 905 // | 902 // |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1807 | 1804 |
| 1808 void MarkCompactCollector::RebuildRSets() { | 1805 void MarkCompactCollector::RebuildRSets() { |
| 1809 #ifdef DEBUG | 1806 #ifdef DEBUG |
| 1810 ASSERT(state_ == RELOCATE_OBJECTS); | 1807 ASSERT(state_ == RELOCATE_OBJECTS); |
| 1811 state_ = REBUILD_RSETS; | 1808 state_ = REBUILD_RSETS; |
| 1812 #endif | 1809 #endif |
| 1813 Heap::RebuildRSets(); | 1810 Heap::RebuildRSets(); |
| 1814 } | 1811 } |
| 1815 | 1812 |
| 1816 } } // namespace v8::internal | 1813 } } // namespace v8::internal |
| OLD | NEW |