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

Unified Diff: test/cctest/heap/heap-utils.cc

Issue 2028633002: Provide a tagged allocation top pointer. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update 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
Index: test/cctest/heap/heap-utils.cc
diff --git a/test/cctest/heap/heap-utils.cc b/test/cctest/heap/heap-utils.cc
index e6daa454417ab5b78d87873e4420ea61b372522a..d85529179dda6e3741a6a6eb308ad6393b4ab7e7 100644
--- a/test/cctest/heap/heap-utils.cc
+++ b/test/cctest/heap/heap-utils.cc
@@ -45,8 +45,7 @@ std::vector<Handle<FixedArray>> CreatePadding(Heap* heap, int padding_size,
} 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) {
@@ -59,9 +58,13 @@ std::vector<Handle<FixedArray>> CreatePadding(Heap* heap, int padding_size,
if (length <= 0) {
// Not enough room to create another fixed array. Let's create a filler.
if (free_memory > (2 * kPointerSize)) {
- 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;
}
@@ -77,8 +80,7 @@ std::vector<Handle<FixedArray>> CreatePadding(Heap* heap, int padding_size,
void AllocateAllButNBytes(v8::internal::NewSpace* space, int extra_bytes,
std::vector<Handle<FixedArray>>* out_handles) {
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;
@@ -96,8 +98,7 @@ void FillCurrentPage(v8::internal::NewSpace* space,
bool FillUpOnePage(v8::internal::NewSpace* space,
std::vector<Handle<FixedArray>>* out_handles) {
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 =
heap::CreatePadding(space->heap(), space_remaining, i::NOT_TENURED);

Powered by Google App Engine
This is Rietveld 408576698