Bug 683802 - Remove mAutoString micro-optimization. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Sun, 25 Sep 2011 15:38:00 +0100
changeset 78837 c14b52621e7b43be376a7c29229d06434f4ceab0
parent 78836 2fe54a83eb507eb412d9ff8920b68a0e8000bfdf
child 78838 419e8e7166091a0813653ec0ba8980fd48d1c833
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs683802
milestone9.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 683802 - Remove mAutoString micro-optimization. r=mrbkap
js/src/xpconnect/src/xpcwrappednative.cpp
--- a/js/src/xpconnect/src/xpcwrappednative.cpp
+++ b/js/src/xpconnect/src/xpcwrappednative.cpp
@@ -2176,22 +2176,16 @@ class CallMethodHelper
     nsISupports* const mCallee;
     const uint16 mVTableIndex;
     const jsid mIdxValueId;
 
     nsAutoTArray<nsXPTCVariant, 8> mDispatchParams;
     uint8 mJSContextIndex; // TODO make const
     uint8 mOptArgcIndex; // TODO make const
 
-    // Reserve space for one nsAutoString. We don't want the string itself
-    // to be declared as that would make the ctor and dtors run for each
-    // CallMethodHelper instantiation, and they're only needed in a
-    // fraction of all the calls that come through here.
-    js::Maybe<nsAutoString> mAutoString;
-
     jsval* const mArgv;
     const PRUint32 mArgc;
 
     enum SizeMode {
         eGetSize,
         eGetLength
     };
 
@@ -2876,25 +2870,16 @@ CallMethodHelper::ConvertIndependentPara
 
                 case nsXPTType::T_DOMSTRING:
                     if(paramInfo.IsDipper())
                     {
                         // Is an 'out' DOMString. Make a new nsAString
                         // now and then continue in order to skip the call to
                         // JSData2Native
 
-                        if(mAutoString.empty())
-                        {
-                            mAutoString.construct();
-                            // Don't call SetValIsDOMString because we don't
-                            // want to delete this pointer.
-                            dp->val.p = mAutoString.addr();
-                            continue;
-                        }
-
                         dp->SetValIsDOMString();
                         if(!(dp->val.p = new nsAutoString()))
                         {
                             JS_ReportOutOfMemory(mCallContext);
                             return JS_FALSE;
                         }
                         continue;
                     }