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 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | 1042 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); |
1043 MarkBit mark = Marking::MarkBitFrom(object); | 1043 MarkBit mark = Marking::MarkBitFrom(object); |
1044 heap->mark_compact_collector()->MarkObject(object, mark); | 1044 heap->mark_compact_collector()->MarkObject(object, mark); |
1045 } | 1045 } |
1046 | 1046 |
1047 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | 1047 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { |
1048 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 1048 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
1049 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 1049 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
1050 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() | 1050 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
1051 && (target->ic_state() == MEGAMORPHIC || | 1051 && (target->ic_state() == MEGAMORPHIC || |
1052 heap->mark_compact_collector()->flush_monomorphic_ics_)) { | 1052 heap->mark_compact_collector()->flush_monomorphic_ics_ || |
| 1053 target->ic_age() != heap->global_ic_age())) { |
1053 IC::Clear(rinfo->pc()); | 1054 IC::Clear(rinfo->pc()); |
1054 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 1055 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
1055 } | 1056 } |
1056 MarkBit code_mark = Marking::MarkBitFrom(target); | 1057 MarkBit code_mark = Marking::MarkBitFrom(target); |
1057 heap->mark_compact_collector()->MarkObject(target, code_mark); | 1058 heap->mark_compact_collector()->MarkObject(target, code_mark); |
1058 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 1059 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
1059 } | 1060 } |
1060 | 1061 |
1061 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { | 1062 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { |
1062 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 1063 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 } | 1791 } |
1791 } | 1792 } |
1792 }; | 1793 }; |
1793 | 1794 |
1794 | 1795 |
1795 void MarkCompactCollector::ProcessNewlyMarkedObject(HeapObject* object) { | 1796 void MarkCompactCollector::ProcessNewlyMarkedObject(HeapObject* object) { |
1796 ASSERT(IsMarked(object)); | 1797 ASSERT(IsMarked(object)); |
1797 ASSERT(HEAP->Contains(object)); | 1798 ASSERT(HEAP->Contains(object)); |
1798 if (object->IsMap()) { | 1799 if (object->IsMap()) { |
1799 Map* map = Map::cast(object); | 1800 Map* map = Map::cast(object); |
1800 ClearCacheOnMap(map); | 1801 heap_->ClearCacheOnMap(map); |
1801 | 1802 |
1802 // When map collection is enabled we have to mark through map's transitions | 1803 // When map collection is enabled we have to mark through map's transitions |
1803 // in a special way to make transition links weak. | 1804 // in a special way to make transition links weak. |
1804 // Only maps for subclasses of JSReceiver can have transitions. | 1805 // Only maps for subclasses of JSReceiver can have transitions. |
1805 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); | 1806 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); |
1806 if (collect_maps_ && map->instance_type() >= FIRST_JS_RECEIVER_TYPE) { | 1807 if (collect_maps_ && map->instance_type() >= FIRST_JS_RECEIVER_TYPE) { |
1807 MarkMapContents(map); | 1808 MarkMapContents(map); |
1808 } else { | 1809 } else { |
1809 marking_deque_.PushBlack(map); | 1810 marking_deque_.PushBlack(map); |
1810 } | 1811 } |
(...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4130 while (buffer != NULL) { | 4131 while (buffer != NULL) { |
4131 SlotsBuffer* next_buffer = buffer->next(); | 4132 SlotsBuffer* next_buffer = buffer->next(); |
4132 DeallocateBuffer(buffer); | 4133 DeallocateBuffer(buffer); |
4133 buffer = next_buffer; | 4134 buffer = next_buffer; |
4134 } | 4135 } |
4135 *buffer_address = NULL; | 4136 *buffer_address = NULL; |
4136 } | 4137 } |
4137 | 4138 |
4138 | 4139 |
4139 } } // namespace v8::internal | 4140 } } // namespace v8::internal |
OLD | NEW |