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

Unified Diff: runtime/vm/service.cc

Issue 1250923003: Fix decoration of ObjectPool references to stubs broken by their movement to VM isolate. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index de3f48d391d19764e521a7bacc6b9e1edca8588a..a75f897e20f5ef04acd866514b3c684733875cc1 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -2574,6 +2574,29 @@ static const MethodParameter* get_object_by_address_params[] = {
};
+static RawObject* GetObjectHelper(Isolate* isolate, uword addr) {
+ Object& object = Object::Handle(isolate);
+
+ {
+ NoSafepointScope no_safepoint;
+ ContainsAddressVisitor visitor(isolate, addr);
+ object = isolate->heap()->FindObject(&visitor);
+ }
+
+ if (!object.IsNull()) {
+ return object.raw();
+ }
+
+ {
+ NoSafepointScope no_safepoint;
+ ContainsAddressVisitor visitor(Dart::vm_isolate(), addr);
+ object = Dart::vm_isolate()->heap()->FindObject(&visitor);
+ }
+
+ return object.raw();
+}
+
+
static bool GetObjectByAddress(Isolate* isolate, JSONStream* js) {
const char* addr_str = js->LookupParam("address");
if (addr_str == NULL) {
@@ -2588,16 +2611,11 @@ static bool GetObjectByAddress(Isolate* isolate, JSONStream* js) {
return true;
}
bool ref = js->HasParam("ref") && js->ParamIs("ref", "true");
- Object& object = Object::Handle(isolate);
- {
- NoSafepointScope no_safepoint;
- ContainsAddressVisitor visitor(isolate, addr);
- object = isolate->heap()->FindObject(&visitor);
- }
- if (object.IsNull()) {
+ const Object& obj = Object::Handle(isolate, GetObjectHelper(isolate, addr));
+ if (obj.IsNull()) {
PrintSentinel(js, kFreeSentinel);
} else {
- object.PrintJSON(js, ref);
+ obj.PrintJSON(js, ref);
}
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698