Chromium Code Reviews| 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_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
| 6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "src/allocation.h" | 11 #include "src/allocation.h" |
| 12 #include "src/assert-scope.h" | 12 #include "src/assert-scope.h" |
| 13 #include "src/atomic-utils.h" | |
| 13 #include "src/globals.h" | 14 #include "src/globals.h" |
| 14 #include "src/heap/gc-idle-time-handler.h" | 15 #include "src/heap/gc-idle-time-handler.h" |
| 15 #include "src/heap/incremental-marking.h" | 16 #include "src/heap/incremental-marking.h" |
| 16 #include "src/heap/mark-compact.h" | 17 #include "src/heap/mark-compact.h" |
| 17 #include "src/heap/objects-visiting.h" | 18 #include "src/heap/objects-visiting.h" |
| 18 #include "src/heap/spaces.h" | 19 #include "src/heap/spaces.h" |
| 19 #include "src/heap/store-buffer.h" | 20 #include "src/heap/store-buffer.h" |
| 20 #include "src/list.h" | 21 #include "src/list.h" |
| 21 | 22 |
| 22 namespace v8 { | 23 namespace v8 { |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 769 static inline void MoveBlock(Address dst, Address src, int byte_size); | 770 static inline void MoveBlock(Address dst, Address src, int byte_size); |
| 770 | 771 |
| 771 // Notifies the heap that is ok to start marking or other activities that | 772 // Notifies the heap that is ok to start marking or other activities that |
| 772 // should not happen during deserialization. | 773 // should not happen during deserialization. |
| 773 void NotifyDeserializationComplete(); | 774 void NotifyDeserializationComplete(); |
| 774 | 775 |
| 775 intptr_t old_generation_allocation_limit() const { | 776 intptr_t old_generation_allocation_limit() const { |
| 776 return old_generation_allocation_limit_; | 777 return old_generation_allocation_limit_; |
| 777 } | 778 } |
| 778 | 779 |
| 779 bool always_allocate() { return always_allocate_scope_depth_ != 0; } | 780 bool always_allocate() { return always_allocate_scope_count_.Value() != 0; } |
| 780 Address always_allocate_scope_depth_address() { | |
|
Michael Lippautz
2015/09/03 13:10:37
Don't even think about it...
| |
| 781 return reinterpret_cast<Address>(&always_allocate_scope_depth_); | |
| 782 } | |
| 783 | 781 |
| 784 Address* NewSpaceAllocationTopAddress() { | 782 Address* NewSpaceAllocationTopAddress() { |
| 785 return new_space_.allocation_top_address(); | 783 return new_space_.allocation_top_address(); |
| 786 } | 784 } |
| 787 Address* NewSpaceAllocationLimitAddress() { | 785 Address* NewSpaceAllocationLimitAddress() { |
| 788 return new_space_.allocation_limit_address(); | 786 return new_space_.allocation_limit_address(); |
| 789 } | 787 } |
| 790 | 788 |
| 791 Address* OldSpaceAllocationTopAddress() { | 789 Address* OldSpaceAllocationTopAddress() { |
| 792 return old_space_->allocation_top_address(); | 790 return old_space_->allocation_top_address(); |
| (...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2127 intptr_t max_executable_size_; | 2125 intptr_t max_executable_size_; |
| 2128 intptr_t maximum_committed_; | 2126 intptr_t maximum_committed_; |
| 2129 | 2127 |
| 2130 // For keeping track of how much data has survived | 2128 // For keeping track of how much data has survived |
| 2131 // scavenge since last new space expansion. | 2129 // scavenge since last new space expansion. |
| 2132 int survived_since_last_expansion_; | 2130 int survived_since_last_expansion_; |
| 2133 | 2131 |
| 2134 // ... and since the last scavenge. | 2132 // ... and since the last scavenge. |
| 2135 int survived_last_scavenge_; | 2133 int survived_last_scavenge_; |
| 2136 | 2134 |
| 2137 int always_allocate_scope_depth_; | 2135 // This is not the depth of nested AlwaysAllocateScope's but rather a single |
| 2136 // count, as scopes can be acquired from multiple tasks (read: threads). | |
| 2137 AtomicValue always_allocate_scope_count_; | |
| 2138 | 2138 |
| 2139 // For keeping track of context disposals. | 2139 // For keeping track of context disposals. |
| 2140 int contexts_disposed_; | 2140 int contexts_disposed_; |
| 2141 | 2141 |
| 2142 int global_ic_age_; | 2142 int global_ic_age_; |
| 2143 | 2143 |
| 2144 int scan_on_scavenge_pages_; | 2144 int scan_on_scavenge_pages_; |
| 2145 | 2145 |
| 2146 NewSpace new_space_; | 2146 NewSpace new_space_; |
| 2147 OldSpace* old_space_; | 2147 OldSpace* old_space_; |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2742 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2742 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2743 | 2743 |
| 2744 private: | 2744 private: |
| 2745 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2745 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2746 }; | 2746 }; |
| 2747 #endif // DEBUG | 2747 #endif // DEBUG |
| 2748 } | 2748 } |
| 2749 } // namespace v8::internal | 2749 } // namespace v8::internal |
| 2750 | 2750 |
| 2751 #endif // V8_HEAP_HEAP_H_ | 2751 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |