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

Unified Diff: src/objects-printer.cc

Issue 2537523002: [printing] Print properties backing store value and add a gdb macro for printing LayoutDescriptors. (Closed)
Patch Set: Created 4 years, 1 month 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 | « src/layout-descriptor.h ('k') | tools/gdbinit » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 45018be9a0490c19806c42f87e7b7d4803d92f77..94e0b99e30921782d43764e18d7d95a3281272b3 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -511,7 +511,7 @@ static void JSObjectPrintHeader(std::ostream& os, JSObject* obj,
static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT
bool print_elements = true) {
- os << "\n - properties = {";
+ os << "\n - properties = " << Brief(obj->properties()) << " {";
obj->PrintProperties(os);
os << "\n }\n";
if (print_elements && obj->elements()->length() > 0) {
@@ -597,7 +597,8 @@ void Map::MapPrint(std::ostream& os) { // NOLINT
<< "#" << NumberOfOwnDescriptors() << ": "
<< Brief(instance_descriptors());
if (FLAG_unbox_double_fields) {
- os << "\n - layout descriptor: " << Brief(layout_descriptor());
+ os << "\n - layout descriptor: ";
+ layout_descriptor()->ShortPrint(os);
}
int nof_transitions = TransitionArray::NumberOfTransitions(raw_transitions());
if (nof_transitions > 0) {
@@ -1449,16 +1450,24 @@ void LayoutDescriptor::Print() {
os << std::flush;
}
+void LayoutDescriptor::ShortPrint(std::ostream& os) {
+ if (IsSmi()) {
+ os << this; // Print tagged value for easy use with "jld" gdb macro.
+ } else {
+ os << Brief(this);
+ }
+}
void LayoutDescriptor::Print(std::ostream& os) { // NOLINT
os << "Layout descriptor: ";
- if (IsOddball() && IsUninitialized(HeapObject::cast(this)->GetIsolate())) {
- os << "<uninitialized>";
- } else if (IsFastPointerLayout()) {
+ if (IsFastPointerLayout()) {
os << "<all tagged>";
} else if (IsSmi()) {
os << "fast";
PrintBitMask(os, static_cast<uint32_t>(Smi::cast(this)->value()));
+ } else if (IsOddball() &&
+ IsUninitialized(HeapObject::cast(this)->GetIsolate())) {
+ os << "<uninitialized>";
} else {
os << "slow";
int len = length();
@@ -1638,6 +1647,15 @@ extern void _v8_internal_Print_DescriptorArray(void* object) {
}
}
+extern void _v8_internal_Print_LayoutDescriptor(void* object) {
+ i::Object* o = reinterpret_cast<i::Object*>(object);
+ if (!o->IsLayoutDescriptor()) {
+ printf("Not a layout descriptor\n");
+ } else {
+ reinterpret_cast<i::LayoutDescriptor*>(object)->Print();
+ }
+}
+
extern void _v8_internal_Print_TransitionArray(void* object) {
if (reinterpret_cast<i::Object*>(object)->IsSmi()) {
printf("Not a transition array\n");
« no previous file with comments | « src/layout-descriptor.h ('k') | tools/gdbinit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698