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/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
Hannes Payer (out of office) 2012/11/15 13:08:46 there are so many heuristics all over the gc...
2395 if (first_unswept_page_->is_valid()) { 2395 const int kMaxSweepingTries = 5;
2396 AdvanceSweeper(size_in_bytes); 2396 const int kAllocationSweepingFactor = 10;
2397 int i = 0;
2398
2399 for (i = 0; i < kMaxSweepingTries && first_unswept_page_->is_valid(); i++) {
2400 AdvanceSweeper(size_in_bytes * kAllocationSweepingFactor);
2397 2401
2398 // Retry the free list allocation. 2402 // Retry the free list allocation.
2399 HeapObject* object = free_list_.Allocate(size_in_bytes); 2403 HeapObject* object = free_list_.Allocate(size_in_bytes);
2400 if (object != NULL) return object; 2404 if (object != NULL) return object;
2401 } 2405 }
2402 2406
2403 // Free list allocation failed and there is no next page. Fail if we have 2407 // 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 2408 // hit the old generation size limit that should cause a garbage
2405 // collection. 2409 // collection.
2406 if (!heap()->always_allocate() && 2410 if (!heap()->always_allocate() &&
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 object->ShortPrint(); 2949 object->ShortPrint();
2946 PrintF("\n"); 2950 PrintF("\n");
2947 } 2951 }
2948 printf(" --------------------------------------\n"); 2952 printf(" --------------------------------------\n");
2949 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 2953 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
2950 } 2954 }
2951 2955
2952 #endif // DEBUG 2956 #endif // DEBUG
2953 2957
2954 } } // namespace v8::internal 2958 } } // 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