Bug 1337390 - Fix JSExternalString::dumpRepresentation. r=jwalden
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 28 Feb 2017 11:38:42 +0100
changeset 374252 d08acf88f5b385430db1673654435d08cc28c6ce
parent 374251 e0c1e4792c8a343862e6ee2ec39a6f259a999f72
child 374253 8bf9111b7e9cd01f486a34057144e6480cbc66ce
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1337390
milestone54.0a1
Bug 1337390 - Fix JSExternalString::dumpRepresentation. r=jwalden
js/src/jit-test/tests/basic/dumpStringRepresentation.js
js/src/vm/String.cpp
--- a/js/src/jit-test/tests/basic/dumpStringRepresentation.js
+++ b/js/src/jit-test/tests/basic/dumpStringRepresentation.js
@@ -63,8 +63,11 @@ print("\nr2: now mutated into a dependen
 dumpStringRepresentation(r2);
 
 print("\nr1: now a doubly-dependent string, because of r2's mutation:");
 dumpStringRepresentation(r1);
 
 print("\nt, s: Original leaves, representation unchanged:");
 dumpStringRepresentation(t);
 dumpStringRepresentation(s);
+
+for (var str of representativeStringArray())
+    dumpStringRepresentation(str);
--- a/js/src/vm/String.cpp
+++ b/js/src/vm/String.cpp
@@ -1107,18 +1107,17 @@ JSAtom::dump()
 
 void
 JSExternalString::dumpRepresentation(FILE* fp, int indent) const
 {
     dumpRepresentationHeader(fp, indent, "JSExternalString");
     indent += 2;
 
     fprintf(fp, "%*sfinalizer: ((JSStringFinalizer*) %p)\n", indent, "", externalFinalizer());
-    fprintf(fp, "%*sbase: ", indent, "");
-    base()->dumpRepresentation(fp, indent);
+    dumpRepresentationChars(fp, indent);
 }
 #endif /* DEBUG */
 
 JSLinearString*
 js::NewDependentString(JSContext* cx, JSString* baseArg, size_t start, size_t length)
 {
     if (length == 0)
         return cx->emptyString();