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 } | 229 } |
230 | 230 |
231 if (PromoteObject<object_contents, alignment>(map, slot, object, | 231 if (PromoteObject<object_contents, alignment>(map, slot, object, |
232 object_size)) { | 232 object_size)) { |
233 return; | 233 return; |
234 } | 234 } |
235 | 235 |
236 // If promotion failed, we try to copy the object to the other semi-space | 236 // If promotion failed, we try to copy the object to the other semi-space |
237 if (SemiSpaceCopyObject<alignment>(map, slot, object, object_size)) return; | 237 if (SemiSpaceCopyObject<alignment>(map, slot, object, object_size)) return; |
238 | 238 |
239 UNREACHABLE(); | 239 FatalProcessOutOfMemory("Scavenger: semi-space copy\n"); |
240 } | 240 } |
241 | 241 |
242 | 242 |
243 static inline void EvacuateJSFunction(Map* map, HeapObject** slot, | 243 static inline void EvacuateJSFunction(Map* map, HeapObject** slot, |
244 HeapObject* object) { | 244 HeapObject* object) { |
245 ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized< | 245 ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized< |
246 JSFunction::kSize>(map, slot, object); | 246 JSFunction::kSize>(map, slot, object); |
247 | 247 |
248 MapWord map_word = object->map_word(); | 248 MapWord map_word = object->map_word(); |
249 DCHECK(map_word.IsForwardingAddress()); | 249 DCHECK(map_word.IsForwardingAddress()); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 487 |
488 void ScavengeVisitor::ScavengePointer(Object** p) { | 488 void ScavengeVisitor::ScavengePointer(Object** p) { |
489 Object* object = *p; | 489 Object* object = *p; |
490 if (!heap_->InNewSpace(object)) return; | 490 if (!heap_->InNewSpace(object)) return; |
491 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 491 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
492 reinterpret_cast<HeapObject*>(object)); | 492 reinterpret_cast<HeapObject*>(object)); |
493 } | 493 } |
494 | 494 |
495 } // namespace internal | 495 } // namespace internal |
496 } // namespace v8 | 496 } // namespace v8 |
OLD | NEW |