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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 | 103 |
104 void StoreBuffer::Uniq() { | 104 void StoreBuffer::Uniq() { |
105 // Remove adjacent duplicates and cells that do not point at new space. | 105 // Remove adjacent duplicates and cells that do not point at new space. |
106 Address previous = NULL; | 106 Address previous = NULL; |
107 Address* write = old_start_; | 107 Address* write = old_start_; |
108 DCHECK(may_move_store_buffer_entries_); | 108 DCHECK(may_move_store_buffer_entries_); |
109 for (Address* read = old_start_; read < old_top_; read++) { | 109 for (Address* read = old_start_; read < old_top_; read++) { |
110 Address current = *read; | 110 Address current = *read; |
111 if (current != previous) { | 111 if (current != previous) { |
112 if (heap_->InNewSpace(*reinterpret_cast<Object**>(current))) { | 112 Object* object = reinterpret_cast<Object*>( |
| 113 base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(current))); |
| 114 if (heap_->InNewSpace(object)) { |
113 *write++ = current; | 115 *write++ = current; |
114 } | 116 } |
115 } | 117 } |
116 previous = current; | 118 previous = current; |
117 } | 119 } |
118 old_top_ = write; | 120 old_top_ = write; |
119 } | 121 } |
120 | 122 |
121 | 123 |
122 bool StoreBuffer::SpaceAvailable(intptr_t space_needed) { | 124 bool StoreBuffer::SpaceAvailable(intptr_t space_needed) { |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 } | 596 } |
595 old_buffer_is_sorted_ = false; | 597 old_buffer_is_sorted_ = false; |
596 old_buffer_is_filtered_ = false; | 598 old_buffer_is_filtered_ = false; |
597 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); | 599 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); |
598 DCHECK(old_top_ <= old_limit_); | 600 DCHECK(old_top_ <= old_limit_); |
599 } | 601 } |
600 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); | 602 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); |
601 } | 603 } |
602 } | 604 } |
603 } // namespace v8::internal | 605 } // namespace v8::internal |
OLD | NEW |