Bug 1197007: Turn off optimization for GMPLoaderImpl::Load. r=cpearce
authorBob Owen <bobowencode@gmail.com>
Wed, 09 Sep 2015 07:34:56 +0100
changeset 294124 b5add456ce2795e3996bc1b5274e726ea7417c51
parent 294123 3ad40430be78acee75f8adc4425aa71f7d244e69
child 294125 6c7d5b56e472f8c1ddd8f6e965510072e98d8df1
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1197007
milestone43.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 1197007: Turn off optimization for GMPLoaderImpl::Load. r=cpearce
dom/media/gmp/GMPLoader.cpp
--- a/dom/media/gmp/GMPLoader.cpp
+++ b/dom/media/gmp/GMPLoader.cpp
@@ -130,16 +130,21 @@ GetStackAfterCurrentFrame(uint8_t** aOut
     bottom = (uint8_t*)memInfo.BaseAddress - 1;
   }
   *aOutTop = top;
   *aOutBottom = bottom;
   return true;
 }
 #endif
 
+// The RAII variable holding the activation context that we create before
+// lowering the sandbox is getting optimized out.
+#if defined(_MSC_VER)
+#pragma optimize("g", off)
+#endif
 bool
 GMPLoaderImpl::Load(const char* aUTF8LibPath,
                     uint32_t aUTF8LibPathLen,
                     char* aOriginSalt,
                     uint32_t aOriginSaltLen,
                     const GMPPlatformAPI* aPlatformAPI)
 {
   std::string nodeId;
@@ -259,16 +264,19 @@ GMPLoaderImpl::Load(const char* aUTF8Lib
 
   mGetAPIFunc = reinterpret_cast<GMPGetAPIFunc>(PR_FindFunctionSymbol(mLib, "GMPGetAPI"));
   if (!mGetAPIFunc) {
     return false;
   }
 
   return true;
 }
+#if defined(_MSC_VER)
+#pragma optimize("", on)
+#endif
 
 GMPErr
 GMPLoaderImpl::GetAPI(const char* aAPIName,
                       void* aHostAPI,
                       void** aPluginAPI)
 {
   return mGetAPIFunc ? mGetAPIFunc(aAPIName, aHostAPI, aPluginAPI)
                      : GMPGenericErr;