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

Side by Side Diff: test/cctest/test-heap.cc

Issue 1374203002: [heap] No leakage of incremental-marking.h outside of heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/heap/store-buffer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4681 matching lines...) Expand 10 before | Expand all | Expand 10 after
4692 evac_page->SetFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING); 4692 evac_page->SetFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING);
4693 FixedArray* old_location = *lit; 4693 FixedArray* old_location = *lit;
4694 4694
4695 // Allocate a large object. 4695 // Allocate a large object.
4696 const int kSize = 1000000; 4696 const int kSize = 1000000;
4697 Handle<FixedArray> lo = isolate->factory()->NewFixedArray(kSize, TENURED); 4697 Handle<FixedArray> lo = isolate->factory()->NewFixedArray(kSize, TENURED);
4698 CHECK(heap->lo_space()->Contains(*lo)); 4698 CHECK(heap->lo_space()->Contains(*lo));
4699 4699
4700 // Start incremental marking to active write barrier. 4700 // Start incremental marking to active write barrier.
4701 SimulateIncrementalMarking(heap, false); 4701 SimulateIncrementalMarking(heap, false);
4702 heap->AdvanceIncrementalMarking(10000000, 10000000, 4702 heap->incremental_marking()->AdvanceIncrementalMarking(
4703 IncrementalMarking::IdleStepActions()); 4703 10000000, 10000000, IncrementalMarking::IdleStepActions());
4704 4704
4705 // Create references from the large object to the object on the evacuation 4705 // Create references from the large object to the object on the evacuation
4706 // candidate. 4706 // candidate.
4707 const int kStep = kSize / 10; 4707 const int kStep = kSize / 10;
4708 for (int i = 0; i < kSize; i += kStep) { 4708 for (int i = 0; i < kSize; i += kStep) {
4709 lo->set(i, *lit); 4709 lo->set(i, *lit);
4710 CHECK(lo->get(i) == old_location); 4710 CHECK(lo->get(i) == old_location);
4711 } 4711 }
4712 4712
4713 // Move the evaucation candidate object. 4713 // Move the evaucation candidate object.
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after
6515 // The CollectGarbage call above starts sweeper threads. 6515 // The CollectGarbage call above starts sweeper threads.
6516 // The crash will happen if the following two functions 6516 // The crash will happen if the following two functions
6517 // are called before sweeping finishes. 6517 // are called before sweeping finishes.
6518 heap->StartIncrementalMarking(); 6518 heap->StartIncrementalMarking();
6519 heap->FinalizeIncrementalMarkingIfComplete("test"); 6519 heap->FinalizeIncrementalMarkingIfComplete("test");
6520 } 6520 }
6521 6521
6522 6522
6523 } // namespace internal 6523 } // namespace internal
6524 } // namespace v8 6524 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/store-buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698