Mark some inline JSString members as JS_ALWAYS_INLINE
authorLuke Wagner <lw@mozilla.com>
Tue, 20 Jul 2010 19:31:55 -0700
changeset 48516 8463de3a71e1cfc2057ec498f6ce0eef1d292184
parent 48515 6d7b95761119b268a7d4b470bcd9b1bbd63656a7
child 48517 faf55b60e857e7672e41f043c7a7a5bfebcdda88
push id14748
push userrsayre@mozilla.com
push dateSun, 01 Aug 2010 00:33:23 +0000
treeherdermozilla-central@f0df797bb2a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b2pre
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
Mark some inline JSString members as JS_ALWAYS_INLINE
js/src/jsstr.h
--- a/js/src/jsstr.h
+++ b/js/src/jsstr.h
@@ -176,106 +176,106 @@ struct JSString {
      * OOM tests.
      */
     static const size_t MAX_LENGTH = (1 << 28) - 1;
 
     inline size_t type() const {
         return mLengthAndFlags & TYPE_MASK;
     }
 
-    inline bool isDependent() const {
+    JS_ALWAYS_INLINE bool isDependent() const {
         return type() == DEPENDENT;
     }
 
-    inline bool isFlat() const {
+    JS_ALWAYS_INLINE bool isFlat() const {
         return type() == FLAT;
     }
 
     inline bool isMutable() const {
         return isFlat() && hasFlag(MUTABLE);
     }
 
     inline bool isRope() const {
         return hasFlag(ROPE_BIT);
     }
 
-    inline bool isAtomized() const {
+    JS_ALWAYS_INLINE bool isAtomized() const {
         return isFlat() && hasFlag(ATOMIZED);
     }
 
     inline bool isInteriorNode() const {
         return type() == INTERIOR_NODE;
     }
 
     inline bool isTopNode() const {
         return type() == TOP_NODE;
     }
 
-    inline jschar *chars() {
+    JS_ALWAYS_INLINE jschar *chars() {
         return isFlat() ? flatChars() : nonFlatChars();
     }
 
-    jschar *nonFlatChars() {
+    JS_ALWAYS_INLINE jschar *nonFlatChars() {
         if (isDependent())
             return dependentChars();
         else {
             flatten();
             JS_ASSERT(isFlat() || isDependent());
             if (isFlat())
                 return flatChars();
             else
                 return dependentChars();
         }
     }
 
-    inline size_t length() const {
+    JS_ALWAYS_INLINE size_t length() const {
         return mLengthAndFlags >> FLAGS_LENGTH_SHIFT;
     }
 
-    inline bool empty() const {
+    JS_ALWAYS_INLINE bool empty() const {
         return length() == 0;
     }
 
-    inline void getCharsAndLength(const jschar *&chars, size_t &length) {
+    JS_ALWAYS_INLINE void getCharsAndLength(const jschar *&chars, size_t &length) {
         chars = this->chars();
         length = this->length();
     }
 
-    inline void getCharsAndEnd(const jschar *&chars, const jschar *&end) {
+    JS_ALWAYS_INLINE void getCharsAndEnd(const jschar *&chars, const jschar *&end) {
         end = length() + (chars = this->chars());
     }
 
     /* Specific flat string initializer and accessor methods. */
-    inline void initFlat(jschar *chars, size_t length) {
+    JS_ALWAYS_INLINE void initFlat(jschar *chars, size_t length) {
         JS_ASSERT(length <= MAX_LENGTH);
         mOffset = 0;
         mCapacity = 0;
         mLengthAndFlags = (length << FLAGS_LENGTH_SHIFT) | FLAT;
         mChars = chars;
     }
 
-    inline void initFlatMutable(jschar *chars, size_t length, size_t cap) {
+    JS_ALWAYS_INLINE void initFlatMutable(jschar *chars, size_t length, size_t cap) {
         JS_ASSERT(length <= MAX_LENGTH);
         mOffset = 0;
         mCapacity = cap;
         mLengthAndFlags = (length << FLAGS_LENGTH_SHIFT) | FLAT | MUTABLE;
         mChars = chars;
     }
 
-    inline jschar *flatChars() const {
+    JS_ALWAYS_INLINE jschar *flatChars() const {
         JS_ASSERT(isFlat());
         return mChars;
     }
 
-    inline size_t flatLength() const {
+    JS_ALWAYS_INLINE size_t flatLength() const {
         JS_ASSERT(isFlat());
         return length();
     }
 
-    inline size_t flatCapacity() const {
+    JS_ALWAYS_INLINE size_t flatCapacity() const {
         JS_ASSERT(isFlat());
         return mCapacity;
     }
 
     /*
      * Methods to manipulate atomized and mutable flags of flat strings. It is
      * safe to use these without extra locking due to the following properties:
      *
@@ -326,17 +326,17 @@ struct JSString {
         mBase = bstr;
     }
 
     inline JSString *dependentBase() const {
         JS_ASSERT(isDependent());
         return mBase;
     }
 
-    inline jschar *dependentChars() {
+    JS_ALWAYS_INLINE jschar *dependentChars() {
         return dependentBase()->isFlat()
                ? dependentBase()->flatChars() + dependentStart()
                : js_GetDependentStringChars(this);
     }
 
     inline size_t dependentStart() const {
         return mOffset;
     }