From c535ec698c06f3462c4c5a519bde55a3c6f9cefa Mon Sep 17 00:00:00 2001 From: ishell Date: Fri, 12 Dec 2014 04:39:54 -0800 Subject: [PATCH] Map and Descriptor printing enhanced a bit. Review URL: https://codereview.chromium.org/801783002 Cr-Commit-Position: refs/heads/master@{#25797} --- src/objects-printer.cc | 1 + src/property.cc | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/objects-printer.cc b/src/objects-printer.cc index fb40a4fa51..fc72800d16 100644 --- a/src/objects-printer.cc +++ b/src/objects-printer.cc @@ -408,6 +408,7 @@ void Map::MapPrint(std::ostream& os) { // NOLINT os << "\n - pre-allocated property fields: " << pre_allocated_property_fields() << "\n"; os << " - unused property fields: " << unused_property_fields() << "\n"; + if (is_deprecated()) os << " - deprecated_map\n"; if (is_dictionary_map()) os << " - dictionary_map\n"; if (is_prototype_map()) os << " - prototype_map\n"; if (is_hidden_prototype()) os << " - hidden_prototype\n"; diff --git a/src/property.cc b/src/property.cc index 9a2765dd6b..512527a5de 100644 --- a/src/property.cc +++ b/src/property.cc @@ -62,7 +62,7 @@ std::ostream& operator<<(std::ostream& os, const PropertyDetails& details) { UNREACHABLE(); break; } - return os << "dictionary_index: " << details.dictionary_index() + return os << " dictionary_index: " << details.dictionary_index() << ", attrs: " << details.attributes() << ")"; } @@ -103,9 +103,15 @@ void PropertyDetails::Print(bool dictionary_mode) { std::ostream& operator<<(std::ostream& os, const Descriptor& d) { - return os << "Descriptor " << Brief(*d.GetKey()) << " @ " - << Brief(*d.GetValue()) << " " - << FastPropertyDetails(d.GetDetails()); + Object* value = *d.GetValue(); + os << "Descriptor " << Brief(*d.GetKey()) << " @ " << Brief(value) << " "; + if (value->IsAccessorPair()) { + AccessorPair* pair = AccessorPair::cast(value); + os << "(get: " << Brief(pair->getter()) + << ", set: " << Brief(pair->setter()) << ") "; + } + os << FastPropertyDetails(d.GetDetails()); + return os; } } } // namespace v8::internal