Chromium Code Reviews| 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 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2469 // Mark the old linear allocation area with a free space so it can be | 2469 // Mark the old linear allocation area with a free space so it can be |
| 2470 // skipped when scanning the heap. This also puts it back in the free list | 2470 // skipped when scanning the heap. This also puts it back in the free list |
| 2471 // if it is big enough. | 2471 // if it is big enough. |
| 2472 Free(top(), old_linear_size); | 2472 Free(top(), old_linear_size); |
| 2473 | 2473 |
| 2474 SetTop(new_area->address(), new_area->address() + size_in_bytes); | 2474 SetTop(new_area->address(), new_area->address() + size_in_bytes); |
| 2475 return true; | 2475 return true; |
| 2476 } | 2476 } |
| 2477 | 2477 |
| 2478 | 2478 |
| 2479 intptr_t PagedSpace::SizeOfObjects() { | |
| 2480 ASSERT(!IsLazySweepingComplete() || (unswept_free_bytes_ == 0) || | |
| 2481 heap()->mark_compact_collector()->IsConcurrentSweepingInProgress()); | |
|
Michael Starzinger
2013/03/04 15:26:29
Better use the following assertion ...
ASSERT(hea
Hannes Payer (out of office)
2013/03/04 15:47:41
Done.
I changed the ASSERT as suggested, but now
| |
| 2482 return Size() - unswept_free_bytes_ - (limit() - top()); | |
| 2483 } | |
| 2484 | |
| 2485 | |
| 2479 // After we have booted, we have created a map which represents free space | 2486 // After we have booted, we have created a map which represents free space |
| 2480 // on the heap. If there was already a free list then the elements on it | 2487 // on the heap. If there was already a free list then the elements on it |
| 2481 // were created with the wrong FreeSpaceMap (normally NULL), so we need to | 2488 // were created with the wrong FreeSpaceMap (normally NULL), so we need to |
| 2482 // fix them. | 2489 // fix them. |
| 2483 void PagedSpace::RepairFreeListsAfterBoot() { | 2490 void PagedSpace::RepairFreeListsAfterBoot() { |
| 2484 free_list_.RepairLists(heap()); | 2491 free_list_.RepairLists(heap()); |
| 2485 } | 2492 } |
| 2486 | 2493 |
| 2487 | 2494 |
| 2488 // You have to call this last, since the implementation from PagedSpace | 2495 // You have to call this last, since the implementation from PagedSpace |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3122 object->ShortPrint(); | 3129 object->ShortPrint(); |
| 3123 PrintF("\n"); | 3130 PrintF("\n"); |
| 3124 } | 3131 } |
| 3125 printf(" --------------------------------------\n"); | 3132 printf(" --------------------------------------\n"); |
| 3126 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3133 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3127 } | 3134 } |
| 3128 | 3135 |
| 3129 #endif // DEBUG | 3136 #endif // DEBUG |
| 3130 | 3137 |
| 3131 } } // namespace v8::internal | 3138 } } // namespace v8::internal |
| OLD | NEW |