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

Unified Diff: src/objects-printer.cc

Issue 12223071: ES6 symbols: Introduce Symbol class, along with abstract Name class (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 10 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/objects-visiting.cc » ('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 98868f29cb263efe61d4823ed30317049af157e8..471afc9c37b8bc34af5ebf4b0ff9d6721a044ef2 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -76,6 +76,9 @@ void HeapObject::HeapObjectPrint(FILE* out) {
}
switch (instance_type) {
+ case SYMBOL_TYPE:
+ Symbol::cast(this)->SymbolPrint(out);
+ break;
case MAP_TYPE:
Map::cast(this)->MapPrint(out);
break;
@@ -477,6 +480,7 @@ static const char* TypeToString(InstanceType type) {
case INVALID_TYPE: return "INVALID";
case MAP_TYPE: return "MAP";
case HEAP_NUMBER_TYPE: return "HEAP_NUMBER";
+ case SYMBOL_TYPE: return "SYMBOL";
case STRING_TYPE: return "TWO_BYTE_STRING";
case ASCII_STRING_TYPE: return "ASCII_STRING";
case CONS_STRING_TYPE:
@@ -545,6 +549,12 @@ static const char* TypeToString(InstanceType type) {
}
+void Symbol::SymbolPrint(FILE* out) {
+ HeapObject::PrintHeader(out, "Symbol");
+ PrintF(out, " - hash: %d\n", Hash());
+}
+
+
void Map::MapPrint(FILE* out) {
HeapObject::PrintHeader(out, "Map");
PrintF(out, " - type: %s\n", TypeToString(instance_type()));
« no previous file with comments | « src/objects-inl.h ('k') | src/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698