v8/test/cctest/heap-tester.h
mlippautz cf71c28f13 Revert of "[heap] Divide available memory upon compaction tasks" (patchset #2 id:20001 of https://codereview.chromium.org/1399403002/ )
Reason for revert:
Failing: https://chromegw.corp.google.com/i/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/2115

Original issue's description:
> Reland of "[heap] Divide available memory upon compaction tasks"
>
> This reverts commit ec1046f9f8.
>
> Original message:
>
> [heap] Divide available memory upon compaction tasks
> - Fairly (round-robin) divide available memory upon compaction tasks.
> - Ensure an upper limit (of memory) since dividing is O(n) for n free-space
>   nodes.
> - Refill from free lists managed by sweeper once a compaction space becomes
>   empty.
>
> Assumption for dividing memory: Memory in the free lists is sparse upon starting
> compaction (which means that only few nodes are available), except for memory
> reducer GCs, which happen in idle time though (so it's less of a problem).
>
> BUG=chromium:524425
> LOG=N
>
> Committed: https://crrev.com/a805be73f6f97645450124f75c0f7417ec7b3e70
> Cr-Commit-Position: refs/heads/master@{#31329}

TBR=hpayer@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:524425

Review URL: https://codereview.chromium.org/1412643002

Cr-Commit-Position: refs/heads/master@{#31332}
2015-10-16 11:54:47 +00:00

61 lines
1.7 KiB
C++

// Copyright 2015 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_TESTER_H_
#define HEAP_TESTER_H_
#include "src/handles.h"
#include "src/heap/spaces.h"
// Tests that should have access to private methods of {v8::internal::Heap}.
// Those tests need to be defined using HEAP_TEST(Name) { ... }.
#define HEAP_TEST_METHODS(V) \
V(GCFlags) \
V(MarkCompactCollector) \
V(NoPromotion) \
V(NumberStringCacheSize) \
V(ObjectGroups) \
V(Promotion) \
V(Regression39128) \
V(ResetWeakHandle) \
V(StressHandles) \
V(TestSizeOfObjects) \
V(WriteBarriersInCopyJSObject)
#define HEAP_TEST(Name) \
CcTest register_test_##Name(v8::internal::HeapTester::Test##Name, __FILE__, \
#Name, NULL, true, true); \
void v8::internal::HeapTester::Test##Name()
#define THREADED_HEAP_TEST(Name) \
RegisterThreadedTest register_##Name(v8::internal::HeapTester::Test##Name, \
#Name); \
/* */ HEAP_TEST(Name)
namespace v8 {
namespace internal {
class HeapTester {
public:
#define DECLARE_STATIC(Name) static void Test##Name();
HEAP_TEST_METHODS(DECLARE_STATIC)
#undef HEAP_TEST_METHODS
/* test-alloc.cc */
static AllocationResult AllocateAfterFailures();
static Handle<Object> TestAllocateAfterFailures();
/* test-api.cc */
static void ResetWeakHandle(bool global_gc);
};
} // namespace internal
} // namespace v8
#endif // HEAP_TESTER_H_