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

Unified Diff: src/objects-printer.cc

Issue 1842743002: [printing] Add COW identifier to elements kind (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: print elements and only print COW for smi/object elements Created 4 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 | « no previous file | no next file » | 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 a51dc18d446d8097d3a9e18dde9aab25ebb0e9c6..58092a49baad8cc552e74bb80f1a43e685bf619e 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -396,10 +396,16 @@ static void JSObjectPrintHeader(std::ostream& os, JSObject* obj,
obj->PrintHeader(os, id);
// Don't call GetElementsKind, its validation code can cause the printer to
// fail when debugging.
- PrototypeIterator iter(obj->GetIsolate(), obj);
os << "\n - map = " << reinterpret_cast<void*>(obj->map()) << " ["
- << ElementsKindToString(obj->map()->elements_kind())
- << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent());
+ << ElementsKindToString(obj->map()->elements_kind());
+ if (obj->elements()->map() == obj->GetHeap()->fixed_cow_array_map()) {
+ os << " (COW)";
+ }
+ PrototypeIterator iter(obj->GetIsolate(), obj);
+ os << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent());
+ if (obj->elements()->length() > 0) {
+ os << "\n - elements = " << Brief(obj->elements());
+ }
}
« 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