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

Unified Diff: test/cctest/heap/utils-inl.h

Issue 1924223002: Provide tagged allocation top pointer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « test/cctest/heap/test-heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/utils-inl.h
diff --git a/test/cctest/heap/utils-inl.h b/test/cctest/heap/utils-inl.h
index 0e943b4197538bccb7bd79c14c0bcd352a512177..9c59951f5a6b8d8fbc3c0f2baf91f88701d0de10 100644
--- a/test/cctest/heap/utils-inl.h
+++ b/test/cctest/heap/utils-inl.h
@@ -35,8 +35,7 @@ static inline std::vector<Handle<FixedArray>> CreatePadding(
} else {
heap->new_space()->DisableInlineAllocationSteps();
int overall_free_memory =
- static_cast<int>(*heap->new_space()->allocation_limit_address() -
- *heap->new_space()->allocation_top_address());
+ static_cast<int>(heap->new_space()->limit() - heap->new_space()->top());
CHECK(padding_size <= overall_free_memory || overall_free_memory == 0);
}
while (free_memory > 0) {
@@ -48,8 +47,13 @@ static inline std::vector<Handle<FixedArray>> CreatePadding(
length = LenFromSize(allocate_memory);
if (length <= 0) {
// Not enough room to create another fixed array. Let's create a filler.
- heap->CreateFillerObjectAt(*heap->old_space()->allocation_top_address(),
- free_memory, ClearRecordedSlots::kNo);
+ if (tenure == i::TENURED) {
+ heap->CreateFillerObjectAt(heap->old_space()->top(), free_memory,
+ ClearRecordedSlots::kNo);
+ } else {
+ heap->CreateFillerObjectAt(heap->new_space()->top(), free_memory,
+ ClearRecordedSlots::kNo);
+ }
break;
}
}
@@ -67,8 +71,7 @@ static inline bool FillUpOnePage(
v8::internal::NewSpace* space,
std::vector<Handle<FixedArray>>* out_handles = nullptr) {
space->DisableInlineAllocationSteps();
- int space_remaining = static_cast<int>(*space->allocation_limit_address() -
- *space->allocation_top_address());
+ int space_remaining = static_cast<int>(space->limit() - space->top());
if (space_remaining == 0) return false;
std::vector<Handle<FixedArray>> handles =
CreatePadding(space->heap(), space_remaining, i::NOT_TENURED);
@@ -83,8 +86,7 @@ static inline void AllocateAllButNBytes(
v8::internal::NewSpace* space, int extra_bytes,
std::vector<Handle<FixedArray>>* out_handles = nullptr) {
space->DisableInlineAllocationSteps();
- int space_remaining = static_cast<int>(*space->allocation_limit_address() -
- *space->allocation_top_address());
+ int space_remaining = static_cast<int>(space->limit() - space->top());
CHECK(space_remaining >= extra_bytes);
int new_linear_size = space_remaining - extra_bytes;
if (new_linear_size == 0) return;
« no previous file with comments | « test/cctest/heap/test-heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698