Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Unified Diff: src/heap/heap.h

Issue 1027463002: Revert "Merge old data and pointer space." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/globals.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index a2fa8832f3b2f69663bd1e3aef4d1a59730b7e70..5c276e9581c5fa2aac11a33db53cd7dd96a444b5 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -641,15 +641,18 @@ class Heap {
Address NewSpaceTop() { return new_space_.top(); }
NewSpace* new_space() { return &new_space_; }
- OldSpace* old_space() { return old_space_; }
+ OldSpace* old_pointer_space() { return old_pointer_space_; }
+ OldSpace* old_data_space() { return old_data_space_; }
OldSpace* code_space() { return code_space_; }
MapSpace* map_space() { return map_space_; }
CellSpace* cell_space() { return cell_space_; }
LargeObjectSpace* lo_space() { return lo_space_; }
PagedSpace* paged_space(int idx) {
switch (idx) {
- case OLD_SPACE:
- return old_space();
+ case OLD_POINTER_SPACE:
+ return old_pointer_space();
+ case OLD_DATA_SPACE:
+ return old_data_space();
case MAP_SPACE:
return map_space();
case CELL_SPACE:
@@ -675,11 +678,18 @@ class Heap {
return new_space_.allocation_limit_address();
}
- Address* OldSpaceAllocationTopAddress() {
- return old_space_->allocation_top_address();
+ Address* OldPointerSpaceAllocationTopAddress() {
+ return old_pointer_space_->allocation_top_address();
}
- Address* OldSpaceAllocationLimitAddress() {
- return old_space_->allocation_limit_address();
+ Address* OldPointerSpaceAllocationLimitAddress() {
+ return old_pointer_space_->allocation_limit_address();
+ }
+
+ Address* OldDataSpaceAllocationTopAddress() {
+ return old_data_space_->allocation_top_address();
+ }
+ Address* OldDataSpaceAllocationLimitAddress() {
+ return old_data_space_->allocation_limit_address();
}
// TODO(hpayer): There is still a missmatch between capacity and actual
@@ -909,9 +919,13 @@ class Heap {
inline bool InFromSpace(Object* object);
inline bool InToSpace(Object* object);
- // Returns whether the object resides in old space.
- inline bool InOldSpace(Address address);
- inline bool InOldSpace(Object* object);
+ // Returns whether the object resides in old pointer space.
+ inline bool InOldPointerSpace(Address address);
+ inline bool InOldPointerSpace(Object* object);
+
+ // Returns whether the object resides in old data space.
+ inline bool InOldDataSpace(Address address);
+ inline bool InOldDataSpace(Object* object);
// Checks whether an address/object in the heap (including auxiliary
// area and unused area).
@@ -923,6 +937,10 @@ class Heap {
bool InSpace(Address addr, AllocationSpace space);
bool InSpace(HeapObject* value, AllocationSpace space);
+ // Finds out which space an object should get promoted to based on its type.
+ inline OldSpace* TargetSpace(HeapObject* object);
+ static inline AllocationSpace TargetSpaceId(InstanceType type);
+
// Checks whether the given object is allowed to be migrated from it's
// current space into the given destination space. Used for debugging.
inline bool AllowedToBeMigrated(HeapObject* object, AllocationSpace dest);
@@ -1559,7 +1577,8 @@ class Heap {
int scan_on_scavenge_pages_;
NewSpace new_space_;
- OldSpace* old_space_;
+ OldSpace* old_pointer_space_;
+ OldSpace* old_data_space_;
OldSpace* code_space_;
MapSpace* map_space_;
CellSpace* cell_space_;
@@ -1754,11 +1773,14 @@ class Heap {
inline void UpdateOldSpaceLimits();
// Selects the proper allocation space depending on the given object
- // size and pretenuring decision.
+ // size, pretenuring decision, and preferred old-space.
static AllocationSpace SelectSpace(int object_size,
+ AllocationSpace preferred_old_space,
PretenureFlag pretenure) {
+ DCHECK(preferred_old_space == OLD_POINTER_SPACE ||
+ preferred_old_space == OLD_DATA_SPACE);
if (object_size > Page::kMaxRegularHeapObjectSize) return LO_SPACE;
- return (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE;
+ return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE;
}
HeapObject* DoubleAlignForDeserialization(HeapObject* object, int size);
@@ -2161,26 +2183,28 @@ class HeapStats {
int* start_marker; // 0
int* new_space_size; // 1
int* new_space_capacity; // 2
- intptr_t* old_space_size; // 3
- intptr_t* old_space_capacity; // 4
- intptr_t* code_space_size; // 5
- intptr_t* code_space_capacity; // 6
- intptr_t* map_space_size; // 7
- intptr_t* map_space_capacity; // 8
- intptr_t* cell_space_size; // 9
- intptr_t* cell_space_capacity; // 10
- intptr_t* lo_space_size; // 11
- int* global_handle_count; // 12
- int* weak_global_handle_count; // 13
- int* pending_global_handle_count; // 14
- int* near_death_global_handle_count; // 15
- int* free_global_handle_count; // 16
- intptr_t* memory_allocator_size; // 17
- intptr_t* memory_allocator_capacity; // 18
- int* objects_per_type; // 19
- int* size_per_type; // 20
- int* os_error; // 21
- int* end_marker; // 22
+ intptr_t* old_pointer_space_size; // 3
+ intptr_t* old_pointer_space_capacity; // 4
+ intptr_t* old_data_space_size; // 5
+ intptr_t* old_data_space_capacity; // 6
+ intptr_t* code_space_size; // 7
+ intptr_t* code_space_capacity; // 8
+ intptr_t* map_space_size; // 9
+ intptr_t* map_space_capacity; // 10
+ intptr_t* cell_space_size; // 11
+ intptr_t* cell_space_capacity; // 12
+ intptr_t* lo_space_size; // 13
+ int* global_handle_count; // 14
+ int* weak_global_handle_count; // 15
+ int* pending_global_handle_count; // 16
+ int* near_death_global_handle_count; // 17
+ int* free_global_handle_count; // 18
+ intptr_t* memory_allocator_size; // 19
+ intptr_t* memory_allocator_capacity; // 20
+ int* objects_per_type; // 21
+ int* size_per_type; // 22
+ int* os_error; // 23
+ int* end_marker; // 24
};
@@ -2239,11 +2263,12 @@ class AllSpaces BASE_EMBEDDED {
};
-// Space iterator for iterating over all old spaces of the heap: Old space
-// and code space. Returns each space in turn, and null when it is done.
+// Space iterator for iterating over all old spaces of the heap: Old pointer
+// space, old data space and code space. Returns each space in turn, and null
+// when it is done.
class OldSpaces BASE_EMBEDDED {
public:
- explicit OldSpaces(Heap* heap) : heap_(heap), counter_(OLD_SPACE) {}
+ explicit OldSpaces(Heap* heap) : heap_(heap), counter_(OLD_POINTER_SPACE) {}
OldSpace* next();
private:
@@ -2253,11 +2278,11 @@ class OldSpaces BASE_EMBEDDED {
// Space iterator for iterating over all the paged spaces of the heap: Map
-// space, old space, code space and cell space. Returns
+// space, old pointer space, old data space, code space and cell space. Returns
// each space in turn, and null when it is done.
class PagedSpaces BASE_EMBEDDED {
public:
- explicit PagedSpaces(Heap* heap) : heap_(heap), counter_(OLD_SPACE) {}
+ explicit PagedSpaces(Heap* heap) : heap_(heap), counter_(OLD_POINTER_SPACE) {}
PagedSpace* next();
private:
« no previous file with comments | « src/globals.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698