| 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 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2705 // to encounter pointers to dead new space objects during traversal of pointers | 2705 // to encounter pointers to dead new space objects during traversal of pointers |
| 2706 // to new space. We should clear them to avoid encountering them during next | 2706 // to new space. We should clear them to avoid encountering them during next |
| 2707 // pointer iteration. This is an issue if the store buffer overflows and we | 2707 // pointer iteration. This is an issue if the store buffer overflows and we |
| 2708 // have to scan the entire old space, including dead objects, looking for | 2708 // have to scan the entire old space, including dead objects, looking for |
| 2709 // pointers to new space. | 2709 // pointers to new space. |
| 2710 void MarkCompactCollector::MigrateObject(Address dst, | 2710 void MarkCompactCollector::MigrateObject(Address dst, |
| 2711 Address src, | 2711 Address src, |
| 2712 int size, | 2712 int size, |
| 2713 AllocationSpace dest) { | 2713 AllocationSpace dest) { |
| 2714 HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst)); | 2714 HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst)); |
| 2715 // TODO(hpayer): Replace these checks with asserts. | 2715 ASSERT(heap()->AllowedToBeMigrated(HeapObject::FromAddress(src), dest)); |
| 2716 CHECK(heap()->AllowedToBeMigrated(HeapObject::FromAddress(src), dest)); | 2716 ASSERT(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize); |
| 2717 CHECK(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize); | |
| 2718 if (dest == OLD_POINTER_SPACE) { | 2717 if (dest == OLD_POINTER_SPACE) { |
| 2719 Address src_slot = src; | 2718 Address src_slot = src; |
| 2720 Address dst_slot = dst; | 2719 Address dst_slot = dst; |
| 2721 ASSERT(IsAligned(size, kPointerSize)); | 2720 ASSERT(IsAligned(size, kPointerSize)); |
| 2722 | 2721 |
| 2723 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { | 2722 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { |
| 2724 Object* value = Memory::Object_at(src_slot); | 2723 Object* value = Memory::Object_at(src_slot); |
| 2725 | 2724 |
| 2726 Memory::Object_at(dst_slot) = value; | 2725 Memory::Object_at(dst_slot) = value; |
| 2727 | 2726 |
| (...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4300 while (buffer != NULL) { | 4299 while (buffer != NULL) { |
| 4301 SlotsBuffer* next_buffer = buffer->next(); | 4300 SlotsBuffer* next_buffer = buffer->next(); |
| 4302 DeallocateBuffer(buffer); | 4301 DeallocateBuffer(buffer); |
| 4303 buffer = next_buffer; | 4302 buffer = next_buffer; |
| 4304 } | 4303 } |
| 4305 *buffer_address = NULL; | 4304 *buffer_address = NULL; |
| 4306 } | 4305 } |
| 4307 | 4306 |
| 4308 | 4307 |
| 4309 } } // namespace v8::internal | 4308 } } // namespace v8::internal |
| OLD | NEW |