| 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(). |
| 886 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 888 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 887 } else { | 889 } else { |
| 888 if (FLAG_cleanup_code_caches_at_gc && | 890 if (FLAG_cleanup_code_caches_at_gc && |
| 889 target->kind() == Code::STUB && | 891 target->kind() == Code::STUB && |
| 890 target->major_key() == CodeStub::CallFunction && | 892 target->major_key() == CodeStub::CallFunction && |
| 891 target->has_function_cache()) { | 893 target->has_function_cache()) { |
| 892 CallFunctionStub::Clear(heap, rinfo->pc()); | 894 CallFunctionStub::Clear(heap, rinfo->pc()); |
| 893 } | 895 } |
| 896 MarkBit code_mark = Marking::MarkBitFrom(target); |
| 897 heap->mark_compact_collector()->MarkObject(target, code_mark); |
| 894 } | 898 } |
| 895 MarkBit code_mark = Marking::MarkBitFrom(target); | |
| 896 heap->mark_compact_collector()->MarkObject(target, code_mark); | |
| 897 | |
| 898 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 899 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
| 899 } | 900 } |
| 900 | 901 |
| 901 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { | 902 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { |
| 902 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 903 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
| 903 rinfo->IsPatchedReturnSequence()) || | 904 rinfo->IsPatchedReturnSequence()) || |
| 904 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && | 905 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && |
| 905 rinfo->IsPatchedDebugBreakSlotSequence())); | 906 rinfo->IsPatchedDebugBreakSlotSequence())); |
| 906 Code* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); | 907 Code* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); |
| 907 MarkBit code_mark = Marking::MarkBitFrom(target); | 908 MarkBit code_mark = Marking::MarkBitFrom(target); |
| (...skipping 2995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3903 while (buffer != NULL) { | 3904 while (buffer != NULL) { |
| 3904 SlotsBuffer* next_buffer = buffer->next(); | 3905 SlotsBuffer* next_buffer = buffer->next(); |
| 3905 DeallocateBuffer(buffer); | 3906 DeallocateBuffer(buffer); |
| 3906 buffer = next_buffer; | 3907 buffer = next_buffer; |
| 3907 } | 3908 } |
| 3908 *buffer_address = NULL; | 3909 *buffer_address = NULL; |
| 3909 } | 3910 } |
| 3910 | 3911 |
| 3911 | 3912 |
| 3912 } } // namespace v8::internal | 3913 } } // namespace v8::internal |
| OLD | NEW |