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

Unified Diff: src/objects-printer.cc

Issue 391693002: In-object double fields unboxing (for 64-bit only). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing Created 6 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/objects-inl.h ('k') | src/property-details.h » ('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 2fb924cfc99a19b94d964ddd364c7545d16f3d81..45ff33c2d289cb20dc2d7e03df7abaa72797d0b8 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -233,8 +233,12 @@ void JSObject::PrintProperties(std::ostream& os) { // NOLINT
switch (descs->GetType(i)) {
case FIELD: {
FieldIndex index = FieldIndex::ForDescriptor(map(), i);
- os << Brief(RawFastPropertyAt(index)) << " (field at offset "
- << index.property_index() << ")\n";
+ if (IsUnboxedDoubleField(index)) {
+ os << "<unboxed double> " << RawFastDoublePropertyAt(index);
+ } else {
+ os << Brief(RawFastPropertyAt(index));
+ }
+ os << " (field at offset " << index.property_index() << ")\n";
break;
}
case CONSTANT:
@@ -430,6 +434,9 @@ void Map::MapPrint(std::ostream& os) { // NOLINT
os << "\n - instance descriptors " << (owns_descriptors() ? "(own) " : "")
<< "#" << NumberOfOwnDescriptors() << ": "
<< Brief(instance_descriptors());
+ if (FLAG_unbox_double_fields) {
+ os << "\n - layout descriptor: " << Brief(layout_descriptor());
+ }
if (HasTransitionArray()) {
os << "\n - transitions: " << Brief(transitions());
}
@@ -438,6 +445,9 @@ void Map::MapPrint(std::ostream& os) { // NOLINT
os << "\n - code cache: " << Brief(code_cache());
os << "\n - dependent code: " << Brief(dependent_code());
os << "\n";
+ instance_descriptors()->PrintDescriptors(os);
+ os << "\n";
+ if (FLAG_unbox_double_fields) layout_descriptor()->Print(os);
}
@@ -1076,6 +1086,43 @@ void DescriptorArray::PrintDescriptors(std::ostream& os) { // NOLINT
}
+static void PrintBitMask(std::ostream& os, uint32_t value) { // NOLINT
+ for (int i = 0; i < 32; i++) {
+ if ((i & 7) == 0) os << " ";
+ os << (((value & 1) == 0) ? "_" : "x");
+ value >>= 1;
+ }
+}
+
+
+void LayoutDescriptor::Print() {
+ OFStream os(stdout);
+ this->Print(os);
+ os << std::flush;
+}
+
+
+void LayoutDescriptor::Print(std::ostream& os) { // NOLINT
+ os << "Layout descriptor: ";
+ if (IsUninitialized()) {
+ os << "<uninitialized>";
+ } else if (IsFastPointerLayout()) {
+ os << "<all tagged>";
+ } else if (IsSmi()) {
+ os << "fast";
+ PrintBitMask(os, static_cast<uint32_t>(Smi::cast(this)->value()));
+ } else {
+ os << "slow";
+ int len = length();
+ for (int i = 0; i < len; i++) {
+ if (i > 0) os << " |";
+ PrintBitMask(os, get_scalar(i));
+ }
+ }
+ os << "\n";
+}
+
+
void TransitionArray::Print() {
OFStream os(stdout);
this->PrintTransitions(os);
« no previous file with comments | « src/objects-inl.h ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698