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

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

Issue 1999753002: [heap] Harden heap-related cctests (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix for win 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/cctest.gyp ('k') | test/cctest/heap/heap-utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/heap-utils.h
diff --git a/test/cctest/heap/heap-utils.h b/test/cctest/heap/heap-utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..f7739d4b0eb72fd0fcec9723bde0c5668173868d
--- /dev/null
+++ b/test/cctest/heap/heap-utils.h
@@ -0,0 +1,47 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef HEAP_HEAP_UTILS_H_
+#define HEAP_HEAP_UTILS_H_
+
+#include "src/heap/heap.h"
+
+namespace v8 {
+namespace internal {
+namespace heap {
+
+void SealCurrentObjects(Heap* heap);
+
+int FixedArrayLenFromSize(int size);
+
+std::vector<Handle<FixedArray>> CreatePadding(
+ Heap* heap, int padding_size, PretenureFlag tenure,
+ int object_size = Page::kMaxRegularHeapObjectSize);
+
+void AllocateAllButNBytes(
+ v8::internal::NewSpace* space, int extra_bytes,
+ std::vector<Handle<FixedArray>>* out_handles = nullptr);
+
+void FillCurrentPage(v8::internal::NewSpace* space,
+ std::vector<Handle<FixedArray>>* out_handles = nullptr);
+
+// Helper function that simulates a full new-space in the heap.
+bool FillUpOnePage(v8::internal::NewSpace* space,
+ std::vector<Handle<FixedArray>>* out_handles = nullptr);
+
+void SimulateFullSpace(v8::internal::NewSpace* space,
+ std::vector<Handle<FixedArray>>* out_handles = nullptr);
+
+// Helper function that simulates many incremental marking steps until
+// marking is completed.
+void SimulateIncrementalMarking(i::Heap* heap, bool force_completion = true);
+
+// Helper function that simulates a full old-space in the heap.
+void SimulateFullSpace(v8::internal::PagedSpace* space);
+
+} // namespace heap
+} // namespace internal
+} // namespace v8
+
+#endif // HEAP_HEAP_UTILS_H_
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/heap/heap-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698