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

Unified Diff: src/heap/heap.h

Issue 1051233002: Reland "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 8f5551aa5540864dd7a8ac51db68373cdf1637e1..c75d236d67643dab252a6f5f0e2d84e0d67593f5 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -641,18 +641,15 @@ class Heap {
Address NewSpaceTop() { return new_space_.top(); }
NewSpace* new_space() { return &new_space_; }
- OldSpace* old_pointer_space() { return old_pointer_space_; }
- OldSpace* old_data_space() { return old_data_space_; }
+ OldSpace* old_space() { return old_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_POINTER_SPACE:
- return old_pointer_space();
- case OLD_DATA_SPACE:
- return old_data_space();
+ case OLD_SPACE:
+ return old_space();
case MAP_SPACE:
return map_space();
case CELL_SPACE:
@@ -678,18 +675,11 @@ class Heap {
return new_space_.allocation_limit_address();
}
- Address* OldPointerSpaceAllocationTopAddress() {
- return old_pointer_space_->allocation_top_address();
+ Address* OldSpaceAllocationTopAddress() {
+ return old_space_->allocation_top_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();
+ Address* OldSpaceAllocationLimitAddress() {
+ return old_space_->allocation_limit_address();
}
// TODO(hpayer): There is still a missmatch between capacity and actual
@@ -920,13 +910,9 @@ class Heap {
inline bool InFromSpace(Object* object);
inline bool InToSpace(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);
+ // Returns whether the object resides in old space.
+ inline bool InOldSpace(Address address);
+ inline bool InOldSpace(Object* object);
// Checks whether an address/object in the heap (including auxiliary
// area and unused area).
@@ -938,10 +924,6 @@ 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);
@@ -1587,8 +1569,7 @@ class Heap {
int scan_on_scavenge_pages_;
NewSpace new_space_;
- OldSpace* old_pointer_space_;
- OldSpace* old_data_space_;
+ OldSpace* old_space_;
OldSpace* code_space_;
MapSpace* map_space_;
CellSpace* cell_space_;
@@ -1783,14 +1764,11 @@ class Heap {
inline void UpdateOldSpaceLimits();
// Selects the proper allocation space depending on the given object
- // size, pretenuring decision, and preferred old-space.
+ // size and pretenuring decision.
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) ? preferred_old_space : NEW_SPACE;
+ return (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE;
}
HeapObject* DoubleAlignForDeserialization(HeapObject* object, int size);
@@ -2193,28 +2171,26 @@ class HeapStats {
int* start_marker; // 0
int* new_space_size; // 1
int* new_space_capacity; // 2
- 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
+ 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
};
@@ -2273,12 +2249,11 @@ class AllSpaces BASE_EMBEDDED {
};
-// 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.
+// 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.
class OldSpaces BASE_EMBEDDED {
public:
- explicit OldSpaces(Heap* heap) : heap_(heap), counter_(OLD_POINTER_SPACE) {}
+ explicit OldSpaces(Heap* heap) : heap_(heap), counter_(OLD_SPACE) {}
OldSpace* next();
private:
@@ -2288,11 +2263,11 @@ class OldSpaces BASE_EMBEDDED {
// Space iterator for iterating over all the paged spaces of the heap: Map
-// space, old pointer space, old data space, code space and cell space. Returns
+// space, old 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_POINTER_SPACE) {}
+ explicit PagedSpaces(Heap* heap) : heap_(heap), counter_(OLD_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