Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1070)

Unified Diff: src/heap.cc

Issue 3382007: [Isolates] ScavengeVisitor gets member Heap*. (Closed)
Patch Set: fixed per review comments Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast.cc ('k') | src/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index f140f8aa65d6ec9765aad55ef780ba0a3b4a563a..66aae6c58175035aeec329e3779466197aa90258 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -816,6 +816,8 @@ Object* Heap::FindCodeObject(Address a) {
// Helper class for copying HeapObjects
class ScavengeVisitor: public ObjectVisitor {
public:
+ explicit ScavengeVisitor(Heap* heap) : heap_(heap) {}
+
void VisitPointer(Object** p) { ScavengePointer(p); }
void VisitPointers(Object** start, Object** end) {
@@ -826,10 +828,12 @@ class ScavengeVisitor: public ObjectVisitor {
private:
void ScavengePointer(Object** p) {
Object* object = *p;
- if (!HEAP->InNewSpace(object)) return;
+ if (!heap_->InNewSpace(object)) return;
Heap::ScavengeObject(reinterpret_cast<HeapObject**>(p),
reinterpret_cast<HeapObject*>(object));
}
+
+ Heap* heap_;
};
@@ -883,7 +887,7 @@ void Heap::Scavenge() {
gc_state_ = SCAVENGE;
- Page::FlipMeaningOfInvalidatedWatermarkFlag();
+ Page::FlipMeaningOfInvalidatedWatermarkFlag(this);
#ifdef DEBUG
VerifyPageWatermarkValidity(old_pointer_space_, ALL_VALID);
VerifyPageWatermarkValidity(map_space_, ALL_VALID);
@@ -934,7 +938,7 @@ void Heap::Scavenge() {
promotion_queue_.Initialize(new_space_.ToSpaceHigh());
is_safe_to_read_maps_ = false;
- ScavengeVisitor scavenge_visitor;
+ ScavengeVisitor scavenge_visitor(this);
// Copy roots.
IterateRoots(&scavenge_visitor, VISIT_ALL_IN_SCAVENGE);
« no previous file with comments | « src/ast.cc ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698