| 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-inl.h" | 8 #include "src/heap/heap-inl.h" |
| 9 #include "src/heap/incremental-marking.h" | 9 #include "src/heap/incremental-marking.h" |
| 10 #include "src/heap/objects-visiting-inl.h" | 10 #include "src/heap/objects-visiting-inl.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 StaticVisitorBase::kVisitThinString, | 453 StaticVisitorBase::kVisitThinString, |
| 454 &ScavengingVisitor<TRANSFER_MARKS, LOGGING_AND_PROFILING_DISABLED>:: | 454 &ScavengingVisitor<TRANSFER_MARKS, LOGGING_AND_PROFILING_DISABLED>:: |
| 455 EvacuateThinStringNoShortcut); | 455 EvacuateThinStringNoShortcut); |
| 456 } | 456 } |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 | 460 |
| 461 Isolate* Scavenger::isolate() { return heap()->isolate(); } | 461 Isolate* Scavenger::isolate() { return heap()->isolate(); } |
| 462 | 462 |
| 463 void RootScavengeVisitor::VisitPointer(Object** p) { ScavengePointer(p); } |
| 463 | 464 |
| 464 void ScavengeVisitor::VisitPointer(Object** p) { ScavengePointer(p); } | 465 void RootScavengeVisitor::VisitPointers(Object** start, Object** end) { |
| 465 | |
| 466 | |
| 467 void ScavengeVisitor::VisitPointers(Object** start, Object** end) { | |
| 468 // Copy all HeapObject pointers in [start, end) | 466 // Copy all HeapObject pointers in [start, end) |
| 469 for (Object** p = start; p < end; p++) ScavengePointer(p); | 467 for (Object** p = start; p < end; p++) ScavengePointer(p); |
| 470 } | 468 } |
| 471 | 469 |
| 470 void RootScavengeVisitor::VisitRootPointer(Root root, Object** p) { |
| 471 ScavengePointer(p); |
| 472 } |
| 472 | 473 |
| 473 void ScavengeVisitor::ScavengePointer(Object** p) { | 474 void RootScavengeVisitor::VisitRootPointers(Root root, Object** start, |
| 475 Object** end) { |
| 476 // Copy all HeapObject pointers in [start, end) |
| 477 for (Object** p = start; p < end; p++) ScavengePointer(p); |
| 478 } |
| 479 |
| 480 void RootScavengeVisitor::ScavengePointer(Object** p) { |
| 474 Object* object = *p; | 481 Object* object = *p; |
| 475 if (!heap_->InNewSpace(object)) return; | 482 if (!heap_->InNewSpace(object)) return; |
| 476 | 483 |
| 477 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 484 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
| 478 reinterpret_cast<HeapObject*>(object)); | 485 reinterpret_cast<HeapObject*>(object)); |
| 479 } | 486 } |
| 480 | 487 |
| 481 } // namespace internal | 488 } // namespace internal |
| 482 } // namespace v8 | 489 } // namespace v8 |
| OLD | NEW |