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 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2751 Address dst_slot = dst; | 2751 Address dst_slot = dst; |
2752 ASSERT(IsAligned(size, kPointerSize)); | 2752 ASSERT(IsAligned(size, kPointerSize)); |
2753 | 2753 |
2754 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { | 2754 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { |
2755 Object* value = Memory::Object_at(src_slot); | 2755 Object* value = Memory::Object_at(src_slot); |
2756 | 2756 |
2757 Memory::Object_at(dst_slot) = value; | 2757 Memory::Object_at(dst_slot) = value; |
2758 | 2758 |
2759 if (heap_->InNewSpace(value)) { | 2759 if (heap_->InNewSpace(value)) { |
2760 heap_->store_buffer()->Mark(dst_slot); | 2760 heap_->store_buffer()->Mark(dst_slot); |
2761 } else if (value->IsHeapObject() && IsOnEvacuationCandidate(value)) { | 2761 } else if (value->IsHeapObject() && |
| 2762 !IsCodeEntry(src, value) && |
| 2763 IsOnEvacuationCandidate(value)) { |
2762 SlotsBuffer::AddTo(&slots_buffer_allocator_, | 2764 SlotsBuffer::AddTo(&slots_buffer_allocator_, |
2763 &migration_slots_buffer_, | 2765 &migration_slots_buffer_, |
2764 reinterpret_cast<Object**>(dst_slot), | 2766 reinterpret_cast<Object**>(dst_slot), |
2765 SlotsBuffer::IGNORE_OVERFLOW); | 2767 SlotsBuffer::IGNORE_OVERFLOW); |
2766 } | 2768 } |
2767 | 2769 |
2768 src_slot += kPointerSize; | 2770 src_slot += kPointerSize; |
2769 dst_slot += kPointerSize; | 2771 dst_slot += kPointerSize; |
2770 } | 2772 } |
2771 | 2773 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2823 rinfo->set_target_object(target); | 2825 rinfo->set_target_object(target); |
2824 } | 2826 } |
2825 } | 2827 } |
2826 | 2828 |
2827 void VisitCodeTarget(RelocInfo* rinfo) { | 2829 void VisitCodeTarget(RelocInfo* rinfo) { |
2828 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 2830 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
2829 Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 2831 Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
2830 Object* old_target = target; | 2832 Object* old_target = target; |
2831 VisitPointer(&target); | 2833 VisitPointer(&target); |
2832 if (target != old_target) { | 2834 if (target != old_target) { |
2833 rinfo->set_target_address(Code::cast(target)->instruction_start()); | 2835 rinfo->set_target_address(Code::cast(target)->entry()); |
2834 } | 2836 } |
2835 } | 2837 } |
2836 | 2838 |
2837 void VisitCodeAgeSequence(RelocInfo* rinfo) { | 2839 void VisitCodeAgeSequence(RelocInfo* rinfo) { |
2838 ASSERT(RelocInfo::IsCodeAgeSequence(rinfo->rmode())); | 2840 ASSERT(RelocInfo::IsCodeAgeSequence(rinfo->rmode())); |
2839 Object* stub = rinfo->code_age_stub(); | 2841 Object* stub = rinfo->code_age_stub(); |
2840 ASSERT(stub != NULL); | 2842 ASSERT(stub != NULL); |
2841 VisitPointer(&stub); | 2843 VisitPointer(&stub); |
2842 if (stub != rinfo->code_age_stub()) { | 2844 if (stub != rinfo->code_age_stub()) { |
2843 rinfo->set_code_age_stub(Code::cast(stub)); | 2845 rinfo->set_code_age_stub(Code::cast(stub)); |
2844 } | 2846 } |
2845 } | 2847 } |
2846 | 2848 |
2847 void VisitDebugTarget(RelocInfo* rinfo) { | 2849 void VisitDebugTarget(RelocInfo* rinfo) { |
2848 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 2850 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
2849 rinfo->IsPatchedReturnSequence()) || | 2851 rinfo->IsPatchedReturnSequence()) || |
2850 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && | 2852 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && |
2851 rinfo->IsPatchedDebugBreakSlotSequence())); | 2853 rinfo->IsPatchedDebugBreakSlotSequence())); |
2852 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); | 2854 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address()); |
2853 VisitPointer(&target); | 2855 VisitPointer(&target); |
2854 rinfo->set_call_address(Code::cast(target)->instruction_start()); | 2856 rinfo->set_call_address(Code::cast(target)->entry()); |
2855 } | 2857 } |
2856 | 2858 |
2857 static inline void UpdateSlot(Heap* heap, Object** slot) { | 2859 static inline void UpdateSlot(Heap* heap, Object** slot) { |
2858 Object* obj = *slot; | 2860 Object* obj = *slot; |
2859 | 2861 |
2860 if (!obj->IsHeapObject()) return; | 2862 if (!obj->IsHeapObject()) return; |
2861 | 2863 |
2862 HeapObject* heap_obj = HeapObject::cast(obj); | 2864 HeapObject* heap_obj = HeapObject::cast(obj); |
2863 | 2865 |
2864 MapWord map_word = heap_obj->map_word(); | 2866 MapWord map_word = heap_obj->map_word(); |
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4333 while (buffer != NULL) { | 4335 while (buffer != NULL) { |
4334 SlotsBuffer* next_buffer = buffer->next(); | 4336 SlotsBuffer* next_buffer = buffer->next(); |
4335 DeallocateBuffer(buffer); | 4337 DeallocateBuffer(buffer); |
4336 buffer = next_buffer; | 4338 buffer = next_buffer; |
4337 } | 4339 } |
4338 *buffer_address = NULL; | 4340 *buffer_address = NULL; |
4339 } | 4341 } |
4340 | 4342 |
4341 | 4343 |
4342 } } // namespace v8::internal | 4344 } } // namespace v8::internal |
OLD | NEW |