Bug 867426 - Remove RawFlatString typedef; r=jonco
authorTerrence Cole <terrence@mozilla.com>
Tue, 30 Apr 2013 15:39:03 -0700
changeset 141442 fa6176c9b03fb96691fd035fa73e1ba7bb795086
parent 141441 4fbf994a4b1f5876281c4dc921ababf43d791258
child 141443 3a8fec8d23932d5627be5584ba01d481f6a0e9e9
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs867426
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 867426 - Remove RawFlatString typedef; r=jonco
js/src/jsatom.cpp
js/src/jsonparser.cpp
js/src/vm/String.h
js/src/vm/StringBuffer.cpp
js/src/vm/StringBuffer.h
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -257,17 +257,17 @@ AtomizeAndTakeOwnership(JSContext *cx, c
         JSAtom *atom = p->asPtr();
         p->setTagged(bool(ib));
         js_free((void*)tbchars);
         return atom;
     }
 
     AutoEnterAtomsCompartment ac(cx);
 
-    RawFlatString flat = js_NewString<CanGC>(cx, const_cast<jschar*>(tbchars), length);
+    JSFlatString *flat = js_NewString<CanGC>(cx, const_cast<jschar*>(tbchars), length);
     if (!flat) {
         js_free((void*)tbchars);
         return NULL;
     }
 
     JSAtom *atom = flat->morphAtomizedStringIntoAtom();
 
     if (!atoms.relookupOrAdd(p, AtomHasher::Lookup(tbchars, length),
@@ -301,17 +301,17 @@ AtomizeAndCopyChars(JSContext *cx, const
     if (p) {
         JSAtom *atom = p->asPtr();
         p->setTagged(bool(ib));
         return atom;
     }
 
     AutoEnterAtomsCompartment ac(cx);
 
-    RawFlatString flat = js_NewStringCopyN<allowGC>(cx, tbchars, length);
+    JSFlatString *flat = js_NewStringCopyN<allowGC>(cx, tbchars, length);
     if (!flat)
         return NULL;
 
     JSAtom *atom = flat->morphAtomizedStringIntoAtom();
 
     if (!atoms.relookupOrAdd(p, AtomHasher::Lookup(tbchars, length),
                              AtomStateEntry(atom, bool(ib)))) {
         JS_ReportOutOfMemory(cx); /* SystemAllocPolicy does not report OOM. */
--- a/js/src/jsonparser.cpp
+++ b/js/src/jsonparser.cpp
@@ -117,19 +117,19 @@ JSONParser::readString()
         if (start < current && !buffer.append(start.get(), current.get()))
             return token(OOM);
 
         if (current >= end)
             break;
 
         jschar c = *current++;
         if (c == '"') {
-            RawFlatString str = (ST == JSONParser::PropertyName)
-                                 ? buffer.finishAtom()
-                                 : buffer.finishString();
+            JSFlatString *str = (ST == JSONParser::PropertyName)
+                                ? buffer.finishAtom()
+                                : buffer.finishString();
             if (!str)
                 return token(OOM);
             return stringToken(str);
         }
 
         if (c != '\\') {
             error("bad character in string literal");
             return token(Error);
--- a/js/src/vm/String.h
+++ b/js/src/vm/String.h
@@ -25,17 +25,16 @@ ForwardDeclareJS(String);
 class JSDependentString;
 class JSUndependedString;
 class JSExtensibleString;
 class JSExternalString;
 ForwardDeclareJS(LinearString);
 class JSStableString;
 ForwardDeclareJS(InlineString);
 class JSRope;
-ForwardDeclareJS(FlatString);
 
 namespace js {
 
 class StaticStrings;
 class PropertyName;
 
 /* The buffer length required to contain any unsigned 32-bit integer. */
 static const size_t UINT32_CHAR_BUFFER_LENGTH = sizeof("4294967295") - 1;
--- a/js/src/vm/StringBuffer.cpp
+++ b/js/src/vm/StringBuffer.cpp
@@ -33,17 +33,17 @@ StringBuffer::extractWellSized()
             return NULL;
         }
         buf = tmp;
     }
 
     return buf;
 }
 
-RawFlatString
+JSFlatString *
 StringBuffer::finishString()
 {
     JSContext *cx = context();
     if (cb.empty())
         return cx->names().empty;
 
     size_t length = cb.length();
     if (!JSString::validateLength(cx, length))
--- a/js/src/vm/StringBuffer.h
+++ b/js/src/vm/StringBuffer.h
@@ -9,18 +9,16 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
 
 #include "jscntxt.h"
 
 #include "js/Vector.h"
 
-ForwardDeclareJS(FlatString);
-
 namespace js {
 
 /*
  * String builder that eagerly checks for over-allocation past the maximum
  * string length.
  *
  * Any operation which would exceed the maximum string length causes an
  * exception report on the context and results in a failed return value.
@@ -83,17 +81,17 @@ class StringBuffer
     const jschar *end() const { return cb.end(); }
     bool empty() const { return cb.empty(); }
     size_t length() const { return cb.length(); }
 
     /*
      * Creates a string from the characters in this buffer, then (regardless
      * whether string creation succeeded or failed) empties the buffer.
      */
-    js::RawFlatString finishString();
+    JSFlatString *finishString();
 
     /* Identical to finishString() except that an atom is created. */
     JSAtom *finishAtom();
 
     /*
      * Creates a raw string from the characters in this buffer.  The string is
      * exactly the characters in this buffer: it is *not* null-terminated
      * unless the last appended character was |(jschar)0|.