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

Side by Side Diff: src/spaces.cc

Issue 11413009: Remove eager sweeping for lazy swept spaces. Try to find in SlowAllocateRaw a bounded number of tim… (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 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/mark-compact.cc ('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 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after
2383 2383
2384 allocation_info_.top = NULL; 2384 allocation_info_.top = NULL;
2385 allocation_info_.limit = NULL; 2385 allocation_info_.limit = NULL;
2386 } 2386 }
2387 } 2387 }
2388 2388
2389 2389
2390 HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) { 2390 HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) {
2391 // Allocation in this space has failed. 2391 // Allocation in this space has failed.
2392 2392
2393 // If there are unswept pages advance lazy sweeper then sweep one page before 2393 // If there are unswept pages advance lazy sweeper a bounded number of times
2394 // allocating a new page. 2394 // until we find a size_in_bytes contiguous piece of memory
2395 if (first_unswept_page_->is_valid()) { 2395 const int kMaxSweepingTries = 5;
2396 int i = 0;
2397
2398 for (i = 0; i < kMaxSweepingTries && first_unswept_page_->is_valid(); i++) {
2396 AdvanceSweeper(size_in_bytes); 2399 AdvanceSweeper(size_in_bytes);
2397 2400
2398 // Retry the free list allocation. 2401 // Retry the free list allocation.
2399 HeapObject* object = free_list_.Allocate(size_in_bytes); 2402 HeapObject* object = free_list_.Allocate(size_in_bytes);
2400 if (object != NULL) return object; 2403 if (object != NULL) return object;
2401 } 2404 }
2402 2405
2403 // Free list allocation failed and there is no next page. Fail if we have 2406 // Free list allocation failed and there is no next page. Fail if we have
2404 // hit the old generation size limit that should cause a garbage 2407 // hit the old generation size limit that should cause a garbage
2405 // collection. 2408 // collection.
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 object->ShortPrint(); 2948 object->ShortPrint();
2946 PrintF("\n"); 2949 PrintF("\n");
2947 } 2950 }
2948 printf(" --------------------------------------\n"); 2951 printf(" --------------------------------------\n");
2949 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 2952 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
2950 } 2953 }
2951 2954
2952 #endif // DEBUG 2955 #endif // DEBUG
2953 2956
2954 } } // namespace v8::internal 2957 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698