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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 for (Object** p = start; p < end; p++) { | 1071 for (Object** p = start; p < end; p++) { |
1072 MarkObjectByPointer(collector, start, p); | 1072 MarkObjectByPointer(collector, start, p); |
1073 } | 1073 } |
1074 } | 1074 } |
1075 | 1075 |
1076 INLINE(static void MarkObject(Heap* heap, HeapObject* object)) { | 1076 INLINE(static void MarkObject(Heap* heap, HeapObject* object)) { |
1077 MarkBit mark = Marking::MarkBitFrom(object); | 1077 MarkBit mark = Marking::MarkBitFrom(object); |
1078 heap->mark_compact_collector()->MarkObject(object, mark); | 1078 heap->mark_compact_collector()->MarkObject(object, mark); |
1079 } | 1079 } |
1080 | 1080 |
1081 static inline void VisitEmbeddedPointer(Heap* heap, RelocInfo* rinfo) { | |
1082 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); | |
1083 // TODO(mstarzinger): We do not short-circuit cons strings here, verify | |
1084 // that there can be no such embedded pointers and add assertion here. | |
1085 HeapObject* object = HeapObject::cast(rinfo->target_object()); | |
1086 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | |
1087 MarkObject(heap, object); | |
1088 } | |
1089 | |
1090 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | 1081 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { |
1091 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 1082 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
1092 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 1083 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
1093 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() | 1084 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
1094 && (target->ic_state() == MEGAMORPHIC || | 1085 && (target->ic_state() == MEGAMORPHIC || |
1095 heap->mark_compact_collector()->flush_monomorphic_ics_ || | 1086 heap->mark_compact_collector()->flush_monomorphic_ics_ || |
1096 target->ic_age() != heap->global_ic_age())) { | 1087 target->ic_age() != heap->global_ic_age())) { |
1097 IC::Clear(rinfo->pc()); | 1088 IC::Clear(rinfo->pc()); |
1098 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 1089 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
1099 } | 1090 } |
(...skipping 3148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4248 while (buffer != NULL) { | 4239 while (buffer != NULL) { |
4249 SlotsBuffer* next_buffer = buffer->next(); | 4240 SlotsBuffer* next_buffer = buffer->next(); |
4250 DeallocateBuffer(buffer); | 4241 DeallocateBuffer(buffer); |
4251 buffer = next_buffer; | 4242 buffer = next_buffer; |
4252 } | 4243 } |
4253 *buffer_address = NULL; | 4244 *buffer_address = NULL; |
4254 } | 4245 } |
4255 | 4246 |
4256 | 4247 |
4257 } } // namespace v8::internal | 4248 } } // namespace v8::internal |
OLD | NEW |