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

Side by Side Diff: runtime/vm/pages.h

Issue 2622053002: Refactor snapshots pieces to include a section for loading instructions into the heap of a regular … (Closed)
Patch Set: Restore --print-snapshot-sizes Created 3 years, 11 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 RUNTIME_VM_PAGES_H_ 5 #ifndef RUNTIME_VM_PAGES_H_
6 #define RUNTIME_VM_PAGES_H_ 6 #define RUNTIME_VM_PAGES_H_
7 7
8 #include "vm/freelist.h" 8 #include "vm/freelist.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/lockers.h" 10 #include "vm/lockers.h"
(...skipping 10 matching lines...) Expand all
21 21
22 // Forward declarations. 22 // Forward declarations.
23 class Heap; 23 class Heap;
24 class JSONObject; 24 class JSONObject;
25 class ObjectPointerVisitor; 25 class ObjectPointerVisitor;
26 class ObjectSet; 26 class ObjectSet;
27 27
28 // A page containing old generation objects. 28 // A page containing old generation objects.
29 class HeapPage { 29 class HeapPage {
30 public: 30 public:
31 enum PageType { kData = 0, kExecutable, kReadOnlyData, kNumPageTypes }; 31 enum PageType { kData = 0, kExecutable, kNumPageTypes };
siva 2017/01/20 22:53:54 See note in other file about page types.
32 32
33 HeapPage* next() const { return next_; } 33 HeapPage* next() const { return next_; }
34 void set_next(HeapPage* next) { next_ = next; } 34 void set_next(HeapPage* next) { next_ = next; }
35 35
36 bool Contains(uword addr) { return memory_->Contains(addr); } 36 bool Contains(uword addr) { return memory_->Contains(addr); }
37 37
38 uword object_start() const { return memory_->start() + ObjectStartOffset(); } 38 uword object_start() const { return memory_->start() + ObjectStartOffset(); }
39 uword object_end() const { return object_end_; } 39 uword object_end() const { return object_end_; }
40 40
41 PageType type() const { return type_; } 41 PageType type() const { return type_; }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 MutexLocker ml(pages_lock_); 224 MutexLocker ml(pages_lock_);
225 return usage_; 225 return usage_;
226 } 226 }
227 227
228 bool Contains(uword addr) const; 228 bool Contains(uword addr) const;
229 bool Contains(uword addr, HeapPage::PageType type) const; 229 bool Contains(uword addr, HeapPage::PageType type) const;
230 bool DataContains(uword addr) const; 230 bool DataContains(uword addr) const;
231 bool IsValidAddress(uword addr) const { return Contains(addr); } 231 bool IsValidAddress(uword addr) const { return Contains(addr); }
232 232
233 void VisitObjects(ObjectVisitor* visitor) const; 233 void VisitObjects(ObjectVisitor* visitor) const;
234 void VisitObjectsNoEmbedderPages(ObjectVisitor* visitor) const; 234 void VisitObjectsNoExternalPages(ObjectVisitor* visitor) const;
235 void VisitObjectsExternalPages(ObjectVisitor* visitor) const;
siva 2017/01/20 22:53:54 The external page name here is confusing with the
235 void VisitObjectPointers(ObjectPointerVisitor* visitor) const; 236 void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
236 237
237 RawObject* FindObject(FindObjectVisitor* visitor, 238 RawObject* FindObject(FindObjectVisitor* visitor,
238 HeapPage::PageType type) const; 239 HeapPage::PageType type) const;
239 240
240 // Checks if enough time has elapsed since the last attempt to collect 241 // Checks if enough time has elapsed since the last attempt to collect
241 // code. 242 // code.
242 bool ShouldCollectCode(); 243 bool ShouldCollectCode();
243 244
244 // Collect the garbage in the page space using mark-sweep. 245 // Collect the garbage in the page space using mark-sweep.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 friend class HeapIterationScope; 425 friend class HeapIterationScope;
425 friend class PageSpaceController; 426 friend class PageSpaceController;
426 friend class SweeperTask; 427 friend class SweeperTask;
427 428
428 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); 429 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace);
429 }; 430 };
430 431
431 } // namespace dart 432 } // namespace dart
432 433
433 #endif // RUNTIME_VM_PAGES_H_ 434 #endif // RUNTIME_VM_PAGES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698