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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | 876 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); |
877 MarkBit mark = Marking::MarkBitFrom(object); | 877 MarkBit mark = Marking::MarkBitFrom(object); |
878 heap->mark_compact_collector()->MarkObject(object, mark); | 878 heap->mark_compact_collector()->MarkObject(object, mark); |
879 } | 879 } |
880 | 880 |
881 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | 881 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { |
882 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 882 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
883 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 883 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
884 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { | 884 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { |
885 IC::Clear(rinfo->pc()); | 885 IC::Clear(rinfo->pc()); |
886 // Please note targets for cleared inline cached do not have to be | |
887 // marked since they are contained in HEAP->non_monomorphic_cache(). | |
888 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 886 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
889 } else { | 887 } else { |
890 if (FLAG_cleanup_code_caches_at_gc && | 888 if (FLAG_cleanup_code_caches_at_gc && |
891 target->kind() == Code::STUB && | 889 target->kind() == Code::STUB && |
892 target->major_key() == CodeStub::CallFunction && | 890 target->major_key() == CodeStub::CallFunction && |
893 target->has_function_cache()) { | 891 target->has_function_cache()) { |
894 CallFunctionStub::Clear(heap, rinfo->pc()); | 892 CallFunctionStub::Clear(heap, rinfo->pc()); |
895 } | 893 } |
896 MarkBit code_mark = Marking::MarkBitFrom(target); | |
897 heap->mark_compact_collector()->MarkObject(target, code_mark); | |
898 } | 894 } |
| 895 MarkBit code_mark = Marking::MarkBitFrom(target); |
| 896 heap->mark_compact_collector()->MarkObject(target, code_mark); |
| 897 |
899 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 898 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
900 } | 899 } |
901 | 900 |
902 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { | 901 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { |
903 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 902 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
904 rinfo->IsPatchedReturnSequence()) || | 903 rinfo->IsPatchedReturnSequence()) || |
905 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && | 904 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && |
906 rinfo->IsPatchedDebugBreakSlotSequence())); | 905 rinfo->IsPatchedDebugBreakSlotSequence())); |
907 Code* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); | 906 Code* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); |
908 MarkBit code_mark = Marking::MarkBitFrom(target); | 907 MarkBit code_mark = Marking::MarkBitFrom(target); |
(...skipping 2995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3904 while (buffer != NULL) { | 3903 while (buffer != NULL) { |
3905 SlotsBuffer* next_buffer = buffer->next(); | 3904 SlotsBuffer* next_buffer = buffer->next(); |
3906 DeallocateBuffer(buffer); | 3905 DeallocateBuffer(buffer); |
3907 buffer = next_buffer; | 3906 buffer = next_buffer; |
3908 } | 3907 } |
3909 *buffer_address = NULL; | 3908 *buffer_address = NULL; |
3910 } | 3909 } |
3911 | 3910 |
3912 | 3911 |
3913 } } // namespace v8::internal | 3912 } } // namespace v8::internal |
OLD | NEW |