| 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 2502 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2513                                                     old_addr, | 2513                                                     old_addr, | 
| 2514                                                     obj_size); | 2514                                                     obj_size); | 
| 2515     } | 2515     } | 
| 2516   } | 2516   } | 
| 2517 | 2517 | 
| 2518   ASSERT(!HeapObject::FromAddress(new_addr)->IsCode()); | 2518   ASSERT(!HeapObject::FromAddress(new_addr)->IsCode()); | 
| 2519 | 2519 | 
| 2520   HeapObject* copied_to = HeapObject::FromAddress(new_addr); | 2520   HeapObject* copied_to = HeapObject::FromAddress(new_addr); | 
| 2521   if (copied_to->IsJSFunction()) { | 2521   if (copied_to->IsJSFunction()) { | 
| 2522     PROFILE(FunctionMoveEvent(old_addr, new_addr)); | 2522     PROFILE(FunctionMoveEvent(old_addr, new_addr)); | 
|  | 2523     PROFILE(FunctionCreateEventFromMove(JSFunction::cast(copied_to), obj)); | 
| 2523   } | 2524   } | 
| 2524   HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); | 2525   HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); | 
| 2525 | 2526 | 
| 2526   return obj_size; | 2527   return obj_size; | 
| 2527 } | 2528 } | 
| 2528 | 2529 | 
| 2529 | 2530 | 
| 2530 int MarkCompactCollector::RelocateOldPointerObject(HeapObject* obj) { | 2531 int MarkCompactCollector::RelocateOldPointerObject(HeapObject* obj) { | 
| 2531   return RelocateOldNonCodeObject(obj, Heap::old_pointer_space()); | 2532   return RelocateOldNonCodeObject(obj, Heap::old_pointer_space()); | 
| 2532 } | 2533 } | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2605 | 2606 | 
| 2606 #ifdef DEBUG | 2607 #ifdef DEBUG | 
| 2607   if (FLAG_gc_verbose) { | 2608   if (FLAG_gc_verbose) { | 
| 2608     PrintF("relocate %p -> %p\n", old_addr, new_addr); | 2609     PrintF("relocate %p -> %p\n", old_addr, new_addr); | 
| 2609   } | 2610   } | 
| 2610 #endif | 2611 #endif | 
| 2611 | 2612 | 
| 2612   HeapObject* copied_to = HeapObject::FromAddress(new_addr); | 2613   HeapObject* copied_to = HeapObject::FromAddress(new_addr); | 
| 2613   if (copied_to->IsJSFunction()) { | 2614   if (copied_to->IsJSFunction()) { | 
| 2614     PROFILE(FunctionMoveEvent(old_addr, new_addr)); | 2615     PROFILE(FunctionMoveEvent(old_addr, new_addr)); | 
|  | 2616     PROFILE(FunctionCreateEventFromMove(JSFunction::cast(copied_to), obj)); | 
| 2615   } | 2617   } | 
| 2616   HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); | 2618   HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); | 
| 2617 | 2619 | 
| 2618   return obj_size; | 2620   return obj_size; | 
| 2619 } | 2621 } | 
| 2620 | 2622 | 
| 2621 | 2623 | 
| 2622 void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) { | 2624 void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) { | 
| 2623 #ifdef ENABLE_LOGGING_AND_PROFILING | 2625 #ifdef ENABLE_LOGGING_AND_PROFILING | 
| 2624   if (obj->IsCode()) { | 2626   if (obj->IsCode()) { | 
| 2625     PROFILE(CodeDeleteEvent(obj->address())); | 2627     PROFILE(CodeDeleteEvent(obj->address())); | 
| 2626   } else if (obj->IsJSFunction()) { | 2628   } else if (obj->IsJSFunction()) { | 
| 2627     PROFILE(FunctionDeleteEvent(obj->address())); | 2629     PROFILE(FunctionDeleteEvent(obj->address())); | 
| 2628   } | 2630   } | 
| 2629 #endif | 2631 #endif | 
| 2630 } | 2632 } | 
| 2631 | 2633 | 
| 2632 | 2634 | 
| 2633 void MarkCompactCollector::Initialize() { | 2635 void MarkCompactCollector::Initialize() { | 
| 2634   StaticPointersToNewGenUpdatingVisitor::Initialize(); | 2636   StaticPointersToNewGenUpdatingVisitor::Initialize(); | 
| 2635   StaticMarkingVisitor::Initialize(); | 2637   StaticMarkingVisitor::Initialize(); | 
| 2636 } | 2638 } | 
| 2637 | 2639 | 
| 2638 | 2640 | 
| 2639 } }  // namespace v8::internal | 2641 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|