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 #ifndef V8_HEAP_HEAP_INL_H_ | 5 #ifndef V8_HEAP_HEAP_INL_H_ |
6 #define V8_HEAP_HEAP_INL_H_ | 6 #define V8_HEAP_HEAP_INL_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
11 #include "src/cpu-profiler.h" | 11 #include "src/cpu-profiler.h" |
12 #include "src/heap/heap.h" | 12 #include "src/heap/heap.h" |
13 #include "src/heap/store-buffer.h" | 13 #include "src/heap/store-buffer.h" |
14 #include "src/heap/store-buffer-inl.h" | 14 #include "src/heap/store-buffer-inl.h" |
15 #include "src/heap-profiler.h" | 15 #include "src/heap-profiler.h" |
16 #include "src/isolate.h" | 16 #include "src/isolate.h" |
17 #include "src/list-inl.h" | 17 #include "src/list-inl.h" |
18 #include "src/msan.h" | 18 #include "src/msan.h" |
19 #include "src/objects.h" | 19 #include "src/objects.h" |
20 | 20 |
21 namespace v8 { | 21 namespace v8 { |
22 namespace internal { | 22 namespace internal { |
23 | 23 |
24 void PromotionQueue::insert(HeapObject* target, int size) { | 24 void PromotionQueue::insert(HeapObject* target, int size) { |
25 if (emergency_stack_ != NULL) { | 25 if (emergency_stack_ != NULL) { |
26 emergency_stack_->Add(Entry(target, size)); | 26 emergency_stack_->Add(Entry(target, size)); |
27 return; | 27 return; |
28 } | 28 } |
29 | 29 |
30 if (NewSpacePage::IsAtStart(reinterpret_cast<Address>(rear_))) { | |
31 NewSpacePage* rear_page = | |
32 NewSpacePage::FromAddress(reinterpret_cast<Address>(rear_)); | |
33 DCHECK(!rear_page->prev_page()->is_anchor()); | |
34 rear_ = reinterpret_cast<intptr_t*>(rear_page->prev_page()->area_end()); | |
35 } | |
36 | |
37 if ((rear_ - 2) < limit_) { | 30 if ((rear_ - 2) < limit_) { |
38 RelocateQueueHead(); | 31 RelocateQueueHead(); |
39 emergency_stack_->Add(Entry(target, size)); | 32 emergency_stack_->Add(Entry(target, size)); |
40 return; | 33 return; |
41 } | 34 } |
42 | 35 |
43 *(--rear_) = reinterpret_cast<intptr_t>(target); | 36 *(--rear_) = reinterpret_cast<intptr_t>(target); |
44 *(--rear_) = size; | 37 *(--rear_) = size; |
45 // Assert no overflow into live objects. | 38 // Assert no overflow into live objects. |
46 #ifdef DEBUG | 39 #ifdef DEBUG |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 | 748 |
756 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 749 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
757 for (Object** current = start; current < end; current++) { | 750 for (Object** current = start; current < end; current++) { |
758 CHECK((*current)->IsSmi()); | 751 CHECK((*current)->IsSmi()); |
759 } | 752 } |
760 } | 753 } |
761 } | 754 } |
762 } // namespace v8::internal | 755 } // namespace v8::internal |
763 | 756 |
764 #endif // V8_HEAP_HEAP_INL_H_ | 757 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |