| 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 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2774 } | 2774 } |
| 2775 #endif | 2775 #endif |
| 2776 | 2776 |
| 2777 | 2777 |
| 2778 // ----------------------------------------------------------------------------- | 2778 // ----------------------------------------------------------------------------- |
| 2779 // MapSpace implementation | 2779 // MapSpace implementation |
| 2780 | 2780 |
| 2781 void MapSpace::PrepareForMarkCompact(bool will_compact) { | 2781 void MapSpace::PrepareForMarkCompact(bool will_compact) { |
| 2782 // Call prepare of the super class. | 2782 // Call prepare of the super class. |
| 2783 FixedSpace::PrepareForMarkCompact(will_compact); | 2783 FixedSpace::PrepareForMarkCompact(will_compact); |
| 2784 | |
| 2785 if (will_compact) { | |
| 2786 // Initialize map index entry. | |
| 2787 int page_count = 0; | |
| 2788 PageIterator it(this, PageIterator::ALL_PAGES); | |
| 2789 while (it.has_next()) { | |
| 2790 ASSERT_MAP_PAGE_INDEX(page_count); | |
| 2791 | |
| 2792 Page* p = it.next(); | |
| 2793 ASSERT(p->mc_page_index == page_count); | |
| 2794 | |
| 2795 page_addresses_[page_count++] = p->address(); | |
| 2796 } | |
| 2797 } | |
| 2798 } | 2784 } |
| 2799 | 2785 |
| 2800 | 2786 |
| 2801 #ifdef DEBUG | 2787 #ifdef DEBUG |
| 2802 void MapSpace::VerifyObject(HeapObject* object) { | 2788 void MapSpace::VerifyObject(HeapObject* object) { |
| 2803 // The object should be a map or a free-list node. | 2789 // The object should be a map or a free-list node. |
| 2804 ASSERT(object->IsMap() || object->IsByteArray()); | 2790 ASSERT(object->IsMap() || object->IsByteArray()); |
| 2805 } | 2791 } |
| 2806 #endif | 2792 #endif |
| 2807 | 2793 |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3245 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { | 3231 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { |
| 3246 if (obj->IsCode()) { | 3232 if (obj->IsCode()) { |
| 3247 Code* code = Code::cast(obj); | 3233 Code* code = Code::cast(obj); |
| 3248 code_kind_statistics[code->kind()] += code->Size(); | 3234 code_kind_statistics[code->kind()] += code->Size(); |
| 3249 } | 3235 } |
| 3250 } | 3236 } |
| 3251 } | 3237 } |
| 3252 #endif // DEBUG | 3238 #endif // DEBUG |
| 3253 | 3239 |
| 3254 } } // namespace v8::internal | 3240 } } // namespace v8::internal |
| OLD | NEW |