| 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 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 // address with the mask will result in the start address of the new space | 638 // address with the mask will result in the start address of the new space |
| 639 // for all addresses in either semispace. | 639 // for all addresses in either semispace. |
| 640 Address NewSpaceStart() { return new_space_.start(); } | 640 Address NewSpaceStart() { return new_space_.start(); } |
| 641 uintptr_t NewSpaceMask() { return new_space_.mask(); } | 641 uintptr_t NewSpaceMask() { return new_space_.mask(); } |
| 642 Address NewSpaceTop() { return new_space_.top(); } | 642 Address NewSpaceTop() { return new_space_.top(); } |
| 643 | 643 |
| 644 NewSpace* new_space() { return &new_space_; } | 644 NewSpace* new_space() { return &new_space_; } |
| 645 OldSpace* old_space() { return old_space_; } | 645 OldSpace* old_space() { return old_space_; } |
| 646 OldSpace* code_space() { return code_space_; } | 646 OldSpace* code_space() { return code_space_; } |
| 647 MapSpace* map_space() { return map_space_; } | 647 MapSpace* map_space() { return map_space_; } |
| 648 CellSpace* cell_space() { return cell_space_; } | |
| 649 LargeObjectSpace* lo_space() { return lo_space_; } | 648 LargeObjectSpace* lo_space() { return lo_space_; } |
| 650 PagedSpace* paged_space(int idx) { | 649 PagedSpace* paged_space(int idx) { |
| 651 switch (idx) { | 650 switch (idx) { |
| 652 case OLD_SPACE: | 651 case OLD_SPACE: |
| 653 return old_space(); | 652 return old_space(); |
| 654 case MAP_SPACE: | 653 case MAP_SPACE: |
| 655 return map_space(); | 654 return map_space(); |
| 656 case CELL_SPACE: | |
| 657 return cell_space(); | |
| 658 case CODE_SPACE: | 655 case CODE_SPACE: |
| 659 return code_space(); | 656 return code_space(); |
| 660 case NEW_SPACE: | 657 case NEW_SPACE: |
| 661 case LO_SPACE: | 658 case LO_SPACE: |
| 662 UNREACHABLE(); | 659 UNREACHABLE(); |
| 663 } | 660 } |
| 664 return NULL; | 661 return NULL; |
| 665 } | 662 } |
| 666 | 663 |
| 667 bool always_allocate() { return always_allocate_scope_depth_ != 0; } | 664 bool always_allocate() { return always_allocate_scope_depth_ != 0; } |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 int contexts_disposed_; | 1563 int contexts_disposed_; |
| 1567 | 1564 |
| 1568 int global_ic_age_; | 1565 int global_ic_age_; |
| 1569 | 1566 |
| 1570 int scan_on_scavenge_pages_; | 1567 int scan_on_scavenge_pages_; |
| 1571 | 1568 |
| 1572 NewSpace new_space_; | 1569 NewSpace new_space_; |
| 1573 OldSpace* old_space_; | 1570 OldSpace* old_space_; |
| 1574 OldSpace* code_space_; | 1571 OldSpace* code_space_; |
| 1575 MapSpace* map_space_; | 1572 MapSpace* map_space_; |
| 1576 CellSpace* cell_space_; | |
| 1577 LargeObjectSpace* lo_space_; | 1573 LargeObjectSpace* lo_space_; |
| 1578 HeapState gc_state_; | 1574 HeapState gc_state_; |
| 1579 int gc_post_processing_depth_; | 1575 int gc_post_processing_depth_; |
| 1580 Address new_space_top_after_last_gc_; | 1576 Address new_space_top_after_last_gc_; |
| 1581 | 1577 |
| 1582 // Returns the amount of external memory registered since last global gc. | 1578 // Returns the amount of external memory registered since last global gc. |
| 1583 int64_t PromotedExternalMemorySize(); | 1579 int64_t PromotedExternalMemorySize(); |
| 1584 | 1580 |
| 1585 // How many "runtime allocations" happened. | 1581 // How many "runtime allocations" happened. |
| 1586 uint32_t allocations_count_; | 1582 uint32_t allocations_count_; |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2171 | 2167 |
| 2172 int* start_marker; // 0 | 2168 int* start_marker; // 0 |
| 2173 int* new_space_size; // 1 | 2169 int* new_space_size; // 1 |
| 2174 int* new_space_capacity; // 2 | 2170 int* new_space_capacity; // 2 |
| 2175 intptr_t* old_space_size; // 3 | 2171 intptr_t* old_space_size; // 3 |
| 2176 intptr_t* old_space_capacity; // 4 | 2172 intptr_t* old_space_capacity; // 4 |
| 2177 intptr_t* code_space_size; // 5 | 2173 intptr_t* code_space_size; // 5 |
| 2178 intptr_t* code_space_capacity; // 6 | 2174 intptr_t* code_space_capacity; // 6 |
| 2179 intptr_t* map_space_size; // 7 | 2175 intptr_t* map_space_size; // 7 |
| 2180 intptr_t* map_space_capacity; // 8 | 2176 intptr_t* map_space_capacity; // 8 |
| 2181 intptr_t* cell_space_size; // 9 | 2177 intptr_t* lo_space_size; // 9 |
| 2182 intptr_t* cell_space_capacity; // 10 | 2178 int* global_handle_count; // 10 |
| 2183 intptr_t* lo_space_size; // 11 | 2179 int* weak_global_handle_count; // 11 |
| 2184 int* global_handle_count; // 12 | 2180 int* pending_global_handle_count; // 12 |
| 2185 int* weak_global_handle_count; // 13 | 2181 int* near_death_global_handle_count; // 13 |
| 2186 int* pending_global_handle_count; // 14 | 2182 int* free_global_handle_count; // 14 |
| 2187 int* near_death_global_handle_count; // 15 | 2183 intptr_t* memory_allocator_size; // 15 |
| 2188 int* free_global_handle_count; // 16 | 2184 intptr_t* memory_allocator_capacity; // 16 |
| 2189 intptr_t* memory_allocator_size; // 17 | 2185 int* objects_per_type; // 17 |
| 2190 intptr_t* memory_allocator_capacity; // 18 | 2186 int* size_per_type; // 18 |
| 2191 int* objects_per_type; // 19 | 2187 int* os_error; // 19 |
| 2192 int* size_per_type; // 20 | 2188 int* end_marker; // 20 |
| 2193 int* os_error; // 21 | |
| 2194 int* end_marker; // 22 | |
| 2195 }; | 2189 }; |
| 2196 | 2190 |
| 2197 | 2191 |
| 2198 class AlwaysAllocateScope { | 2192 class AlwaysAllocateScope { |
| 2199 public: | 2193 public: |
| 2200 explicit inline AlwaysAllocateScope(Isolate* isolate); | 2194 explicit inline AlwaysAllocateScope(Isolate* isolate); |
| 2201 inline ~AlwaysAllocateScope(); | 2195 inline ~AlwaysAllocateScope(); |
| 2202 | 2196 |
| 2203 private: | 2197 private: |
| 2204 // Implicitly disable artificial allocation failures. | 2198 // Implicitly disable artificial allocation failures. |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2604 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2598 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2605 | 2599 |
| 2606 private: | 2600 private: |
| 2607 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2601 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2608 }; | 2602 }; |
| 2609 #endif // DEBUG | 2603 #endif // DEBUG |
| 2610 } | 2604 } |
| 2611 } // namespace v8::internal | 2605 } // namespace v8::internal |
| 2612 | 2606 |
| 2613 #endif // V8_HEAP_HEAP_H_ | 2607 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |