OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | 834 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); |
835 MarkBit mark = Marking::MarkBitFrom(object); | 835 MarkBit mark = Marking::MarkBitFrom(object); |
836 heap->mark_compact_collector()->MarkObject(object, mark); | 836 heap->mark_compact_collector()->MarkObject(object, mark); |
837 } | 837 } |
838 | 838 |
839 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | 839 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { |
840 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 840 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
841 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 841 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
842 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { | 842 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { |
843 IC::Clear(rinfo->pc()); | 843 IC::Clear(rinfo->pc()); |
844 // Please note targets for cleared inline cached do not have to be | |
845 // marked since they are contained in HEAP->non_monomorphic_cache(). | |
846 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 844 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
847 } else { | 845 } else { |
848 if (FLAG_cleanup_code_caches_at_gc && | 846 if (FLAG_cleanup_code_caches_at_gc && |
849 target->kind() == Code::STUB && | 847 target->kind() == Code::STUB && |
850 target->major_key() == CodeStub::CallFunction && | 848 target->major_key() == CodeStub::CallFunction && |
851 target->has_function_cache()) { | 849 target->has_function_cache()) { |
852 CallFunctionStub::Clear(heap, rinfo->pc()); | 850 CallFunctionStub::Clear(heap, rinfo->pc()); |
853 } | 851 } |
854 MarkBit code_mark = Marking::MarkBitFrom(target); | |
855 heap->mark_compact_collector()->MarkObject(target, code_mark); | |
856 } | 852 } |
| 853 MarkBit code_mark = Marking::MarkBitFrom(target); |
| 854 heap->mark_compact_collector()->MarkObject(target, code_mark); |
| 855 |
857 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 856 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
858 } | 857 } |
859 | 858 |
860 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { | 859 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { |
861 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 860 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
862 rinfo->IsPatchedReturnSequence()) || | 861 rinfo->IsPatchedReturnSequence()) || |
863 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && | 862 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && |
864 rinfo->IsPatchedDebugBreakSlotSequence())); | 863 rinfo->IsPatchedDebugBreakSlotSequence())); |
865 Code* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); | 864 Code* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); |
866 MarkBit code_mark = Marking::MarkBitFrom(target); | 865 MarkBit code_mark = Marking::MarkBitFrom(target); |
(...skipping 2906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3773 while (buffer != NULL) { | 3772 while (buffer != NULL) { |
3774 SlotsBuffer* next_buffer = buffer->next(); | 3773 SlotsBuffer* next_buffer = buffer->next(); |
3775 DeallocateBuffer(buffer); | 3774 DeallocateBuffer(buffer); |
3776 buffer = next_buffer; | 3775 buffer = next_buffer; |
3777 } | 3776 } |
3778 *buffer_address = NULL; | 3777 *buffer_address = NULL; |
3779 } | 3778 } |
3780 | 3779 |
3781 | 3780 |
3782 } } // namespace v8::internal | 3781 } } // namespace v8::internal |
OLD | NEW |