OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |