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

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

Issue 2634033003: [heap] Fix live object iterator to skip grey filler objects. (Closed)
Patch Set: include Created 3 years, 11 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/mark-compact-inl.h ('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 23 matching lines...) Expand all
34 #include <sys/types.h> 34 #include <sys/types.h>
35 #include <unistd.h> 35 #include <unistd.h>
36 #endif 36 #endif
37 37
38 #include <utility> 38 #include <utility>
39 39
40 #include "src/v8.h" 40 #include "src/v8.h"
41 41
42 #include "src/full-codegen/full-codegen.h" 42 #include "src/full-codegen/full-codegen.h"
43 #include "src/global-handles.h" 43 #include "src/global-handles.h"
44 #include "src/heap/mark-compact-inl.h"
45 #include "src/heap/mark-compact.h"
44 #include "test/cctest/cctest.h" 46 #include "test/cctest/cctest.h"
45 #include "test/cctest/heap/heap-tester.h" 47 #include "test/cctest/heap/heap-tester.h"
46 #include "test/cctest/heap/heap-utils.h" 48 #include "test/cctest/heap/heap-utils.h"
47 49
48 using namespace v8::internal; 50 using namespace v8::internal;
49 using v8::Just; 51 using v8::Just;
50 52
51 53
52 TEST(MarkingDeque) { 54 TEST(MarkingDeque) {
53 CcTest::InitializeVM(); 55 CcTest::InitializeVM();
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 478 }
477 479
478 480
479 TEST(RegressJoinThreadsOnIsolateDeinit) { 481 TEST(RegressJoinThreadsOnIsolateDeinit) {
480 intptr_t size_limit = ShortLivingIsolate() * 2; 482 intptr_t size_limit = ShortLivingIsolate() * 2;
481 for (int i = 0; i < 10; i++) { 483 for (int i = 0; i < 10; i++) {
482 CHECK_GT(size_limit, ShortLivingIsolate()); 484 CHECK_GT(size_limit, ShortLivingIsolate());
483 } 485 }
484 } 486 }
485 487
488 TEST(Regress5829) {
489 CcTest::InitializeVM();
490 Isolate* isolate = CcTest::i_isolate();
491 v8::HandleScope sc(CcTest::isolate());
492 Heap* heap = isolate->heap();
493 heap::SealCurrentObjects(heap);
494 i::MarkCompactCollector* collector = heap->mark_compact_collector();
495 i::IncrementalMarking* marking = heap->incremental_marking();
496 if (collector->sweeping_in_progress()) {
497 collector->EnsureSweepingCompleted();
498 }
499 CHECK(marking->IsMarking() || marking->IsStopped());
500 if (marking->IsStopped()) {
501 heap->StartIncrementalMarking(i::Heap::kNoGCFlags,
502 i::GarbageCollectionReason::kTesting);
503 }
504 CHECK(marking->IsMarking());
505 marking->StartBlackAllocationForTesting();
506 Handle<FixedArray> array = isolate->factory()->NewFixedArray(10, TENURED);
507 Address old_end = array->address() + array->Size();
508 // Right trim the array without clearing the mark bits.
509 array->set_length(9);
510 heap->CreateFillerObjectAt(old_end - kPointerSize, kPointerSize,
511 ClearRecordedSlots::kNo);
512 heap->old_space()->EmptyAllocationInfo();
513 LiveObjectIterator<kGreyObjects> it(Page::FromAddress(array->address()));
514 HeapObject* object = nullptr;
515 while ((object = it.Next()) != nullptr) {
516 CHECK(!object->IsFiller());
517 }
518 }
519
486 #endif // __linux__ and !USE_SIMULATOR 520 #endif // __linux__ and !USE_SIMULATOR
OLDNEW
« no previous file with comments | « src/heap/mark-compact-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698