| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/heap/scavenger.h" | 5 #include "src/heap/scavenger.h" |
| 6 | 6 |
| 7 #include "src/contexts.h" | 7 #include "src/contexts.h" |
| 8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
| 9 #include "src/heap/objects-visiting-inl.h" | 9 #include "src/heap/objects-visiting-inl.h" |
| 10 #include "src/heap/scavenger-inl.h" | 10 #include "src/heap/scavenger-inl.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 if (marks_handling == IGNORE_MARKS) return; | 229 if (marks_handling == IGNORE_MARKS) return; |
| 230 | 230 |
| 231 MapWord map_word = object->map_word(); | 231 MapWord map_word = object->map_word(); |
| 232 DCHECK(map_word.IsForwardingAddress()); | 232 DCHECK(map_word.IsForwardingAddress()); |
| 233 HeapObject* target = map_word.ToForwardingAddress(); | 233 HeapObject* target = map_word.ToForwardingAddress(); |
| 234 | 234 |
| 235 MarkBit mark_bit = Marking::MarkBitFrom(target); | 235 MarkBit mark_bit = Marking::MarkBitFrom(target); |
| 236 if (Marking::IsBlack(mark_bit)) { | 236 if (Marking::IsBlack(mark_bit)) { |
| 237 // This object is black and it might not be rescanned by marker. | 237 // This object is black and it might not be rescanned by marker. |
| 238 // We should explicitly record code entry slot for compaction because | 238 // We should explicitly record code entry slot for compaction because |
| 239 // promotion queue processing (IterateAndMarkPointersToFromSpace) will | 239 // promotion queue processing (IteratePromotedObjectPointers) will |
| 240 // miss it as it is not HeapObject-tagged. | 240 // miss it as it is not HeapObject-tagged. |
| 241 Address code_entry_slot = | 241 Address code_entry_slot = |
| 242 target->address() + JSFunction::kCodeEntryOffset; | 242 target->address() + JSFunction::kCodeEntryOffset; |
| 243 Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot)); | 243 Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot)); |
| 244 map->GetHeap()->mark_compact_collector()->RecordCodeEntrySlot( | 244 map->GetHeap()->mark_compact_collector()->RecordCodeEntrySlot( |
| 245 target, code_entry_slot, code); | 245 target, code_entry_slot, code); |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 | 249 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 | 459 |
| 460 void ScavengeVisitor::ScavengePointer(Object** p) { | 460 void ScavengeVisitor::ScavengePointer(Object** p) { |
| 461 Object* object = *p; | 461 Object* object = *p; |
| 462 if (!heap_->InNewSpace(object)) return; | 462 if (!heap_->InNewSpace(object)) return; |
| 463 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 463 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
| 464 reinterpret_cast<HeapObject*>(object)); | 464 reinterpret_cast<HeapObject*>(object)); |
| 465 } | 465 } |
| 466 | 466 |
| 467 } // namespace internal | 467 } // namespace internal |
| 468 } // namespace v8 | 468 } // namespace v8 |
| OLD | NEW |