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

Side by Side Diff: src/heap.cc

Issue 7302003: Support slots recording for compaction during incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: fix presubmit, remove last debug check Created 9 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 | « src/assembler.cc ('k') | src/ia32/assembler-ia32-inl.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 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 4286 matching lines...) Expand 10 before | Expand all | Expand 10 after
4297 Address end, 4297 Address end,
4298 ObjectSlotCallback callback) { 4298 ObjectSlotCallback callback) {
4299 Address slot_address = start; 4299 Address slot_address = start;
4300 while (slot_address < end) { 4300 while (slot_address < end) {
4301 Object** slot = reinterpret_cast<Object**>(slot_address); 4301 Object** slot = reinterpret_cast<Object**>(slot_address);
4302 Object* object = *slot; 4302 Object* object = *slot;
4303 // If the store buffer becomes overfull we mark pages as being exempt from 4303 // If the store buffer becomes overfull we mark pages as being exempt from
4304 // the store buffer. These pages are scanned to find pointers that point 4304 // the store buffer. These pages are scanned to find pointers that point
4305 // to the new space. In that case we may hit newly promoted objects and 4305 // to the new space. In that case we may hit newly promoted objects and
4306 // fix the pointers before the promotion queue gets to them. Thus the 'if'. 4306 // fix the pointers before the promotion queue gets to them. Thus the 'if'.
4307 if (Heap::InFromSpace(object)) { 4307 if (object->IsHeapObject()) {
4308 callback(reinterpret_cast<HeapObject**>(slot), HeapObject::cast(object)); 4308 if (Heap::InFromSpace(object)) {
4309 if (InNewSpace(*slot)) { 4309 callback(reinterpret_cast<HeapObject**>(slot),
4310 ASSERT(Heap::InToSpace(*slot)); 4310 HeapObject::cast(object));
4311 ASSERT((*slot)->IsHeapObject()); 4311 Object* new_object = *slot;
4312 store_buffer_.EnterDirectlyIntoStoreBuffer( 4312 if (InNewSpace(new_object)) {
4313 reinterpret_cast<Address>(slot)); 4313 ASSERT(Heap::InToSpace(new_object));
4314 ASSERT(new_object->IsHeapObject());
4315 store_buffer_.EnterDirectlyIntoStoreBuffer(
4316 reinterpret_cast<Address>(slot));
4317 }
4318 ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(new_object));
4319 } else if (MarkCompactCollector::IsOnEvacuationCandidate(object)) {
4320 // We are not collecting slots on new space objects during mutation
4321 // thus we have to scan for pointers to evacuation candidates when we
4322 // promote objects.
4323 mark_compact_collector()->RecordSlot(slot, slot, object);
4314 } 4324 }
4315 } 4325 }
4316 slot_address += kPointerSize; 4326 slot_address += kPointerSize;
4317 } 4327 }
4318 } 4328 }
4319 4329
4320 4330
4321 #ifdef DEBUG 4331 #ifdef DEBUG
4322 typedef bool (*CheckStoreBufferFilter)(Object** addr); 4332 typedef bool (*CheckStoreBufferFilter)(Object** addr);
4323 4333
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after
5847 } 5857 }
5848 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); 5858 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED);
5849 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { 5859 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) {
5850 next = chunk->next_chunk(); 5860 next = chunk->next_chunk();
5851 isolate_->memory_allocator()->Free(chunk); 5861 isolate_->memory_allocator()->Free(chunk);
5852 } 5862 }
5853 chunks_queued_for_free_ = NULL; 5863 chunks_queued_for_free_ = NULL;
5854 } 5864 }
5855 5865
5856 } } // namespace v8::internal 5866 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/ia32/assembler-ia32-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698