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

Side by Side Diff: src/heap.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 | « no previous file | src/mark-compact.cc » ('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 5591 matching lines...) Expand 10 before | Expand all | Expand 10 after
5602 #ifdef DEBUG 5602 #ifdef DEBUG
5603 delete debug_utils_; 5603 delete debug_utils_;
5604 debug_utils_ = NULL; 5604 debug_utils_ = NULL;
5605 #endif 5605 #endif
5606 } 5606 }
5607 5607
5608 5608
5609 void Heap::Shrink() { 5609 void Heap::Shrink() {
5610 // Try to shrink all paged spaces. 5610 // Try to shrink all paged spaces.
5611 PagedSpaces spaces; 5611 PagedSpaces spaces;
5612 for (PagedSpace* space = spaces.next(); space != NULL; space = spaces.next()) 5612 for (PagedSpace* space = spaces.next();
5613 space != NULL;
5614 space = spaces.next()) {
5613 space->ReleaseAllUnusedPages(); 5615 space->ReleaseAllUnusedPages();
5616 }
5614 } 5617 }
5615 5618
5616 5619
5617 void Heap::AddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type) { 5620 void Heap::AddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type) {
5618 ASSERT(callback != NULL); 5621 ASSERT(callback != NULL);
5619 GCPrologueCallbackPair pair(callback, gc_type); 5622 GCPrologueCallbackPair pair(callback, gc_type);
5620 ASSERT(!gc_prologue_callbacks_.Contains(pair)); 5623 ASSERT(!gc_prologue_callbacks_.Contains(pair));
5621 return gc_prologue_callbacks_.Add(pair); 5624 return gc_prologue_callbacks_.Add(pair);
5622 } 5625 }
5623 5626
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
6452 isolate_->heap()->store_buffer()->Compact(); 6455 isolate_->heap()->store_buffer()->Compact();
6453 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); 6456 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED);
6454 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { 6457 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) {
6455 next = chunk->next_chunk(); 6458 next = chunk->next_chunk();
6456 isolate_->memory_allocator()->Free(chunk); 6459 isolate_->memory_allocator()->Free(chunk);
6457 } 6460 }
6458 chunks_queued_for_free_ = NULL; 6461 chunks_queued_for_free_ = NULL;
6459 } 6462 }
6460 6463
6461 } } // namespace v8::internal 6464 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | src/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698