Commit a86ddc5b authored by mlippautz's avatar mlippautz Committed by Commit bot

Revert of [cctest] Add tests for aborting compaction of pages (patchset #6...

Revert of [cctest] Add tests for aborting compaction of pages (patchset #6 id:140001 of https://codereview.chromium.org/1511933002/ )

Reason for revert:
Failing on Win 32bit nosnap:
  https://chromegw.corp.google.com/i/client.v8/builders/V8%20Win32%20-%20nosnap%20-%20shared/builds/10602

Original issue's description:
> [cctest] Add tests for aborting compaction of pages
>
> Tests for
> * aborting a full page.
> * partially aborting a page.
> * partially aborting a page with pointers between aborted pages.
> * partially aborting a page with store buffer entries.
>
> Also introduces force_oom() which prohibits a old space to
> expand
>
> BUG=chromium:524425
> LOG=N

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

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

Cr-Commit-Position: refs/heads/master@{#32785}
parent 5382e686
...@@ -164,8 +164,7 @@ Heap::Heap() ...@@ -164,8 +164,7 @@ Heap::Heap()
deserialization_complete_(false), deserialization_complete_(false),
concurrent_sweeping_enabled_(false), concurrent_sweeping_enabled_(false),
strong_roots_list_(NULL), strong_roots_list_(NULL),
array_buffer_tracker_(NULL), array_buffer_tracker_(NULL) {
force_oom_(false) {
// Allow build-time customization of the max semispace size. Building // Allow build-time customization of the max semispace size. Building
// V8 with snapshots and a non-default max semispace size is much // V8 with snapshots and a non-default max semispace size is much
// easier if you can define it as part of the build environment. // easier if you can define it as part of the build environment.
......
...@@ -817,7 +817,6 @@ class Heap { ...@@ -817,7 +817,6 @@ class Heap {
// TODO(hpayer): There is still a missmatch between capacity and actual // TODO(hpayer): There is still a missmatch between capacity and actual
// committed memory size. // committed memory size.
bool CanExpandOldGeneration(int size) { bool CanExpandOldGeneration(int size) {
if (force_oom_) return false;
return (CommittedOldGenerationMemory() + size) < MaxOldGenerationSize(); return (CommittedOldGenerationMemory() + size) < MaxOldGenerationSize();
} }
...@@ -2120,8 +2119,6 @@ class Heap { ...@@ -2120,8 +2119,6 @@ class Heap {
MUST_USE_RESULT AllocationResult InternalizeString(String* str); MUST_USE_RESULT AllocationResult InternalizeString(String* str);
void set_force_oom(bool value) { force_oom_ = value; }
// The amount of external memory registered through the API kept alive // The amount of external memory registered through the API kept alive
// by global handles // by global handles
int64_t amount_of_external_allocated_memory_; int64_t amount_of_external_allocated_memory_;
...@@ -2372,9 +2369,6 @@ class Heap { ...@@ -2372,9 +2369,6 @@ class Heap {
ArrayBufferTracker* array_buffer_tracker_; ArrayBufferTracker* array_buffer_tracker_;
// Used for testing purposes.
bool force_oom_;
// Classes in "heap" can be friends. // Classes in "heap" can be friends.
friend class AlwaysAllocateScope; friend class AlwaysAllocateScope;
friend class GCCallbacksScope; friend class GCCallbacksScope;
......
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
'gay-shortest.cc', 'gay-shortest.cc',
'heap/heap-tester.h', 'heap/heap-tester.h',
'heap/test-alloc.cc', 'heap/test-alloc.cc',
'heap/test-compaction.cc',
'heap/test-heap.cc', 'heap/test-heap.cc',
'heap/test-incremental-marking.cc', 'heap/test-incremental-marking.cc',
'heap/test-mark-compact.cc', 'heap/test-mark-compact.cc',
......
...@@ -10,24 +10,20 @@ ...@@ -10,24 +10,20 @@
// Tests that should have access to private methods of {v8::internal::Heap}. // Tests that should have access to private methods of {v8::internal::Heap}.
// Those tests need to be defined using HEAP_TEST(Name) { ... }. // Those tests need to be defined using HEAP_TEST(Name) { ... }.
#define HEAP_TEST_METHODS(V) \ #define HEAP_TEST_METHODS(V) \
V(CompactionFullAbortedPage) \ V(CompactionSpaceDivideMultiplePages) \
V(CompactionPartiallyAbortedPage) \ V(CompactionSpaceDivideSinglePage) \
V(CompactionPartiallyAbortedPageIntraAbortedPointers) \ V(GCFlags) \
V(CompactionPartiallyAbortedPageWithStoreBufferEntries) \ V(MarkCompactCollector) \
V(CompactionSpaceDivideMultiplePages) \ V(NoPromotion) \
V(CompactionSpaceDivideSinglePage) \ V(NumberStringCacheSize) \
V(GCFlags) \ V(ObjectGroups) \
V(MarkCompactCollector) \ V(Promotion) \
V(NoPromotion) \ V(Regression39128) \
V(NumberStringCacheSize) \ V(ResetWeakHandle) \
V(ObjectGroups) \ V(StressHandles) \
V(Promotion) \ V(TestMemoryReducerSampleJsCalls) \
V(Regression39128) \ V(TestSizeOfObjects) \
V(ResetWeakHandle) \
V(StressHandles) \
V(TestMemoryReducerSampleJsCalls) \
V(TestSizeOfObjects) \
V(WriteBarriersInCopyJSObject) V(WriteBarriersInCopyJSObject)
......
This diff is collapsed.
...@@ -16,15 +16,16 @@ namespace v8 { ...@@ -16,15 +16,16 @@ namespace v8 {
namespace internal { namespace internal {
static int LenFromSize(int size) { static int LenFromSize(int size) {
return (size - FixedArray::kHeaderSize) / kPointerSize; return (size - i::FixedArray::kHeaderSize) / i::kPointerSize;
} }
static inline std::vector<Handle<FixedArray>> CreatePadding( static inline void CreatePadding(i::Heap* heap, int padding_size,
Heap* heap, int padding_size, PretenureFlag tenure, i::PretenureFlag tenure) {
int object_size = Page::kMaxRegularHeapObjectSize) { const int max_number_of_objects = 20;
std::vector<Handle<FixedArray>> handles; v8::internal::Handle<v8::internal::FixedArray>
Isolate* isolate = heap->isolate(); big_objects[max_number_of_objects];
i::Isolate* isolate = heap->isolate();
int allocate_memory; int allocate_memory;
int length; int length;
int free_memory = padding_size; int free_memory = padding_size;
...@@ -40,10 +41,9 @@ static inline std::vector<Handle<FixedArray>> CreatePadding( ...@@ -40,10 +41,9 @@ static inline std::vector<Handle<FixedArray>> CreatePadding(
*heap->new_space()->allocation_top_address()); *heap->new_space()->allocation_top_address());
CHECK(padding_size <= current_free_memory || current_free_memory == 0); CHECK(padding_size <= current_free_memory || current_free_memory == 0);
} }
while (free_memory > 0) { for (int i = 0; i < max_number_of_objects && free_memory > 0; i++) {
// for (int i = 0; i < max_number_of_objects && free_memory > 0; i++) { if (free_memory > i::Page::kMaxRegularHeapObjectSize) {
if (free_memory > object_size) { allocate_memory = i::Page::kMaxRegularHeapObjectSize;
allocate_memory = object_size;
length = LenFromSize(allocate_memory); length = LenFromSize(allocate_memory);
} else { } else {
allocate_memory = free_memory; allocate_memory = free_memory;
...@@ -55,12 +55,11 @@ static inline std::vector<Handle<FixedArray>> CreatePadding( ...@@ -55,12 +55,11 @@ static inline std::vector<Handle<FixedArray>> CreatePadding(
break; break;
} }
} }
handles.push_back(isolate->factory()->NewFixedArray(length, tenure)); big_objects[i] = isolate->factory()->NewFixedArray(length, tenure);
CHECK((tenure == NOT_TENURED && heap->InNewSpace(*handles.back())) || CHECK((tenure == i::NOT_TENURED && heap->InNewSpace(*big_objects[i])) ||
(tenure == TENURED && heap->InOldSpace(*handles.back()))); (tenure == i::TENURED && heap->InOldSpace(*big_objects[i])));
free_memory -= allocate_memory; free_memory -= allocate_memory;
} }
return handles;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment