| 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 6354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6365 | 6365 |
| 6366 FixedArrayBase* previous = *array; | 6366 FixedArrayBase* previous = *array; |
| 6367 FixedArrayBase* trimmed; | 6367 FixedArrayBase* trimmed; |
| 6368 | 6368 |
| 6369 // First trim in one word steps. | 6369 // First trim in one word steps. |
| 6370 for (int i = 0; i < 10; i++) { | 6370 for (int i = 0; i < 10; i++) { |
| 6371 trimmed = heap->LeftTrimFixedArray(previous, 1); | 6371 trimmed = heap->LeftTrimFixedArray(previous, 1); |
| 6372 HeapObject* filler = HeapObject::FromAddress(previous->address()); | 6372 HeapObject* filler = HeapObject::FromAddress(previous->address()); |
| 6373 CHECK(filler->IsFiller()); | 6373 CHECK(filler->IsFiller()); |
| 6374 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(trimmed))); | 6374 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(trimmed))); |
| 6375 CHECK(Marking::IsImpossible(ObjectMarking::MarkBitFrom(previous))); | 6375 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(previous))); |
| 6376 previous = trimmed; | 6376 previous = trimmed; |
| 6377 } | 6377 } |
| 6378 | 6378 |
| 6379 // Then trim in two and three word steps. | 6379 // Then trim in two and three word steps. |
| 6380 for (int i = 2; i <= 3; i++) { | 6380 for (int i = 2; i <= 3; i++) { |
| 6381 for (int j = 0; j < 10; j++) { | 6381 for (int j = 0; j < 10; j++) { |
| 6382 trimmed = heap->LeftTrimFixedArray(previous, i); | 6382 trimmed = heap->LeftTrimFixedArray(previous, i); |
| 6383 HeapObject* filler = HeapObject::FromAddress(previous->address()); | 6383 HeapObject* filler = HeapObject::FromAddress(previous->address()); |
| 6384 CHECK(filler->IsFiller()); | 6384 CHECK(filler->IsFiller()); |
| 6385 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(trimmed))); | 6385 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(trimmed))); |
| 6386 CHECK(Marking::IsWhite(ObjectMarking::MarkBitFrom(previous))); | 6386 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(previous))); |
| 6387 previous = trimmed; | 6387 previous = trimmed; |
| 6388 } | 6388 } |
| 6389 } | 6389 } |
| 6390 | 6390 |
| 6391 heap::GcAndSweep(heap, OLD_SPACE); | 6391 heap::GcAndSweep(heap, OLD_SPACE); |
| 6392 } | 6392 } |
| 6393 | 6393 |
| 6394 TEST(ContinuousRightTrimFixedArrayInBlackArea) { | 6394 TEST(ContinuousRightTrimFixedArrayInBlackArea) { |
| 6395 if (!i::FLAG_incremental_marking) return; | 6395 if (!i::FLAG_incremental_marking) return; |
| 6396 FLAG_black_allocation = true; | 6396 FLAG_black_allocation = true; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6638 CHECK(!heap->code_space()->FirstPage()->Contains(code->address())); | 6638 CHECK(!heap->code_space()->FirstPage()->Contains(code->address())); |
| 6639 | 6639 |
| 6640 // Ensure it's not in large object space. | 6640 // Ensure it's not in large object space. |
| 6641 MemoryChunk* chunk = MemoryChunk::FromAddress(code->address()); | 6641 MemoryChunk* chunk = MemoryChunk::FromAddress(code->address()); |
| 6642 CHECK(chunk->owner()->identity() != LO_SPACE); | 6642 CHECK(chunk->owner()->identity() != LO_SPACE); |
| 6643 CHECK(chunk->NeverEvacuate()); | 6643 CHECK(chunk->NeverEvacuate()); |
| 6644 } | 6644 } |
| 6645 | 6645 |
| 6646 } // namespace internal | 6646 } // namespace internal |
| 6647 } // namespace v8 | 6647 } // namespace v8 |
| OLD | NEW |