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

Unified Diff: src/objects-printer.cc

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: 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
« src/lookup.cc ('K') | « 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..7026b8cd98fe67fd3c877202e9ff227a4e849715 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -335,27 +335,37 @@ 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)";
+ }
+ switch (details.kind()) {
+ case kData:
+ os << " data";
+ break;
+ case kAccessor:
+ os << " accessor";
break;
- case ACCESSOR_CONSTANT:
- os << Brief(descs->GetCallbacksObject(i)) << " (accessor constant)";
+ }
+ switch (details.location()) {
+ case kField: {
+ os << " field at offset " << field_index.property_index() << ")";
+ break;
+ }
+ case kDescriptor:
+ os << ")";
break;
}
}
@@ -1425,7 +1435,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,6 +1653,8 @@ 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();
}
« src/lookup.cc ('K') | « src/objects-inl.h ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698