| 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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 // their IC targets converted to objects. | 1104 // their IC targets converted to objects. |
| 1105 // They need to be converted back to addresses. | 1105 // They need to be converted back to addresses. |
| 1106 Code::cast(object)->ConvertICTargetsFromObjectToAddress(); | 1106 Code::cast(object)->ConvertICTargetsFromObjectToAddress(); |
| 1107 } | 1107 } |
| 1108 if (!is_previous_alive) { // Transition from free to live. | 1108 if (!is_previous_alive) { // Transition from free to live. |
| 1109 dealloc(free_start, current - free_start); | 1109 dealloc(free_start, current - free_start); |
| 1110 is_previous_alive = true; | 1110 is_previous_alive = true; |
| 1111 } | 1111 } |
| 1112 } else { | 1112 } else { |
| 1113 if (object->IsCode()) { | 1113 if (object->IsCode()) { |
| 1114 // Notify the logger that compiled code has been collected. |
| 1114 LOG(CodeDeleteEvent(Code::cast(object)->address())); | 1115 LOG(CodeDeleteEvent(Code::cast(object)->address())); |
| 1115 } | 1116 } |
| 1116 if (is_previous_alive) { // Transition from live to free. | 1117 if (is_previous_alive) { // Transition from live to free. |
| 1117 free_start = current; | 1118 free_start = current; |
| 1118 is_previous_alive = false; | 1119 is_previous_alive = false; |
| 1119 } | 1120 } |
| 1120 } | 1121 } |
| 1121 // The object is now unmarked for the call to Size() at the top of the | 1122 // The object is now unmarked for the call to Size() at the top of the |
| 1122 // loop. | 1123 // loop. |
| 1123 } | 1124 } |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 Address old_addr = obj->address(); | 1672 Address old_addr = obj->address(); |
| 1672 | 1673 |
| 1673 if (new_addr != old_addr) { | 1674 if (new_addr != old_addr) { |
| 1674 memmove(new_addr, old_addr, obj_size); // copy contents | 1675 memmove(new_addr, old_addr, obj_size); // copy contents |
| 1675 } | 1676 } |
| 1676 | 1677 |
| 1677 HeapObject* copied_to = HeapObject::FromAddress(new_addr); | 1678 HeapObject* copied_to = HeapObject::FromAddress(new_addr); |
| 1678 if (copied_to->IsCode()) { | 1679 if (copied_to->IsCode()) { |
| 1679 // may also update inline cache target. | 1680 // may also update inline cache target. |
| 1680 Code::cast(copied_to)->Relocate(new_addr - old_addr); | 1681 Code::cast(copied_to)->Relocate(new_addr - old_addr); |
| 1681 // Notify the logger that compile code has moved. | 1682 // Notify the logger that compiled code has moved. |
| 1682 LOG(CodeMoveEvent(old_addr, new_addr)); | 1683 LOG(CodeMoveEvent(old_addr, new_addr)); |
| 1683 } | 1684 } |
| 1684 | 1685 |
| 1685 return obj_size; | 1686 return obj_size; |
| 1686 } | 1687 } |
| 1687 | 1688 |
| 1688 | 1689 |
| 1689 int MarkCompactCollector::RelocateNewObject(HeapObject* obj) { | 1690 int MarkCompactCollector::RelocateNewObject(HeapObject* obj) { |
| 1690 int obj_size = obj->Size(); | 1691 int obj_size = obj->Size(); |
| 1691 | 1692 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1726 | 1727 |
| 1727 void MarkCompactCollector::RebuildRSets() { | 1728 void MarkCompactCollector::RebuildRSets() { |
| 1728 #ifdef DEBUG | 1729 #ifdef DEBUG |
| 1729 ASSERT(state_ == RELOCATE_OBJECTS); | 1730 ASSERT(state_ == RELOCATE_OBJECTS); |
| 1730 state_ = REBUILD_RSETS; | 1731 state_ = REBUILD_RSETS; |
| 1731 #endif | 1732 #endif |
| 1732 Heap::RebuildRSets(); | 1733 Heap::RebuildRSets(); |
| 1733 } | 1734 } |
| 1734 | 1735 |
| 1735 } } // namespace v8::internal | 1736 } } // namespace v8::internal |
| OLD | NEW |