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

Side by Side Diff: src/heap-inl.h

Issue 6250076: Start using store buffers. Handle store buffer overflow situation.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 10 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
OLDNEW
1 // Copyright 2006-2010 the V8 project authors. All rights reserved. 1 // Copyright 2006-2010 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 334
335 void Heap::CopyBlockToOldSpaceAndUpdateWriteBarrier(Address dst, 335 void Heap::CopyBlockToOldSpaceAndUpdateWriteBarrier(Address dst,
336 Address src, 336 Address src,
337 int byte_size) { 337 int byte_size) {
338 ASSERT(IsAligned(byte_size, kPointerSize)); 338 ASSERT(IsAligned(byte_size, kPointerSize));
339 339
340 for (int remaining = byte_size / kPointerSize; 340 for (int remaining = byte_size / kPointerSize;
341 remaining > 0; 341 remaining > 0;
342 remaining--) { 342 remaining--) {
343 Memory::Object_at(dst) = Memory::Object_at(src); 343 Object* data = Memory::Object_at(src);
344 Memory::Object_at(dst) = data;
Vyacheslav Egorov (Chromium) 2011/02/02 13:15:47 revert please
Erik Corry 2011/02/03 13:21:17 Done.
344 345
345 if (Heap::InNewSpace(Memory::Object_at(dst))) { 346 if (Heap::InNewSpace(Memory::Object_at(dst))) {
346 StoreBuffer::Mark(dst); 347 StoreBuffer::Mark(dst);
347 } 348 }
348 349
349 dst += kPointerSize; 350 dst += kPointerSize;
350 src += kPointerSize; 351 src += kPointerSize;
351 } 352 }
352 } 353 }
353 354
(...skipping 26 matching lines...) Expand all
380 381
381 // We use the first word (where the map pointer usually is) of a heap 382 // We use the first word (where the map pointer usually is) of a heap
382 // object to record the forwarding pointer. A forwarding pointer can 383 // object to record the forwarding pointer. A forwarding pointer can
383 // point to an old space, the code space, or the to space of the new 384 // point to an old space, the code space, or the to space of the new
384 // generation. 385 // generation.
385 MapWord first_word = object->map_word(); 386 MapWord first_word = object->map_word();
386 387
387 // If the first word is a forwarding address, the object has already been 388 // If the first word is a forwarding address, the object has already been
388 // copied. 389 // copied.
389 if (first_word.IsForwardingAddress()) { 390 if (first_word.IsForwardingAddress()) {
390 *p = first_word.ToForwardingAddress(); 391 HeapObject* dest = first_word.ToForwardingAddress();
392 *p = dest;
393 Address cell = reinterpret_cast<Address>(p);
Vyacheslav Egorov (Chromium) 2011/02/02 13:15:47 cell is a bit confusing cause we have cell_space a
Erik Corry 2011/02/03 13:21:17 Done.
394 if (Heap::InNewSpace(dest) && !Heap::InNewSpace(cell)) {
395 StoreBuffer::EnterDirectlyIntoStoreBuffer(cell);
396 }
391 return; 397 return;
392 } 398 }
393 399
394 // Call the slow part of scavenge object. 400 // Call the slow part of scavenge object.
395 return ScavengeObjectSlow(p, object); 401 return ScavengeObjectSlow(p, object);
396 } 402 }
397 403
398 404
399 bool Heap::CollectGarbage(AllocationSpace space) { 405 bool Heap::CollectGarbage(AllocationSpace space) {
400 return CollectGarbage(space, SelectGarbageCollector(space)); 406 return CollectGarbage(space, SelectGarbageCollector(space));
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 576
571 577
572 void ExternalStringTable::ShrinkNewStrings(int position) { 578 void ExternalStringTable::ShrinkNewStrings(int position) {
573 new_space_strings_.Rewind(position); 579 new_space_strings_.Rewind(position);
574 Verify(); 580 Verify();
575 } 581 }
576 582
577 } } // namespace v8::internal 583 } } // namespace v8::internal
578 584
579 #endif // V8_HEAP_INL_H_ 585 #endif // V8_HEAP_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698