| 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 6817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6828 base::OS::CommitPageSize()); | 6828 base::OS::CommitPageSize()); |
| 6829 CHECK_EQ(shrinked_size, chunk->CommittedPhysicalMemory()); | 6829 CHECK_EQ(shrinked_size, chunk->CommittedPhysicalMemory()); |
| 6830 } | 6830 } |
| 6831 | 6831 |
| 6832 TEST(RememberedSetRemoveRange) { | 6832 TEST(RememberedSetRemoveRange) { |
| 6833 CcTest::InitializeVM(); | 6833 CcTest::InitializeVM(); |
| 6834 v8::HandleScope scope(CcTest::isolate()); | 6834 v8::HandleScope scope(CcTest::isolate()); |
| 6835 Heap* heap = CcTest::heap(); | 6835 Heap* heap = CcTest::heap(); |
| 6836 Isolate* isolate = heap->isolate(); | 6836 Isolate* isolate = heap->isolate(); |
| 6837 | 6837 |
| 6838 Handle<FixedArray> array = isolate->factory()->NewFixedArray(500000); | 6838 Handle<FixedArray> array = isolate->factory()->NewFixedArray(Page::kPageSize / |
| 6839 kPointerSize); |
| 6839 MemoryChunk* chunk = MemoryChunk::FromAddress(array->address()); | 6840 MemoryChunk* chunk = MemoryChunk::FromAddress(array->address()); |
| 6840 CHECK(chunk->owner()->identity() == LO_SPACE); | 6841 CHECK(chunk->owner()->identity() == LO_SPACE); |
| 6841 Address start = array->address(); | 6842 Address start = array->address(); |
| 6842 // Maps slot to boolean indicator of whether the slot should be in the set. | 6843 // Maps slot to boolean indicator of whether the slot should be in the set. |
| 6843 std::map<Address, bool> slots; | 6844 std::map<Address, bool> slots; |
| 6844 slots[start + 0] = true; | 6845 slots[start + 0] = true; |
| 6845 slots[start + kPointerSize] = true; | 6846 slots[start + kPointerSize] = true; |
| 6846 slots[start + Page::kPageSize - kPointerSize] = true; | 6847 slots[start + Page::kPageSize - kPointerSize] = true; |
| 6847 slots[start + Page::kPageSize] = true; | 6848 slots[start + Page::kPageSize] = true; |
| 6848 slots[start + Page::kPageSize + kPointerSize] = true; | 6849 slots[start + Page::kPageSize + kPointerSize] = true; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6885 chunk, chunk->area_end() - kPointerSize, chunk->area_end()); | 6886 chunk, chunk->area_end() - kPointerSize, chunk->area_end()); |
| 6886 slots[chunk->area_end() - kPointerSize] = false; | 6887 slots[chunk->area_end() - kPointerSize] = false; |
| 6887 RememberedSet<OLD_TO_NEW>::Iterate(chunk, [&slots](Address addr) { | 6888 RememberedSet<OLD_TO_NEW>::Iterate(chunk, [&slots](Address addr) { |
| 6888 CHECK(slots[addr]); | 6889 CHECK(slots[addr]); |
| 6889 return KEEP_SLOT; | 6890 return KEEP_SLOT; |
| 6890 }); | 6891 }); |
| 6891 } | 6892 } |
| 6892 | 6893 |
| 6893 } // namespace internal | 6894 } // namespace internal |
| 6894 } // namespace v8 | 6895 } // namespace v8 |
| OLD | NEW |