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 4062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4073 target_page->slots_buffer_address(), | 4073 target_page->slots_buffer_address(), |
4074 SlotsBuffer::CODE_ENTRY_SLOT, | 4074 SlotsBuffer::CODE_ENTRY_SLOT, |
4075 slot, | 4075 slot, |
4076 SlotsBuffer::FAIL_ON_OVERFLOW)) { | 4076 SlotsBuffer::FAIL_ON_OVERFLOW)) { |
4077 EvictEvacuationCandidate(target_page); | 4077 EvictEvacuationCandidate(target_page); |
4078 } | 4078 } |
4079 } | 4079 } |
4080 } | 4080 } |
4081 | 4081 |
4082 | 4082 |
| 4083 void MarkCompactCollector::RecordCodeTargetPatch(Address pc, Code* target) { |
| 4084 ASSERT(heap()->gc_state() == Heap::MARK_COMPACT); |
| 4085 if (is_compacting()) { |
| 4086 Code* host = heap()->isolate()->inner_pointer_to_code_cache()-> |
| 4087 GcSafeFindCodeForInnerPointer(pc); |
| 4088 MarkBit mark_bit = Marking::MarkBitFrom(host); |
| 4089 if (Marking::IsBlack(mark_bit)) { |
| 4090 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); |
| 4091 RecordRelocSlot(&rinfo, target); |
| 4092 } |
| 4093 } |
| 4094 } |
| 4095 |
| 4096 |
4083 static inline SlotsBuffer::SlotType DecodeSlotType( | 4097 static inline SlotsBuffer::SlotType DecodeSlotType( |
4084 SlotsBuffer::ObjectSlot slot) { | 4098 SlotsBuffer::ObjectSlot slot) { |
4085 return static_cast<SlotsBuffer::SlotType>(reinterpret_cast<intptr_t>(slot)); | 4099 return static_cast<SlotsBuffer::SlotType>(reinterpret_cast<intptr_t>(slot)); |
4086 } | 4100 } |
4087 | 4101 |
4088 | 4102 |
4089 void SlotsBuffer::UpdateSlots(Heap* heap) { | 4103 void SlotsBuffer::UpdateSlots(Heap* heap) { |
4090 PointersUpdatingVisitor v(heap); | 4104 PointersUpdatingVisitor v(heap); |
4091 | 4105 |
4092 for (int slot_idx = 0; slot_idx < idx_; ++slot_idx) { | 4106 for (int slot_idx = 0; slot_idx < idx_; ++slot_idx) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4142 while (buffer != NULL) { | 4156 while (buffer != NULL) { |
4143 SlotsBuffer* next_buffer = buffer->next(); | 4157 SlotsBuffer* next_buffer = buffer->next(); |
4144 DeallocateBuffer(buffer); | 4158 DeallocateBuffer(buffer); |
4145 buffer = next_buffer; | 4159 buffer = next_buffer; |
4146 } | 4160 } |
4147 *buffer_address = NULL; | 4161 *buffer_address = NULL; |
4148 } | 4162 } |
4149 | 4163 |
4150 | 4164 |
4151 } } // namespace v8::internal | 4165 } } // namespace v8::internal |
OLD | NEW |