| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5576 #endif // DEBUG | 5576 #endif // DEBUG |
| 5577 | 5577 |
| 5578 | 5578 |
| 5579 static void InterruptCallback357137(v8::Isolate* isolate, void* data) { } | 5579 static void InterruptCallback357137(v8::Isolate* isolate, void* data) { } |
| 5580 | 5580 |
| 5581 | 5581 |
| 5582 static void RequestInterrupt(const v8::FunctionCallbackInfo<v8::Value>& args) { | 5582 static void RequestInterrupt(const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 5583 CcTest::isolate()->RequestInterrupt(&InterruptCallback357137, NULL); | 5583 CcTest::isolate()->RequestInterrupt(&InterruptCallback357137, NULL); |
| 5584 } | 5584 } |
| 5585 | 5585 |
| 5586 | 5586 HEAP_TEST(Regress538257) { |
| 5587 UNINITIALIZED_TEST(Regress538257) { | |
| 5588 i::FLAG_manual_evacuation_candidates_selection = true; | 5587 i::FLAG_manual_evacuation_candidates_selection = true; |
| 5589 v8::Isolate::CreateParams create_params; | 5588 v8::Isolate::CreateParams create_params; |
| 5590 // Set heap limits. | 5589 // Set heap limits. |
| 5591 create_params.constraints.set_max_semi_space_size(1); | 5590 create_params.constraints.set_max_semi_space_size(1); |
| 5592 create_params.constraints.set_max_old_space_size(6); | 5591 create_params.constraints.set_max_old_space_size(6); |
| 5593 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); | 5592 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); |
| 5594 v8::Isolate* isolate = v8::Isolate::New(create_params); | 5593 v8::Isolate* isolate = v8::Isolate::New(create_params); |
| 5595 isolate->Enter(); | 5594 isolate->Enter(); |
| 5596 { | 5595 { |
| 5597 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 5596 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 5598 Heap* heap = i_isolate->heap(); | 5597 Heap* heap = i_isolate->heap(); |
| 5599 HandleScope handle_scope(i_isolate); | 5598 HandleScope handle_scope(i_isolate); |
| 5600 PagedSpace* old_space = heap->old_space(); | 5599 PagedSpace* old_space = heap->old_space(); |
| 5601 const int kMaxObjects = 10000; | 5600 const int kMaxObjects = 10000; |
| 5602 const int kFixedArrayLen = 512; | 5601 const int kFixedArrayLen = 512; |
| 5603 Handle<FixedArray> objects[kMaxObjects]; | 5602 Handle<FixedArray> objects[kMaxObjects]; |
| 5604 for (int i = 0; (i < kMaxObjects) && | 5603 for (int i = 0; (i < kMaxObjects) && |
| 5605 heap->CanExpandOldGeneration(old_space->AreaSize()); | 5604 heap->CanExpandOldGeneration(old_space->AreaSize()); |
| 5606 i++) { | 5605 i++) { |
| 5607 objects[i] = i_isolate->factory()->NewFixedArray(kFixedArrayLen, TENURED); | 5606 objects[i] = i_isolate->factory()->NewFixedArray(kFixedArrayLen, TENURED); |
| 5608 Page::FromAddress(objects[i]->address()) | 5607 Page::FromAddress(objects[i]->address()) |
| 5609 ->SetFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING); | 5608 ->SetFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING); |
| 5610 } | 5609 } |
| 5611 heap::SimulateFullSpace(old_space); | 5610 heap::SimulateFullSpace(old_space); |
| 5612 heap->CollectGarbage(OLD_SPACE, i::GarbageCollectionReason::kTesting); | 5611 heap->CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask, |
| 5612 i::GarbageCollectionReason::kTesting); |
| 5613 // If we get this far, we've successfully aborted compaction. Any further | 5613 // If we get this far, we've successfully aborted compaction. Any further |
| 5614 // allocations might trigger OOM. | 5614 // allocations might trigger OOM. |
| 5615 } | 5615 } |
| 5616 isolate->Exit(); | 5616 isolate->Exit(); |
| 5617 isolate->Dispose(); | 5617 isolate->Dispose(); |
| 5618 } | 5618 } |
| 5619 | 5619 |
| 5620 | 5620 |
| 5621 TEST(Regress357137) { | 5621 TEST(Regress357137) { |
| 5622 CcTest::InitializeVM(); | 5622 CcTest::InitializeVM(); |
| (...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7121 heap::SimulateFullSpace(heap->new_space()); | 7121 heap::SimulateFullSpace(heap->new_space()); |
| 7122 } | 7122 } |
| 7123 heap::GcAndSweep(heap, OLD_SPACE); | 7123 heap::GcAndSweep(heap, OLD_SPACE); |
| 7124 for (Page* p : *heap->new_space()) { | 7124 for (Page* p : *heap->new_space()) { |
| 7125 CHECK(!p->InIntermediateGeneration()); | 7125 CHECK(!p->InIntermediateGeneration()); |
| 7126 } | 7126 } |
| 7127 } | 7127 } |
| 7128 | 7128 |
| 7129 } // namespace internal | 7129 } // namespace internal |
| 7130 } // namespace v8 | 7130 } // namespace v8 |
| OLD | NEW |