Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Side by Side Diff: src/spaces.cc

Issue 12378071: Fix assert in PagedSpace::SizeOfObject for concurrent sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(!heap()->IsSweepingComplete() || (unswept_free_bytes_ == 0));
2481 return Size() - unswept_free_bytes_ - (limit() - top());
2482 }
2483
2484
2479 // After we have booted, we have created a map which represents free space 2485 // 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 2486 // 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 2487 // were created with the wrong FreeSpaceMap (normally NULL), so we need to
2482 // fix them. 2488 // fix them.
2483 void PagedSpace::RepairFreeListsAfterBoot() { 2489 void PagedSpace::RepairFreeListsAfterBoot() {
2484 free_list_.RepairLists(heap()); 2490 free_list_.RepairLists(heap());
2485 } 2491 }
2486 2492
2487 2493
2488 // You have to call this last, since the implementation from PagedSpace 2494 // You have to call this last, since the implementation from PagedSpace
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
3122 object->ShortPrint(); 3128 object->ShortPrint();
3123 PrintF("\n"); 3129 PrintF("\n");
3124 } 3130 }
3125 printf(" --------------------------------------\n"); 3131 printf(" --------------------------------------\n");
3126 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3132 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3127 } 3133 }
3128 3134
3129 #endif // DEBUG 3135 #endif // DEBUG
3130 3136
3131 } } // namespace v8::internal 3137 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698