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

Unified Diff: runtime/vm/heap.cc

Issue 206583003: Add 'address' vm service message that finds heap objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 | « runtime/vm/heap.h ('k') | runtime/vm/heap_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
===================================================================
--- runtime/vm/heap.cc (revision 34144)
+++ runtime/vm/heap.cc (working copy)
@@ -162,7 +162,7 @@
}
-RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) {
+RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) const {
// Only executable pages can have RawInstructions objects.
RawObject* raw_obj = old_space_->FindObject(visitor, HeapPage::kExecutable);
ASSERT((raw_obj == Object::null()) ||
@@ -176,6 +176,26 @@
}
+RawObject* Heap::FindNewObject(FindObjectVisitor* visitor) const {
+ return new_space_->FindObject(visitor);
+}
+
+
+RawObject* Heap::FindObject(FindObjectVisitor* visitor) const {
+ ASSERT(Isolate::Current()->no_gc_scope_depth() != 0);
+ RawObject* raw_obj = FindNewObject(visitor);
+ if (raw_obj != Object::null()) {
+ return raw_obj;
+ }
+ raw_obj = FindOldObject(visitor);
+ if (raw_obj != Object::null()) {
+ return raw_obj;
+ }
+ raw_obj = FindObjectInCodeSpace(visitor);
+ return raw_obj;
+}
+
+
void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) {
Isolate* isolate = Isolate::Current();
bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/heap_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698