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

Unified Diff: runtime/vm/object.cc

Issue 1318883004: Decorate ObjectPool dumps with offsets to match disassembly and names for most external labels. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | runtime/vm/runtime_entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 69dccbcf96c4b0c2a04e31ca572e8e5f0652f8c1..60a7db5a009f809b4e1c019878b1465f82f92ed5 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -11002,17 +11002,45 @@ void ObjectPool::PrintJSONImpl(JSONStream* stream, bool ref) const {
}
+static const char* DescribeExternalLabel(uword addr) {
+ const char* stub_name = StubCode::NameOfStub(addr);
+ if (stub_name != NULL) {
+ return stub_name;
+ }
+
+ RuntimeFunctionId rt_id = RuntimeEntry::RuntimeFunctionIdFromAddress(addr);
+ if (rt_id != kNoRuntimeFunctionId) {
+ return "runtime entry";
+ }
+
+ if (addr == NativeEntry::LinkNativeCallLabel().address()) {
+ return "link native";
+ }
+
+ if (addr == reinterpret_cast<uword>(Symbols::PredefinedAddress())) {
+ return "predefined symbols";
+ }
+
+ return "UNKNOWN";
+}
+
+
void ObjectPool::DebugPrint() const {
ISL_Print("Object Pool: {\n");
for (intptr_t i = 0; i < Length(); i++) {
+ intptr_t offset = OffsetFromIndex(i);
+ ISL_Print(" %" Pd " PP+0x%" Px ": ", i, offset);
if (InfoAt(i) == kTaggedObject) {
- ISL_Print(" %" Pd ": 0x%" Px " %s (obj)\n", i,
- reinterpret_cast<uword>(ObjectAt(i)),
- Object::Handle(ObjectAt(i)).ToCString());
+ RawObject* obj = ObjectAt(i);
+ ISL_Print("0x%" Px " %s (obj)\n",
+ reinterpret_cast<uword>(obj),
+ Object::Handle(obj).ToCString());
} else if (InfoAt(i) == kExternalLabel) {
- ISL_Print(" %" Pd ": 0x%" Px " (external label)\n", i, RawValueAt(i));
+ uword addr = RawValueAt(i);
+ ISL_Print("0x%" Px " (external label: %s)\n",
+ addr, DescribeExternalLabel(addr));
} else {
- ISL_Print(" %" Pd ": 0x%" Px " (raw)\n", i, RawValueAt(i));
+ ISL_Print("0x%" Px " (raw)\n", RawValueAt(i));
}
}
ISL_Print("}\n");
« no previous file with comments | « no previous file | runtime/vm/runtime_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698