| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 | 67 |
| 68 HeapObjectIterator::HeapObjectIterator(Page* page, | 68 HeapObjectIterator::HeapObjectIterator(Page* page, |
| 69 HeapObjectCallback size_func) { | 69 HeapObjectCallback size_func) { |
| 70 Space* owner = page->owner(); | 70 Space* owner = page->owner(); |
| 71 ASSERT(owner == page->heap()->old_pointer_space() || | 71 ASSERT(owner == page->heap()->old_pointer_space() || |
| 72 owner == page->heap()->old_data_space() || | 72 owner == page->heap()->old_data_space() || |
| 73 owner == page->heap()->map_space() || | 73 owner == page->heap()->map_space() || |
| 74 owner == page->heap()->cell_space() || | 74 owner == page->heap()->cell_space() || |
| 75 owner == page->heap()->property_cell_space() || |
| 75 owner == page->heap()->code_space()); | 76 owner == page->heap()->code_space()); |
| 76 Initialize(reinterpret_cast<PagedSpace*>(owner), | 77 Initialize(reinterpret_cast<PagedSpace*>(owner), |
| 77 page->area_start(), | 78 page->area_start(), |
| 78 page->area_end(), | 79 page->area_end(), |
| 79 kOnePageOnly, | 80 kOnePageOnly, |
| 80 size_func); | 81 size_func); |
| 81 ASSERT(page->WasSweptPrecisely()); | 82 ASSERT(page->WasSweptPrecisely()); |
| 82 } | 83 } |
| 83 | 84 |
| 84 | 85 |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 break; | 1037 break; |
| 1037 case OLD_DATA_SPACE: | 1038 case OLD_DATA_SPACE: |
| 1038 size = 192 * KB; | 1039 size = 192 * KB; |
| 1039 break; | 1040 break; |
| 1040 case MAP_SPACE: | 1041 case MAP_SPACE: |
| 1041 size = 16 * kPointerSize * KB; | 1042 size = 16 * kPointerSize * KB; |
| 1042 break; | 1043 break; |
| 1043 case CELL_SPACE: | 1044 case CELL_SPACE: |
| 1044 size = 16 * kPointerSize * KB; | 1045 size = 16 * kPointerSize * KB; |
| 1045 break; | 1046 break; |
| 1047 case PROPERTY_CELL_SPACE: |
| 1048 size = 8 * kPointerSize * KB; |
| 1049 break; |
| 1046 case CODE_SPACE: | 1050 case CODE_SPACE: |
| 1047 if (heap()->isolate()->code_range()->exists()) { | 1051 if (heap()->isolate()->code_range()->exists()) { |
| 1048 // When code range exists, code pages are allocated in a special way | 1052 // When code range exists, code pages are allocated in a special way |
| 1049 // (from the reserved code range). That part of the code is not yet | 1053 // (from the reserved code range). That part of the code is not yet |
| 1050 // upgraded to handle small pages. | 1054 // upgraded to handle small pages. |
| 1051 size = AreaSize(); | 1055 size = AreaSize(); |
| 1052 } else { | 1056 } else { |
| 1053 size = 384 * KB; | 1057 size = 384 * KB; |
| 1054 } | 1058 } |
| 1055 break; | 1059 break; |
| (...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2827 // there is at least one non-inlined virtual function. I would prefer to hide | 2831 // there is at least one non-inlined virtual function. I would prefer to hide |
| 2828 // the VerifyObject definition behind VERIFY_HEAP. | 2832 // the VerifyObject definition behind VERIFY_HEAP. |
| 2829 | 2833 |
| 2830 void MapSpace::VerifyObject(HeapObject* object) { | 2834 void MapSpace::VerifyObject(HeapObject* object) { |
| 2831 // The object should be a map or a free-list node. | 2835 // The object should be a map or a free-list node. |
| 2832 CHECK(object->IsMap() || object->IsFreeSpace()); | 2836 CHECK(object->IsMap() || object->IsFreeSpace()); |
| 2833 } | 2837 } |
| 2834 | 2838 |
| 2835 | 2839 |
| 2836 // ----------------------------------------------------------------------------- | 2840 // ----------------------------------------------------------------------------- |
| 2837 // GlobalPropertyCellSpace implementation | 2841 // CellSpace and PropertyCellSpace implementation |
| 2838 // TODO(mvstanton): this is weird...the compiler can't make a vtable unless | 2842 // TODO(mvstanton): this is weird...the compiler can't make a vtable unless |
| 2839 // there is at least one non-inlined virtual function. I would prefer to hide | 2843 // there is at least one non-inlined virtual function. I would prefer to hide |
| 2840 // the VerifyObject definition behind VERIFY_HEAP. | 2844 // the VerifyObject definition behind VERIFY_HEAP. |
| 2841 | 2845 |
| 2842 void CellSpace::VerifyObject(HeapObject* object) { | 2846 void CellSpace::VerifyObject(HeapObject* object) { |
| 2843 // The object should be a global object property cell or a free-list node. | 2847 // The object should be a global object property cell or a free-list node. |
| 2848 CHECK(object->IsCell() || |
| 2849 object->map() == heap()->two_pointer_filler_map()); |
| 2850 } |
| 2851 |
| 2852 |
| 2853 void PropertyCellSpace::VerifyObject(HeapObject* object) { |
| 2854 // The object should be a global object property cell or a free-list node. |
| 2844 CHECK(object->IsJSGlobalPropertyCell() || | 2855 CHECK(object->IsJSGlobalPropertyCell() || |
| 2845 object->map() == heap()->two_pointer_filler_map()); | 2856 object->map() == heap()->two_pointer_filler_map()); |
| 2846 } | 2857 } |
| 2847 | 2858 |
| 2848 | 2859 |
| 2849 // ----------------------------------------------------------------------------- | 2860 // ----------------------------------------------------------------------------- |
| 2850 // LargeObjectIterator | 2861 // LargeObjectIterator |
| 2851 | 2862 |
| 2852 LargeObjectIterator::LargeObjectIterator(LargeObjectSpace* space) { | 2863 LargeObjectIterator::LargeObjectIterator(LargeObjectSpace* space) { |
| 2853 current_ = space->first_page_; | 2864 current_ = space->first_page_; |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3178 object->ShortPrint(); | 3189 object->ShortPrint(); |
| 3179 PrintF("\n"); | 3190 PrintF("\n"); |
| 3180 } | 3191 } |
| 3181 printf(" --------------------------------------\n"); | 3192 printf(" --------------------------------------\n"); |
| 3182 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3193 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3183 } | 3194 } |
| 3184 | 3195 |
| 3185 #endif // DEBUG | 3196 #endif // DEBUG |
| 3186 | 3197 |
| 3187 } } // namespace v8::internal | 3198 } } // namespace v8::internal |
| OLD | NEW |