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

Unified Diff: src/objects-printer.cc

Issue 12330012: ES6 symbols: Allow symbols as property names (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Platform ports 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/profile-generator.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 471afc9c37b8bc34af5ebf4b0ff9d6721a044ef2..a9c94ddae98e97394398e350ea4ec6572f6b3ed0 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -259,7 +259,7 @@ void JSObject::PrintProperties(FILE* out) {
DescriptorArray* descs = map()->instance_descriptors();
for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
PrintF(out, " ");
- descs->GetKey(i)->StringPrint(out);
+ descs->GetKey(i)->NamePrint(out);
PrintF(out, ": ");
switch (descs->GetType(i)) {
case FIELD: {
@@ -417,7 +417,7 @@ void JSObject::PrintTransitions(FILE* out) {
TransitionArray* transitions = map()->transitions();
for (int i = 0; i < transitions->number_of_transitions(); i++) {
PrintF(out, " ");
- transitions->GetKey(i)->StringPrint(out);
+ transitions->GetKey(i)->NamePrint(out);
PrintF(out, ": ");
switch (transitions->GetTargetDetails(i).type()) {
case FIELD: {
@@ -710,6 +710,14 @@ void String::StringPrint(FILE* out) {
}
+void Name::NamePrint(FILE* out) {
+ if (IsString())
+ String::cast(this)->StringPrint(out);
+ else
+ ShortPrint();
+}
+
+
// This method is only meant to be called from gdb for debugging purposes.
// Since the string can also be in two-byte encoding, non-ASCII characters
// will be ignored in the output.
@@ -1107,7 +1115,7 @@ void TransitionArray::PrintTransitions(FILE* out) {
PrintF(out, "Transition array %d\n", number_of_transitions());
for (int i = 0; i < number_of_transitions(); i++) {
PrintF(out, " %d: ", i);
- GetKey(i)->StringPrint(out);
+ GetKey(i)->NamePrint(out);
PrintF(out, ": ");
switch (GetTargetDetails(i).type()) {
case FIELD: {
« no previous file with comments | « src/objects-inl.h ('k') | src/profile-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698