| 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 5556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5567 CcTest::InitializeVM(); | 5567 CcTest::InitializeVM(); |
| 5568 Isolate* isolate = CcTest::i_isolate(); | 5568 Isolate* isolate = CcTest::i_isolate(); |
| 5569 Heap* heap = isolate->heap(); | 5569 Heap* heap = isolate->heap(); |
| 5570 HandleScope handle_scope(isolate); | 5570 HandleScope handle_scope(isolate); |
| 5571 | 5571 |
| 5572 Handle<FixedArray> o1 = isolate->factory()->NewFixedArray(kFixedArrayLen); | 5572 Handle<FixedArray> o1 = isolate->factory()->NewFixedArray(kFixedArrayLen); |
| 5573 Handle<FixedArray> o2 = isolate->factory()->NewFixedArray(kFixedArrayLen); | 5573 Handle<FixedArray> o2 = isolate->factory()->NewFixedArray(kFixedArrayLen); |
| 5574 CHECK(heap->InNewSpace(*o1)); | 5574 CHECK(heap->InNewSpace(*o1)); |
| 5575 CHECK(heap->InNewSpace(*o2)); | 5575 CHECK(heap->InNewSpace(*o2)); |
| 5576 | 5576 |
| 5577 HeapIterator it(heap, i::HeapObjectsFiltering::kFilterUnreachable); | 5577 HeapIterator it(heap, i::HeapIterator::kFilterUnreachable); |
| 5578 | 5578 |
| 5579 // Replace parts of an object placed before a live object with a filler. This | 5579 // Replace parts of an object placed before a live object with a filler. This |
| 5580 // way the filler object shares the mark bits with the following live object. | 5580 // way the filler object shares the mark bits with the following live object. |
| 5581 o1->Shrink(kFixedArrayLen - 1); | 5581 o1->Shrink(kFixedArrayLen - 1); |
| 5582 | 5582 |
| 5583 for (HeapObject* obj = it.next(); obj != NULL; obj = it.next()) { | 5583 for (HeapObject* obj = it.next(); obj != NULL; obj = it.next()) { |
| 5584 // Let's not optimize the loop away. | 5584 // Let's not optimize the loop away. |
| 5585 CHECK(obj->address() != nullptr); | 5585 CHECK(obj->address() != nullptr); |
| 5586 } | 5586 } |
| 5587 } | 5587 } |
| (...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6750 | 6750 |
| 6751 intptr_t size_before = heap->SizeOfObjects(); | 6751 intptr_t size_before = heap->SizeOfObjects(); |
| 6752 Handle<FixedArray> array = isolate->factory()->NewFixedArray(200000); | 6752 Handle<FixedArray> array = isolate->factory()->NewFixedArray(200000); |
| 6753 array->Shrink(1); | 6753 array->Shrink(1); |
| 6754 intptr_t size_after = heap->SizeOfObjects(); | 6754 intptr_t size_after = heap->SizeOfObjects(); |
| 6755 CHECK_EQ(size_after, size_before + array->Size()); | 6755 CHECK_EQ(size_after, size_before + array->Size()); |
| 6756 } | 6756 } |
| 6757 | 6757 |
| 6758 } // namespace internal | 6758 } // namespace internal |
| 6759 } // namespace v8 | 6759 } // namespace v8 |
| OLD | NEW |