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

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

Issue 1863983002: 🏄 [heap] Add page evacuation mode for new->old (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable optimize_for_size for the feature test as we require >1 page new space Created 4 years, 8 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 56033c151ed614cb9bfdac41ee79b808687083a8..0e943b4197538bccb7bd79c14c0bcd352a512177 100644
--- a/test/cctest/heap/utils-inl.h
+++ b/test/cctest/heap/utils-inl.h
@@ -63,37 +63,48 @@ static inline std::vector<Handle<FixedArray>> CreatePadding(
// Helper function that simulates a full new-space in the heap.
-static inline bool FillUpOnePage(v8::internal::NewSpace* space) {
+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());
if (space_remaining == 0) return false;
- CreatePadding(space->heap(), space_remaining, i::NOT_TENURED);
+ std::vector<Handle<FixedArray>> handles =
+ CreatePadding(space->heap(), space_remaining, i::NOT_TENURED);
+ if (out_handles != nullptr)
+ out_handles->insert(out_handles->end(), handles.begin(), handles.end());
return true;
}
// Helper function that simulates a fill new-space in the heap.
-static inline void AllocateAllButNBytes(v8::internal::NewSpace* space,
- int extra_bytes) {
+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());
CHECK(space_remaining >= extra_bytes);
int new_linear_size = space_remaining - extra_bytes;
if (new_linear_size == 0) return;
- CreatePadding(space->heap(), new_linear_size, i::NOT_TENURED);
+ std::vector<Handle<FixedArray>> handles =
+ CreatePadding(space->heap(), new_linear_size, i::NOT_TENURED);
+ if (out_handles != nullptr)
+ out_handles->insert(out_handles->end(), handles.begin(), handles.end());
}
-
-static inline void FillCurrentPage(v8::internal::NewSpace* space) {
- AllocateAllButNBytes(space, 0);
+static inline void FillCurrentPage(
+ v8::internal::NewSpace* space,
+ std::vector<Handle<FixedArray>>* out_handles = nullptr) {
+ AllocateAllButNBytes(space, 0, out_handles);
}
-
-static inline void SimulateFullSpace(v8::internal::NewSpace* space) {
- FillCurrentPage(space);
- while (FillUpOnePage(space)) {
+static inline void SimulateFullSpace(
+ v8::internal::NewSpace* space,
+ std::vector<Handle<FixedArray>>* out_handles = nullptr) {
+ FillCurrentPage(space, out_handles);
+ while (FillUpOnePage(space, out_handles) || space->AddFreshPage()) {
}
}
« 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