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 2912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2923 } | 2923 } |
2924 allocation = new_space->AllocateRaw(size); | 2924 allocation = new_space->AllocateRaw(size); |
2925 ASSERT(!allocation->IsFailure()); | 2925 ASSERT(!allocation->IsFailure()); |
2926 } | 2926 } |
2927 Object* target = allocation->ToObjectUnchecked(); | 2927 Object* target = allocation->ToObjectUnchecked(); |
2928 | 2928 |
2929 MigrateObject(HeapObject::cast(target)->address(), | 2929 MigrateObject(HeapObject::cast(target)->address(), |
2930 object->address(), | 2930 object->address(), |
2931 size, | 2931 size, |
2932 NEW_SPACE); | 2932 NEW_SPACE); |
2933 } else { | |
2934 // Mark dead objects in the new space with null in their map field. | |
2935 Memory::Address_at(object->address()) = NULL; | |
2936 } | 2933 } |
2937 } | 2934 } |
2938 | 2935 |
2939 heap_->IncrementYoungSurvivorsCounter(survivors_size); | 2936 heap_->IncrementYoungSurvivorsCounter(survivors_size); |
2940 new_space->set_age_mark(new_space->top()); | 2937 new_space->set_age_mark(new_space->top()); |
2941 } | 2938 } |
2942 | 2939 |
2943 | 2940 |
2944 void MarkCompactCollector::EvacuateLiveObjectsFromPage(Page* p) { | 2941 void MarkCompactCollector::EvacuateLiveObjectsFromPage(Page* p) { |
2945 AlwaysAllocateScope always_allocate; | 2942 AlwaysAllocateScope always_allocate; |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3347 GCTracer::Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS); | 3344 GCTracer::Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS); |
3348 // Update roots. | 3345 // Update roots. |
3349 heap_->IterateRoots(&updating_visitor, VISIT_ALL_IN_SWEEP_NEWSPACE); | 3346 heap_->IterateRoots(&updating_visitor, VISIT_ALL_IN_SWEEP_NEWSPACE); |
3350 } | 3347 } |
3351 | 3348 |
3352 { GCTracer::Scope gc_scope(tracer_, | 3349 { GCTracer::Scope gc_scope(tracer_, |
3353 GCTracer::Scope::MC_UPDATE_OLD_TO_NEW_POINTERS); | 3350 GCTracer::Scope::MC_UPDATE_OLD_TO_NEW_POINTERS); |
3354 StoreBufferRebuildScope scope(heap_, | 3351 StoreBufferRebuildScope scope(heap_, |
3355 heap_->store_buffer(), | 3352 heap_->store_buffer(), |
3356 &Heap::ScavengeStoreBufferCallback); | 3353 &Heap::ScavengeStoreBufferCallback); |
3357 heap_->store_buffer()->IteratePointersToNewSpace(&UpdatePointer); | 3354 heap_->store_buffer()->IteratePointersToNewSpace(&UpdatePointer, true); |
3358 } | 3355 } |
3359 | 3356 |
3360 { GCTracer::Scope gc_scope(tracer_, | 3357 { GCTracer::Scope gc_scope(tracer_, |
3361 GCTracer::Scope::MC_UPDATE_POINTERS_TO_EVACUATED); | 3358 GCTracer::Scope::MC_UPDATE_POINTERS_TO_EVACUATED); |
3362 SlotsBuffer::UpdateSlotsRecordedIn(heap_, | 3359 SlotsBuffer::UpdateSlotsRecordedIn(heap_, |
3363 migration_slots_buffer_, | 3360 migration_slots_buffer_, |
3364 code_slots_filtering_required); | 3361 code_slots_filtering_required); |
3365 if (FLAG_trace_fragmentation) { | 3362 if (FLAG_trace_fragmentation) { |
3366 PrintF(" migration slots buffer: %d\n", | 3363 PrintF(" migration slots buffer: %d\n", |
3367 SlotsBuffer::SizeOfChain(migration_slots_buffer_)); | 3364 SlotsBuffer::SizeOfChain(migration_slots_buffer_)); |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4331 while (buffer != NULL) { | 4328 while (buffer != NULL) { |
4332 SlotsBuffer* next_buffer = buffer->next(); | 4329 SlotsBuffer* next_buffer = buffer->next(); |
4333 DeallocateBuffer(buffer); | 4330 DeallocateBuffer(buffer); |
4334 buffer = next_buffer; | 4331 buffer = next_buffer; |
4335 } | 4332 } |
4336 *buffer_address = NULL; | 4333 *buffer_address = NULL; |
4337 } | 4334 } |
4338 | 4335 |
4339 | 4336 |
4340 } } // namespace v8::internal | 4337 } } // namespace v8::internal |
OLD | NEW |