Bug 1512162 - A better fix for incorrect code generation on ppc64le. r=bholley
authorCameron Kaiser <spectre@floodgap.com>
Mon, 01 Jul 2019 18:40:59 +0000
changeset 480906 1a2ce7a5ce7d36f9310031d9a2dbaa60d62e1819
parent 480848 9525f0cc6ca1bae213239c542b7a6642f05c1f8e
child 480907 5eaa76ed37cadaecffef978ee3441b882e75788a
push id36228
push useraciure@mozilla.com
push dateTue, 02 Jul 2019 21:46:04 +0000
treeherdermozilla-central@da33e6261a81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1512162
milestone69.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 1512162 - A better fix for incorrect code generation on ppc64le. r=bholley Differential Revision: https://phabricator.services.mozilla.com/D36439
js/xpconnect/src/XPCWrappedNative.cpp
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -1152,16 +1152,20 @@ bool XPCWrappedNative::CallMethod(XPCCal
   if (NS_FAILED(rv)) {
     return Throw(rv, ccx);
   }
 
   JS::Rooted<CallMethodHelper> helper(ccx, /* init = */ ccx);
   return helper.get().Call();
 }
 
+#if (__GNUC__ && __linux__ && __PPC64__ && _LITTLE_ENDIAN)
+// Work around a compiler bug on ppc64le (bug 1512162).
+__attribute__ ((noinline,noclone))
+#endif
 bool CallMethodHelper::Call() {
   mCallContext.SetRetVal(JS::UndefinedValue());
 
   mCallContext.GetContext()->SetPendingException(nullptr);
 
   if (mVTableIndex == 0) {
     return QueryInterfaceFastPath();
   }
@@ -1310,16 +1314,20 @@ bool CallMethodHelper::GetOutParamSource
         return false;
       }
     }
   }
 
   return true;
 }
 
+#if (__GNUC__ && __linux__ && __PPC64__ && _LITTLE_ENDIAN)
+// Work around a compiler bug on ppc64le (bug 1512162).
+__attribute__ ((noinline,noclone))
+#endif
 bool CallMethodHelper::GatherAndConvertResults() {
   // now we iterate through the native params to gather and convert results
   uint8_t paramCount = mMethodInfo->GetParamCount();
   for (uint8_t i = 0; i < paramCount; i++) {
     const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i);
     if (!paramInfo.IsOut()) {
       continue;
     }