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

Unified Diff: runtime/vm/heap.cc

Issue 10905251: Lazy peer API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index aa766e0c83137589dc43a180e017f201ee7b7e07..70e6a5e42eb9e566ab079761944f839b2fe25013 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -362,6 +362,30 @@ const char* Heap::GCReasonToString(GCReason gc_reason) {
}
+void Heap::SetPeer(RawObject* raw_obj, void* peer) {
+ if (raw_obj->IsNewObject()) {
+ new_space_->SetPeer(raw_obj, peer);
+ } else {
+ ASSERT(raw_obj->IsOldObject());
+ old_space_->SetPeer(raw_obj, peer);
+ }
+}
+
+
+void* Heap::GetPeer(RawObject* raw_obj) {
+ if (raw_obj->IsNewObject()) {
+ return new_space_->GetPeer(raw_obj);
+ }
+ ASSERT(raw_obj->IsOldObject());
+ return old_space_->GetPeer(raw_obj);
+}
+
+
+int64_t Heap::PeerCount() const {
+ return new_space_->PeerCount() + old_space_->PeerCount();
+}
+
+
#if defined(DEBUG)
NoGCScope::NoGCScope() : StackResource(Isolate::Current()) {
isolate()->IncrementNoGCScopeDepth();

Powered by Google App Engine
This is Rietveld 408576698