| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
| 10 #include "src/counters.h" | 10 #include "src/counters.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 } | 392 } |
| 393 | 393 |
| 394 | 394 |
| 395 void StoreBuffer::IteratePointersInStoreBuffer(ObjectSlotCallback slot_callback, | 395 void StoreBuffer::IteratePointersInStoreBuffer(ObjectSlotCallback slot_callback, |
| 396 bool clear_maps) { | 396 bool clear_maps) { |
| 397 Address* limit = old_top_; | 397 Address* limit = old_top_; |
| 398 old_top_ = old_start_; | 398 old_top_ = old_start_; |
| 399 { | 399 { |
| 400 DontMoveStoreBufferEntriesScope scope(this); | 400 DontMoveStoreBufferEntriesScope scope(this); |
| 401 for (Address* current = old_start_; current < limit; current++) { | 401 for (Address* current = old_start_; current < limit; current++) { |
| 402 #ifdef DEBUG | 402 #if DCHECK_IS_ON |
| 403 Address* saved_top = old_top_; | 403 Address* saved_top = old_top_; |
| 404 #endif | 404 #endif |
| 405 Object** slot = reinterpret_cast<Object**>(*current); | 405 Object** slot = reinterpret_cast<Object**>(*current); |
| 406 Object* object = reinterpret_cast<Object*>( | 406 Object* object = reinterpret_cast<Object*>( |
| 407 base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot))); | 407 base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot))); |
| 408 if (heap_->InFromSpace(object)) { | 408 if (heap_->InFromSpace(object)) { |
| 409 HeapObject* heap_object = reinterpret_cast<HeapObject*>(object); | 409 HeapObject* heap_object = reinterpret_cast<HeapObject*>(object); |
| 410 // The new space object was not promoted if it still contains a map | 410 // The new space object was not promoted if it still contains a map |
| 411 // pointer. Clear the map field now lazily. | 411 // pointer. Clear the map field now lazily. |
| 412 if (clear_maps) ClearDeadObject(heap_object); | 412 if (clear_maps) ClearDeadObject(heap_object); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 } | 594 } |
| 595 old_buffer_is_sorted_ = false; | 595 old_buffer_is_sorted_ = false; |
| 596 old_buffer_is_filtered_ = false; | 596 old_buffer_is_filtered_ = false; |
| 597 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); | 597 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); |
| 598 DCHECK(old_top_ <= old_limit_); | 598 DCHECK(old_top_ <= old_limit_); |
| 599 } | 599 } |
| 600 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); | 600 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); |
| 601 } | 601 } |
| 602 } | 602 } |
| 603 } // namespace v8::internal | 603 } // namespace v8::internal |
| OLD | NEW |