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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 target->address() + JSFunction::kCodeEntryOffset; | 259 target->address() + JSFunction::kCodeEntryOffset; |
260 Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot)); | 260 Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot)); |
261 map->GetHeap()->mark_compact_collector()->RecordCodeEntrySlot( | 261 map->GetHeap()->mark_compact_collector()->RecordCodeEntrySlot( |
262 target, code_entry_slot, code); | 262 target, code_entry_slot, code); |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
266 | 266 |
267 static inline void EvacuateFixedArray(Map* map, HeapObject** slot, | 267 static inline void EvacuateFixedArray(Map* map, HeapObject** slot, |
268 HeapObject* object) { | 268 HeapObject* object) { |
269 int object_size = FixedArray::BodyDescriptor::SizeOf(map, object); | 269 int length = reinterpret_cast<FixedArray*>(object)->synchronized_length(); |
| 270 int object_size = FixedArray::SizeFor(length); |
270 EvacuateObject<POINTER_OBJECT, kWordAligned>(map, slot, object, | 271 EvacuateObject<POINTER_OBJECT, kWordAligned>(map, slot, object, |
271 object_size); | 272 object_size); |
272 } | 273 } |
273 | 274 |
274 | 275 |
275 static inline void EvacuateFixedDoubleArray(Map* map, HeapObject** slot, | 276 static inline void EvacuateFixedDoubleArray(Map* map, HeapObject** slot, |
276 HeapObject* object) { | 277 HeapObject* object) { |
277 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); | 278 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); |
278 int object_size = FixedDoubleArray::SizeFor(length); | 279 int object_size = FixedDoubleArray::SizeFor(length); |
279 EvacuateObject<DATA_OBJECT, kDoubleAligned>(map, slot, object, object_size); | 280 EvacuateObject<DATA_OBJECT, kDoubleAligned>(map, slot, object, object_size); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 488 |
488 void ScavengeVisitor::ScavengePointer(Object** p) { | 489 void ScavengeVisitor::ScavengePointer(Object** p) { |
489 Object* object = *p; | 490 Object* object = *p; |
490 if (!heap_->InNewSpace(object)) return; | 491 if (!heap_->InNewSpace(object)) return; |
491 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 492 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
492 reinterpret_cast<HeapObject*>(object)); | 493 reinterpret_cast<HeapObject*>(object)); |
493 } | 494 } |
494 | 495 |
495 } // namespace internal | 496 } // namespace internal |
496 } // namespace v8 | 497 } // namespace v8 |
OLD | NEW |