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

Side by Side Diff: src/mark-compact.cc

Issue 18998004: Implemented lazy sweeping of new space. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | « no previous file | src/store-buffer.h » ('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 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
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
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()->IteratePointersToNewSpaceAndClearMaps(
3355 &UpdatePointer);
3358 } 3356 }
3359 3357
3360 { GCTracer::Scope gc_scope(tracer_, 3358 { GCTracer::Scope gc_scope(tracer_,
3361 GCTracer::Scope::MC_UPDATE_POINTERS_TO_EVACUATED); 3359 GCTracer::Scope::MC_UPDATE_POINTERS_TO_EVACUATED);
3362 SlotsBuffer::UpdateSlotsRecordedIn(heap_, 3360 SlotsBuffer::UpdateSlotsRecordedIn(heap_,
3363 migration_slots_buffer_, 3361 migration_slots_buffer_,
3364 code_slots_filtering_required); 3362 code_slots_filtering_required);
3365 if (FLAG_trace_fragmentation) { 3363 if (FLAG_trace_fragmentation) {
3366 PrintF(" migration slots buffer: %d\n", 3364 PrintF(" migration slots buffer: %d\n",
3367 SlotsBuffer::SizeOfChain(migration_slots_buffer_)); 3365 SlotsBuffer::SizeOfChain(migration_slots_buffer_));
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
4331 while (buffer != NULL) { 4329 while (buffer != NULL) {
4332 SlotsBuffer* next_buffer = buffer->next(); 4330 SlotsBuffer* next_buffer = buffer->next();
4333 DeallocateBuffer(buffer); 4331 DeallocateBuffer(buffer);
4334 buffer = next_buffer; 4332 buffer = next_buffer;
4335 } 4333 }
4336 *buffer_address = NULL; 4334 *buffer_address = NULL;
4337 } 4335 }
4338 4336
4339 4337
4340 } } // namespace v8::internal 4338 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/store-buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698