OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3378 | 3378 |
3379 void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { | 3379 void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { |
3380 Heap::RelocationLock relocation_lock(heap()); | 3380 Heap::RelocationLock relocation_lock(heap()); |
3381 | 3381 |
3382 bool code_slots_filtering_required; | 3382 bool code_slots_filtering_required; |
3383 { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP_NEWSPACE); | 3383 { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP_NEWSPACE); |
3384 code_slots_filtering_required = MarkInvalidatedCode(); | 3384 code_slots_filtering_required = MarkInvalidatedCode(); |
3385 EvacuateNewSpace(); | 3385 EvacuateNewSpace(); |
3386 } | 3386 } |
3387 | 3387 |
3388 // We have to travers our allocation sites scratchpad which contains raw | |
3389 // pointers before we move objects. During new space evacauation we | |
3390 // gathered pretenuring statistics. The found allocation sites may not be | |
3391 // valid after compacting old space. | |
3392 heap()->ProcessPretenuringFeedback(); | |
3393 | |
3394 | |
3395 { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_EVACUATE_PAGES); | 3388 { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_EVACUATE_PAGES); |
3396 EvacuatePages(); | 3389 EvacuatePages(); |
3397 } | 3390 } |
3398 | 3391 |
3399 // Second pass: find pointers to new space and update them. | 3392 // Second pass: find pointers to new space and update them. |
3400 PointersUpdatingVisitor updating_visitor(heap()); | 3393 PointersUpdatingVisitor updating_visitor(heap()); |
3401 | 3394 |
3402 { GCTracer::Scope gc_scope(tracer_, | 3395 { GCTracer::Scope gc_scope(tracer_, |
3403 GCTracer::Scope::MC_UPDATE_NEW_TO_NEW_POINTERS); | 3396 GCTracer::Scope::MC_UPDATE_NEW_TO_NEW_POINTERS); |
3404 // Update pointers in to space. | 3397 // Update pointers in to space. |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4396 while (buffer != NULL) { | 4389 while (buffer != NULL) { |
4397 SlotsBuffer* next_buffer = buffer->next(); | 4390 SlotsBuffer* next_buffer = buffer->next(); |
4398 DeallocateBuffer(buffer); | 4391 DeallocateBuffer(buffer); |
4399 buffer = next_buffer; | 4392 buffer = next_buffer; |
4400 } | 4393 } |
4401 *buffer_address = NULL; | 4394 *buffer_address = NULL; |
4402 } | 4395 } |
4403 | 4396 |
4404 | 4397 |
4405 } } // namespace v8::internal | 4398 } } // namespace v8::internal |
OLD | NEW |