| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2861 static inline void UpdateSlot(Heap* heap, Object** slot) { | 2861 static inline void UpdateSlot(Heap* heap, Object** slot) { |
| 2862 Object* obj = reinterpret_cast<Object*>( | 2862 Object* obj = reinterpret_cast<Object*>( |
| 2863 base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot))); | 2863 base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot))); |
| 2864 | 2864 |
| 2865 if (!obj->IsHeapObject()) return; | 2865 if (!obj->IsHeapObject()) return; |
| 2866 | 2866 |
| 2867 HeapObject* heap_obj = HeapObject::cast(obj); | 2867 HeapObject* heap_obj = HeapObject::cast(obj); |
| 2868 | 2868 |
| 2869 // TODO(ishell): remove, once crbug/454297 is caught. | 2869 // TODO(ishell): remove, once crbug/454297 is caught. |
| 2870 #if V8_TARGET_ARCH_64_BIT | 2870 #if V8_TARGET_ARCH_64_BIT |
| 2871 #ifndef V8_OS_AIX // no point checking on AIX as full 64 range is supported |
| 2871 const uintptr_t kBoundary = V8_UINT64_C(1) << 48; | 2872 const uintptr_t kBoundary = V8_UINT64_C(1) << 48; |
| 2872 STATIC_ASSERT(kBoundary > 0); | 2873 STATIC_ASSERT(kBoundary > 0); |
| 2873 if (reinterpret_cast<uintptr_t>(heap_obj->address()) >= kBoundary) { | 2874 if (reinterpret_cast<uintptr_t>(heap_obj->address()) >= kBoundary) { |
| 2874 CheckLayoutDescriptorAndDie(heap, slot); | 2875 CheckLayoutDescriptorAndDie(heap, slot); |
| 2875 } | 2876 } |
| 2876 #endif | 2877 #endif |
| 2878 #endif |
| 2877 MapWord map_word = heap_obj->map_word(); | 2879 MapWord map_word = heap_obj->map_word(); |
| 2878 if (map_word.IsForwardingAddress()) { | 2880 if (map_word.IsForwardingAddress()) { |
| 2879 DCHECK(heap->InFromSpace(heap_obj) || | 2881 DCHECK(heap->InFromSpace(heap_obj) || |
| 2880 MarkCompactCollector::IsOnEvacuationCandidate(heap_obj)); | 2882 MarkCompactCollector::IsOnEvacuationCandidate(heap_obj)); |
| 2881 HeapObject* target = map_word.ToForwardingAddress(); | 2883 HeapObject* target = map_word.ToForwardingAddress(); |
| 2882 base::NoBarrier_CompareAndSwap( | 2884 base::NoBarrier_CompareAndSwap( |
| 2883 reinterpret_cast<base::AtomicWord*>(slot), | 2885 reinterpret_cast<base::AtomicWord*>(slot), |
| 2884 reinterpret_cast<base::AtomicWord>(obj), | 2886 reinterpret_cast<base::AtomicWord>(obj), |
| 2885 reinterpret_cast<base::AtomicWord>(target)); | 2887 reinterpret_cast<base::AtomicWord>(target)); |
| 2886 DCHECK(!heap->InFromSpace(target) && | 2888 DCHECK(!heap->InFromSpace(target) && |
| (...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4617 SlotsBuffer* buffer = *buffer_address; | 4619 SlotsBuffer* buffer = *buffer_address; |
| 4618 while (buffer != NULL) { | 4620 while (buffer != NULL) { |
| 4619 SlotsBuffer* next_buffer = buffer->next(); | 4621 SlotsBuffer* next_buffer = buffer->next(); |
| 4620 DeallocateBuffer(buffer); | 4622 DeallocateBuffer(buffer); |
| 4621 buffer = next_buffer; | 4623 buffer = next_buffer; |
| 4622 } | 4624 } |
| 4623 *buffer_address = NULL; | 4625 *buffer_address = NULL; |
| 4624 } | 4626 } |
| 4625 } | 4627 } |
| 4626 } // namespace v8::internal | 4628 } // namespace v8::internal |
| OLD | NEW |