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 4061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4072 target_page->slots_buffer_address(), | 4072 target_page->slots_buffer_address(), |
4073 SlotsBuffer::CODE_ENTRY_SLOT, | 4073 SlotsBuffer::CODE_ENTRY_SLOT, |
4074 slot, | 4074 slot, |
4075 SlotsBuffer::FAIL_ON_OVERFLOW)) { | 4075 SlotsBuffer::FAIL_ON_OVERFLOW)) { |
4076 EvictEvacuationCandidate(target_page); | 4076 EvictEvacuationCandidate(target_page); |
4077 } | 4077 } |
4078 } | 4078 } |
4079 } | 4079 } |
4080 | 4080 |
4081 | 4081 |
4082 void MarkCompactCollector::RecordCodeTargetPatch(Address pc, Code* target) { | |
4083 ASSERT(heap()->gc_state() == Heap::MARK_COMPACT); | |
4084 if(is_compacting()) { | |
4085 Code* host = heap()->isolate()->inner_pointer_to_code_cache()-> | |
4086 GcSafeFindCodeForInnerPointer(pc); | |
4087 MarkBit mark_bit = Marking::MarkBitFrom(host); | |
4088 ASSERT(Marking::IsBlack(mark_bit)); | |
ulan
2012/10/02 11:39:06
Don't forget to remove this assert :)
Michael Starzinger
2012/10/02 15:44:33
Done. Oops, forgot that.
| |
4089 if (Marking::IsBlack(mark_bit)) { | |
4090 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); | |
4091 RecordRelocSlot(&rinfo, target); | |
4092 } | |
4093 } | |
4094 } | |
4095 | |
4096 | |
4082 static inline SlotsBuffer::SlotType DecodeSlotType( | 4097 static inline SlotsBuffer::SlotType DecodeSlotType( |
4083 SlotsBuffer::ObjectSlot slot) { | 4098 SlotsBuffer::ObjectSlot slot) { |
4084 return static_cast<SlotsBuffer::SlotType>(reinterpret_cast<intptr_t>(slot)); | 4099 return static_cast<SlotsBuffer::SlotType>(reinterpret_cast<intptr_t>(slot)); |
4085 } | 4100 } |
4086 | 4101 |
4087 | 4102 |
4088 void SlotsBuffer::UpdateSlots(Heap* heap) { | 4103 void SlotsBuffer::UpdateSlots(Heap* heap) { |
4089 PointersUpdatingVisitor v(heap); | 4104 PointersUpdatingVisitor v(heap); |
4090 | 4105 |
4091 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... | |
4141 while (buffer != NULL) { | 4156 while (buffer != NULL) { |
4142 SlotsBuffer* next_buffer = buffer->next(); | 4157 SlotsBuffer* next_buffer = buffer->next(); |
4143 DeallocateBuffer(buffer); | 4158 DeallocateBuffer(buffer); |
4144 buffer = next_buffer; | 4159 buffer = next_buffer; |
4145 } | 4160 } |
4146 *buffer_address = NULL; | 4161 *buffer_address = NULL; |
4147 } | 4162 } |
4148 | 4163 |
4149 | 4164 |
4150 } } // namespace v8::internal | 4165 } } // namespace v8::internal |
OLD | NEW |