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

Unified Diff: src/property.cc

Issue 733253004: PropertyDetails cleanup: NORMAL property type merged with FIELD. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cleanup 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/property.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/property.cc
diff --git a/src/property.cc b/src/property.cc
index e9e4b64690777aede7c4595e8bd122e07a8bc3ac..fcc718dfe75e40adee4f22ec5bfec49a270a5342 100644
--- a/src/property.cc
+++ b/src/property.cc
@@ -42,13 +42,38 @@ std::ostream& operator<<(std::ostream& os,
}
+struct FastPropertyDetails {
+ explicit FastPropertyDetails(const PropertyDetails& v) : details(v) {}
+ const PropertyDetails details;
+};
+
+
+// Outputs PropertyDetails as a dictionary details.
std::ostream& operator<<(std::ostream& os, const PropertyDetails& details) {
os << "(";
switch (details.type()) {
- case NORMAL:
- os << "normal: dictionary_index: " << details.dictionary_index();
+ case FIELD:
+ os << "normal: ";
break;
case CONSTANT:
+ os << "constant: ";
+ break;
+ case CALLBACKS:
+ UNREACHABLE();
+ break;
+ }
+ return os << " dictionary_index: " << details.dictionary_index()
+ << ", attrs: " << details.attributes() << ")";
+}
+
+
+// Outputs PropertyDetails as a descriptor array details.
+std::ostream& operator<<(std::ostream& os,
+ const FastPropertyDetails& details_fast) {
+ const PropertyDetails& details = details_fast.details;
+ os << "(";
+ switch (details.type()) {
+ case CONSTANT:
os << "constant: p: " << details.pointer();
break;
case FIELD:
@@ -60,14 +85,27 @@ std::ostream& operator<<(std::ostream& os, const PropertyDetails& details) {
os << "callbacks: p: " << details.pointer();
break;
}
- os << ", attrs: " << details.attributes() << ")";
- return os;
+ return os << ", attrs: " << details.attributes() << ")";
+}
+
+
+#ifdef OBJECT_PRINT
+void PropertyDetails::Print(bool dictionary_mode) {
+ OFStream os(stdout);
+ if (dictionary_mode) {
+ os << *this;
+ } else {
+ os << FastPropertyDetails(*this);
+ }
+ os << "\n" << std::flush;
}
+#endif
std::ostream& operator<<(std::ostream& os, const Descriptor& d) {
return os << "Descriptor " << Brief(*d.GetKey()) << " @ "
- << Brief(*d.GetValue()) << " " << d.GetDetails();
+ << Brief(*d.GetValue()) << " "
+ << FastPropertyDetails(d.GetDetails());
}
} } // namespace v8::internal
« no previous file with comments | « src/property.h ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698