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 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2761 // to encounter pointers to dead new space objects during traversal of pointers | 2761 // to encounter pointers to dead new space objects during traversal of pointers |
2762 // to new space. We should clear them to avoid encountering them during next | 2762 // to new space. We should clear them to avoid encountering them during next |
2763 // pointer iteration. This is an issue if the store buffer overflows and we | 2763 // pointer iteration. This is an issue if the store buffer overflows and we |
2764 // have to scan the entire old space, including dead objects, looking for | 2764 // have to scan the entire old space, including dead objects, looking for |
2765 // pointers to new space. | 2765 // pointers to new space. |
2766 void MarkCompactCollector::MigrateObject(Address dst, | 2766 void MarkCompactCollector::MigrateObject(Address dst, |
2767 Address src, | 2767 Address src, |
2768 int size, | 2768 int size, |
2769 AllocationSpace dest) { | 2769 AllocationSpace dest) { |
2770 HeapProfiler* heap_profiler = heap()->isolate()->heap_profiler(); | 2770 HeapProfiler* heap_profiler = heap()->isolate()->heap_profiler(); |
2771 if (heap_profiler->is_profiling()) { | 2771 if (heap_profiler->is_tracking_object_moves()) { |
2772 heap_profiler->ObjectMoveEvent(src, dst, size); | 2772 heap_profiler->ObjectMoveEvent(src, dst, size); |
2773 } | 2773 } |
2774 ASSERT(heap()->AllowedToBeMigrated(HeapObject::FromAddress(src), dest)); | 2774 ASSERT(heap()->AllowedToBeMigrated(HeapObject::FromAddress(src), dest)); |
2775 ASSERT(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize); | 2775 ASSERT(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize); |
2776 if (dest == OLD_POINTER_SPACE) { | 2776 if (dest == OLD_POINTER_SPACE) { |
2777 Address src_slot = src; | 2777 Address src_slot = src; |
2778 Address dst_slot = dst; | 2778 Address dst_slot = dst; |
2779 ASSERT(IsAligned(size, kPointerSize)); | 2779 ASSERT(IsAligned(size, kPointerSize)); |
2780 | 2780 |
2781 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { | 2781 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { |
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4367 while (buffer != NULL) { | 4367 while (buffer != NULL) { |
4368 SlotsBuffer* next_buffer = buffer->next(); | 4368 SlotsBuffer* next_buffer = buffer->next(); |
4369 DeallocateBuffer(buffer); | 4369 DeallocateBuffer(buffer); |
4370 buffer = next_buffer; | 4370 buffer = next_buffer; |
4371 } | 4371 } |
4372 *buffer_address = NULL; | 4372 *buffer_address = NULL; |
4373 } | 4373 } |
4374 | 4374 |
4375 | 4375 |
4376 } } // namespace v8::internal | 4376 } } // namespace v8::internal |
OLD | NEW |