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

Side by Side Diff: src/mark-compact.cc

Issue 8507038: Fix Heap::Shrink to ensure that it does not free pages that are still in use. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: get rid of last_unswept_page_, add comment about Heap::ReserveSpace Created 9 years, 1 month 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/heap.cc ('k') | src/spaces.h » ('j') | src/spaces.cc » ('J')
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 3529 matching lines...) Expand 10 before | Expand all | Expand 10 after
3540 } 3540 }
3541 3541
3542 switch (sweeper) { 3542 switch (sweeper) {
3543 case CONSERVATIVE: { 3543 case CONSERVATIVE: {
3544 SweepConservatively(space, p); 3544 SweepConservatively(space, p);
3545 break; 3545 break;
3546 } 3546 }
3547 case LAZY_CONSERVATIVE: { 3547 case LAZY_CONSERVATIVE: {
3548 freed_bytes += SweepConservatively(space, p); 3548 freed_bytes += SweepConservatively(space, p);
3549 if (freed_bytes >= newspace_size && p != space->LastPage()) { 3549 if (freed_bytes >= newspace_size && p != space->LastPage()) {
3550 space->SetPagesToSweep(p->next_page(), space->anchor()); 3550 space->SetPagesToSweep(p->next_page());
3551 lazy_sweeping_active = true; 3551 lazy_sweeping_active = true;
3552 } 3552 }
3553 break; 3553 break;
3554 } 3554 }
3555 case PRECISE: { 3555 case PRECISE: {
3556 if (space->identity() == CODE_SPACE) { 3556 if (space->identity() == CODE_SPACE) {
3557 SweepPrecisely<SWEEP_ONLY, REBUILD_SKIP_LIST>(space, p, NULL); 3557 SweepPrecisely<SWEEP_ONLY, REBUILD_SKIP_LIST>(space, p, NULL);
3558 } else { 3558 } else {
3559 SweepPrecisely<SWEEP_ONLY, IGNORE_SKIP_LIST>(space, p, NULL); 3559 SweepPrecisely<SWEEP_ONLY, IGNORE_SKIP_LIST>(space, p, NULL);
3560 } 3560 }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
3773 while (buffer != NULL) { 3773 while (buffer != NULL) {
3774 SlotsBuffer* next_buffer = buffer->next(); 3774 SlotsBuffer* next_buffer = buffer->next();
3775 DeallocateBuffer(buffer); 3775 DeallocateBuffer(buffer);
3776 buffer = next_buffer; 3776 buffer = next_buffer;
3777 } 3777 }
3778 *buffer_address = NULL; 3778 *buffer_address = NULL;
3779 } 3779 }
3780 3780
3781 3781
3782 } } // namespace v8::internal 3782 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/spaces.h » ('j') | src/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698