| 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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 Address old_top = allocation_info_.top; | 1191 Address old_top = allocation_info_.top; |
| 1192 Address new_top = old_top + size_in_bytes; | 1192 Address new_top = old_top + size_in_bytes; |
| 1193 Address high = to_space_.page_high(); | 1193 Address high = to_space_.page_high(); |
| 1194 if (allocation_info_.limit < high) { | 1194 if (allocation_info_.limit < high) { |
| 1195 // Incremental marking has lowered the limit to get a | 1195 // Incremental marking has lowered the limit to get a |
| 1196 // chance to do a step. | 1196 // chance to do a step. |
| 1197 allocation_info_.limit = Min( | 1197 allocation_info_.limit = Min( |
| 1198 allocation_info_.limit + inline_allocation_limit_step_, | 1198 allocation_info_.limit + inline_allocation_limit_step_, |
| 1199 high); | 1199 high); |
| 1200 int bytes_allocated = static_cast<int>(new_top - top_on_previous_step_); | 1200 int bytes_allocated = static_cast<int>(new_top - top_on_previous_step_); |
| 1201 heap()->incremental_marking()->Step(bytes_allocated); | 1201 heap()->incremental_marking()->Step( |
| 1202 bytes_allocated, IncrementalMarking::GC_VIA_STACK_GUARD); |
| 1202 top_on_previous_step_ = new_top; | 1203 top_on_previous_step_ = new_top; |
| 1203 return AllocateRaw(size_in_bytes); | 1204 return AllocateRaw(size_in_bytes); |
| 1204 } else if (AddFreshPage()) { | 1205 } else if (AddFreshPage()) { |
| 1205 // Switched to new page. Try allocating again. | 1206 // Switched to new page. Try allocating again. |
| 1206 int bytes_allocated = static_cast<int>(old_top - top_on_previous_step_); | 1207 int bytes_allocated = static_cast<int>(old_top - top_on_previous_step_); |
| 1207 heap()->incremental_marking()->Step(bytes_allocated); | 1208 heap()->incremental_marking()->Step( |
| 1209 bytes_allocated, IncrementalMarking::GC_VIA_STACK_GUARD); |
| 1208 top_on_previous_step_ = to_space_.page_low(); | 1210 top_on_previous_step_ = to_space_.page_low(); |
| 1209 return AllocateRaw(size_in_bytes); | 1211 return AllocateRaw(size_in_bytes); |
| 1210 } else { | 1212 } else { |
| 1211 return Failure::RetryAfterGC(); | 1213 return Failure::RetryAfterGC(); |
| 1212 } | 1214 } |
| 1213 } | 1215 } |
| 1214 | 1216 |
| 1215 | 1217 |
| 1216 #ifdef DEBUG | 1218 #ifdef DEBUG |
| 1217 // We do not use the SemiSpaceIterator because verification doesn't assume | 1219 // We do not use the SemiSpaceIterator because verification doesn't assume |
| (...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2814 object->ShortPrint(); | 2816 object->ShortPrint(); |
| 2815 PrintF("\n"); | 2817 PrintF("\n"); |
| 2816 } | 2818 } |
| 2817 printf(" --------------------------------------\n"); | 2819 printf(" --------------------------------------\n"); |
| 2818 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 2820 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 2819 } | 2821 } |
| 2820 | 2822 |
| 2821 #endif // DEBUG | 2823 #endif // DEBUG |
| 2822 | 2824 |
| 2823 } } // namespace v8::internal | 2825 } } // namespace v8::internal |
| OLD | NEW |