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

Side by Side Diff: src/spaces.cc

Issue 9965054: Make progress in incremental marking if scavenge is delaying mark-sweep. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comment Created 8 years, 8 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/incremental-marking.cc ('k') | test/cctest/test-heap.cc » ('j') | 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 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 Address old_top = allocation_info_.top; 1227 Address old_top = allocation_info_.top;
1228 Address new_top = old_top + size_in_bytes; 1228 Address new_top = old_top + size_in_bytes;
1229 Address high = to_space_.page_high(); 1229 Address high = to_space_.page_high();
1230 if (allocation_info_.limit < high) { 1230 if (allocation_info_.limit < high) {
1231 // Incremental marking has lowered the limit to get a 1231 // Incremental marking has lowered the limit to get a
1232 // chance to do a step. 1232 // chance to do a step.
1233 allocation_info_.limit = Min( 1233 allocation_info_.limit = Min(
1234 allocation_info_.limit + inline_allocation_limit_step_, 1234 allocation_info_.limit + inline_allocation_limit_step_,
1235 high); 1235 high);
1236 int bytes_allocated = static_cast<int>(new_top - top_on_previous_step_); 1236 int bytes_allocated = static_cast<int>(new_top - top_on_previous_step_);
1237 heap()->incremental_marking()->Step(bytes_allocated); 1237 heap()->incremental_marking()->Step(
1238 bytes_allocated, IncrementalMarking::GC_VIA_STACK_GUARD);
1238 top_on_previous_step_ = new_top; 1239 top_on_previous_step_ = new_top;
1239 return AllocateRaw(size_in_bytes); 1240 return AllocateRaw(size_in_bytes);
1240 } else if (AddFreshPage()) { 1241 } else if (AddFreshPage()) {
1241 // Switched to new page. Try allocating again. 1242 // Switched to new page. Try allocating again.
1242 int bytes_allocated = static_cast<int>(old_top - top_on_previous_step_); 1243 int bytes_allocated = static_cast<int>(old_top - top_on_previous_step_);
1243 heap()->incremental_marking()->Step(bytes_allocated); 1244 heap()->incremental_marking()->Step(
1245 bytes_allocated, IncrementalMarking::GC_VIA_STACK_GUARD);
1244 top_on_previous_step_ = to_space_.page_low(); 1246 top_on_previous_step_ = to_space_.page_low();
1245 return AllocateRaw(size_in_bytes); 1247 return AllocateRaw(size_in_bytes);
1246 } else { 1248 } else {
1247 return Failure::RetryAfterGC(); 1249 return Failure::RetryAfterGC();
1248 } 1250 }
1249 } 1251 }
1250 1252
1251 1253
1252 #ifdef DEBUG 1254 #ifdef DEBUG
1253 // We do not use the SemiSpaceIterator because verification doesn't assume 1255 // We do not use the SemiSpaceIterator because verification doesn't assume
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after
2850 object->ShortPrint(); 2852 object->ShortPrint();
2851 PrintF("\n"); 2853 PrintF("\n");
2852 } 2854 }
2853 printf(" --------------------------------------\n"); 2855 printf(" --------------------------------------\n");
2854 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 2856 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
2855 } 2857 }
2856 2858
2857 #endif // DEBUG 2859 #endif // DEBUG
2858 2860
2859 } } // namespace v8::internal 2861 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/incremental-marking.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698