OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2546 old_addr, | 2546 old_addr, |
2547 obj_size); | 2547 obj_size); |
2548 } | 2548 } |
2549 } | 2549 } |
2550 | 2550 |
2551 ASSERT(!HeapObject::FromAddress(new_addr)->IsCode()); | 2551 ASSERT(!HeapObject::FromAddress(new_addr)->IsCode()); |
2552 | 2552 |
2553 HeapObject* copied_to = HeapObject::FromAddress(new_addr); | 2553 HeapObject* copied_to = HeapObject::FromAddress(new_addr); |
2554 if (copied_to->IsJSFunction()) { | 2554 if (copied_to->IsJSFunction()) { |
2555 PROFILE(FunctionMoveEvent(old_addr, new_addr)); | 2555 PROFILE(FunctionMoveEvent(old_addr, new_addr)); |
2556 PROFILE(FunctionCreateEventFromMove(JSFunction::cast(copied_to), obj)); | 2556 PROFILE(FunctionCreateEventFromMove(JSFunction::cast(copied_to))); |
2557 } | 2557 } |
2558 HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); | 2558 HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); |
2559 | 2559 |
2560 return obj_size; | 2560 return obj_size; |
2561 } | 2561 } |
2562 | 2562 |
2563 | 2563 |
2564 int MarkCompactCollector::RelocateOldPointerObject(HeapObject* obj) { | 2564 int MarkCompactCollector::RelocateOldPointerObject(HeapObject* obj) { |
2565 return RelocateOldNonCodeObject(obj, Heap::old_pointer_space()); | 2565 return RelocateOldNonCodeObject(obj, Heap::old_pointer_space()); |
2566 } | 2566 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 | 2639 |
2640 #ifdef DEBUG | 2640 #ifdef DEBUG |
2641 if (FLAG_gc_verbose) { | 2641 if (FLAG_gc_verbose) { |
2642 PrintF("relocate %p -> %p\n", old_addr, new_addr); | 2642 PrintF("relocate %p -> %p\n", old_addr, new_addr); |
2643 } | 2643 } |
2644 #endif | 2644 #endif |
2645 | 2645 |
2646 HeapObject* copied_to = HeapObject::FromAddress(new_addr); | 2646 HeapObject* copied_to = HeapObject::FromAddress(new_addr); |
2647 if (copied_to->IsJSFunction()) { | 2647 if (copied_to->IsJSFunction()) { |
2648 PROFILE(FunctionMoveEvent(old_addr, new_addr)); | 2648 PROFILE(FunctionMoveEvent(old_addr, new_addr)); |
2649 PROFILE(FunctionCreateEventFromMove(JSFunction::cast(copied_to), obj)); | 2649 PROFILE(FunctionCreateEventFromMove(JSFunction::cast(copied_to))); |
2650 } | 2650 } |
2651 HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); | 2651 HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); |
2652 | 2652 |
2653 return obj_size; | 2653 return obj_size; |
2654 } | 2654 } |
2655 | 2655 |
2656 | 2656 |
2657 void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) { | 2657 void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) { |
2658 #ifdef ENABLE_LOGGING_AND_PROFILING | 2658 #ifdef ENABLE_LOGGING_AND_PROFILING |
2659 if (obj->IsCode()) { | 2659 if (obj->IsCode()) { |
2660 PROFILE(CodeDeleteEvent(obj->address())); | 2660 PROFILE(CodeDeleteEvent(obj->address())); |
2661 } else if (obj->IsJSFunction()) { | 2661 } else if (obj->IsJSFunction()) { |
2662 PROFILE(FunctionDeleteEvent(obj->address())); | 2662 PROFILE(FunctionDeleteEvent(obj->address())); |
2663 } | 2663 } |
2664 #endif | 2664 #endif |
2665 } | 2665 } |
2666 | 2666 |
2667 | 2667 |
2668 void MarkCompactCollector::Initialize() { | 2668 void MarkCompactCollector::Initialize() { |
2669 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 2669 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
2670 StaticMarkingVisitor::Initialize(); | 2670 StaticMarkingVisitor::Initialize(); |
2671 } | 2671 } |
2672 | 2672 |
2673 | 2673 |
2674 } } // namespace v8::internal | 2674 } } // namespace v8::internal |
OLD | NEW |