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

Side by Side Diff: vm/scavenger.h

Issue 10797021: - Start using the collected store buffer entries to find (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/scanner.cc ('k') | vm/scavenger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_SCAVENGER_H_ 5 #ifndef VM_SCAVENGER_H_
6 #define VM_SCAVENGER_H_ 6 #define VM_SCAVENGER_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/utils.h" 9 #include "platform/utils.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
11 #include "vm/globals.h" 11 #include "vm/globals.h"
12 #include "vm/raw_object.h" 12 #include "vm/raw_object.h"
13 #include "vm/virtual_memory.h" 13 #include "vm/virtual_memory.h"
14 #include "vm/visitor.h" 14 #include "vm/visitor.h"
15 15
16 namespace dart { 16 namespace dart {
17 17
18 // Forward declarations. 18 // Forward declarations.
19 class Heap; 19 class Heap;
20 class Isolate; 20 class Isolate;
21 class ScavengerVisitor;
21 22
22 DECLARE_FLAG(bool, gc_at_alloc); 23 DECLARE_FLAG(bool, gc_at_alloc);
23 24
24 class Scavenger { 25 class Scavenger {
25 public: 26 public:
26 Scavenger(Heap* heap, intptr_t max_capacity, uword object_alignment); 27 Scavenger(Heap* heap, intptr_t max_capacity, uword object_alignment);
27 ~Scavenger(); 28 ~Scavenger();
28 29
29 // Check whether this Scavenger contains this address. 30 // Check whether this Scavenger contains this address.
30 // During scavenging both the to and from spaces contain "legal" objects. 31 // During scavenging both the to and from spaces contain "legal" objects.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 81 }
81 82
82 // Returns true if the last scavenge had a promotion failure. 83 // Returns true if the last scavenge had a promotion failure.
83 bool HadPromotionFailure() { 84 bool HadPromotionFailure() {
84 return had_promotion_failure_; 85 return had_promotion_failure_;
85 } 86 }
86 87
87 private: 88 private:
88 uword FirstObjectStart() const { return to_->start() | object_alignment_; } 89 uword FirstObjectStart() const { return to_->start() | object_alignment_; }
89 void Prologue(Isolate* isolate, bool invoke_api_callbacks); 90 void Prologue(Isolate* isolate, bool invoke_api_callbacks);
91 void IterateStoreBuffers(Isolate* isolate, ScavengerVisitor* visitor);
90 void IterateRoots(Isolate* isolate, 92 void IterateRoots(Isolate* isolate,
91 ObjectPointerVisitor* visitor, 93 ScavengerVisitor* visitor,
92 bool visit_prologue_weak_persistent_handles); 94 bool visit_prologue_weak_persistent_handles);
93 void IterateWeakReferences(Isolate* isolate, ObjectPointerVisitor* visitor); 95 void IterateWeakReferences(Isolate* isolate, ScavengerVisitor* visitor);
94 void IterateWeakRoots(Isolate* isolate, 96 void IterateWeakRoots(Isolate* isolate,
95 HandleVisitor* visitor, 97 HandleVisitor* visitor,
96 bool visit_prologue_weak_persistent_handles); 98 bool visit_prologue_weak_persistent_handles);
97 void ProcessToSpace(ObjectPointerVisitor* visitor); 99 void ProcessToSpace(ScavengerVisitor* visitor);
98 void Epilogue(Isolate* isolate, bool invoke_api_callbacks); 100 void Epilogue(Isolate* isolate, bool invoke_api_callbacks);
99 101
100 bool IsUnreachable(RawObject** p); 102 bool IsUnreachable(RawObject** p);
101 103
102 // During a scavenge we need to remember the promoted objects. 104 // During a scavenge we need to remember the promoted objects.
103 // This is implemented as a stack of objects at the end of the to space. As 105 // This is implemented as a stack of objects at the end of the to space. As
104 // object sizes are always greater than sizeof(uword) and promoted objects do 106 // object sizes are always greater than sizeof(uword) and promoted objects do
105 // not consume space in the to space they leave enough room for this stack. 107 // not consume space in the to space they leave enough room for this stack.
106 void PushToPromotedStack(uword addr) { 108 void PushToPromotedStack(uword addr) {
107 end_ -= sizeof(addr); 109 end_ -= sizeof(addr);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 150
149 friend class ScavengerVisitor; 151 friend class ScavengerVisitor;
150 friend class ScavengerWeakVisitor; 152 friend class ScavengerWeakVisitor;
151 153
152 DISALLOW_COPY_AND_ASSIGN(Scavenger); 154 DISALLOW_COPY_AND_ASSIGN(Scavenger);
153 }; 155 };
154 156
155 } // namespace dart 157 } // namespace dart
156 158
157 #endif // VM_SCAVENGER_H_ 159 #endif // VM_SCAVENGER_H_
OLDNEW
« no previous file with comments | « vm/scanner.cc ('k') | vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698