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

Unified Diff: src/objects-printer.cc

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: Addressing comments Created 3 years, 11 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 | « src/objects-inl.h ('k') | src/property.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 9e7cc25d0b9b592dc36a827c38269599e18ecaae..f1ca6212b07575a98d81e17a3f8dbb907d18ab8c 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -335,29 +335,32 @@ void JSObject::PrintProperties(std::ostream& os) { // NOLINT
os << "\n ";
descs->GetKey(i)->NamePrint(os);
os << ": ";
- switch (descs->GetType(i)) {
- case DATA: {
- FieldIndex index = FieldIndex::ForDescriptor(map(), i);
- if (IsUnboxedDoubleField(index)) {
- os << "<unboxed double> " << RawFastDoublePropertyAt(index);
+ PropertyDetails details = descs->GetDetails(i);
+ FieldIndex field_index;
+ switch (details.location()) {
+ case kField: {
+ field_index = FieldIndex::ForDescriptor(map(), i);
+ if (IsUnboxedDoubleField(field_index)) {
+ os << "<unboxed double> " << RawFastDoublePropertyAt(field_index);
} else {
- os << Brief(RawFastPropertyAt(index));
+ os << Brief(RawFastPropertyAt(field_index));
}
- os << " (data field at offset " << index.property_index() << ")";
break;
}
- case ACCESSOR: {
- FieldIndex index = FieldIndex::ForDescriptor(map(), i);
- os << " (accessor field at offset " << index.property_index() << ")";
+ case kDescriptor:
+ os << Brief(descs->GetValue(i));
break;
- }
- case DATA_CONSTANT:
- os << Brief(descs->GetConstant(i)) << " (data constant)";
+ }
+ os << " (" << (details.kind() == kData ? "data" : "accessor");
+ switch (details.location()) {
+ case kField: {
+ os << " field at offset " << field_index.property_index();
break;
- case ACCESSOR_CONSTANT:
- os << Brief(descs->GetCallbacksObject(i)) << " (accessor constant)";
+ }
+ case kDescriptor:
break;
}
+ os << ")";
}
} else if (IsJSGlobalObject()) {
global_dictionary()->Print(os);
@@ -1425,7 +1428,7 @@ void AllocationSite::AllocationSitePrint(std::ostream& os) { // NOLINT
} else if (transition_info()->IsJSArray()) {
os << "Array literal " << Brief(transition_info());
} else {
- os << "unknown transition_info" << Brief(transition_info());
+ os << "unknown transition_info " << Brief(transition_info());
}
os << "\n";
}
@@ -1643,8 +1646,10 @@ void TransitionArray::PrintTransitions(std::ostream& os, Object* transitions,
Object* value =
target->instance_descriptors()->GetValue(target->LastAdded());
os << " " << Brief(value);
+ } else {
+ os << " field";
}
- os << "), attrs: " << details.attributes();
+ os << ", attrs: " << details.attributes() << ")";
}
os << " -> " << Brief(target);
}
« no previous file with comments | « src/objects-inl.h ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698