Backed out 1 changesets (bug 1189881) for bustage on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 17 Sep 2015 14:07:04 +0200
changeset 297369 8a26a2abcf6164ea60d8250607ff73fbd1e7b8c8
parent 297368 f3b279e0309573e39f44a8285fad5e7b6d6fe002
child 297370 cf05881e89ed313051a69a3e18e5c06c8bd909b5
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1189881
milestone43.0a1
backs oute0b666c198ddbcabe275403205dce50d3836f41f
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
Backed out 1 changesets (bug 1189881) for bustage on a CLOSED TREE Backed out changeset e0b666c198dd (bug 1189881)
mobile/android/base/GeckoJavaSampler.java
tools/profiler/core/platform.cpp
widget/android/AndroidJNI.cpp
widget/android/GeneratedJNINatives.h
widget/android/GeneratedJNIWrappers.cpp
widget/android/GeneratedJNIWrappers.h
widget/android/moz.build
--- a/mobile/android/base/GeckoJavaSampler.java
+++ b/mobile/android/base/GeckoJavaSampler.java
@@ -17,17 +17,16 @@ import java.util.Set;
 public class GeckoJavaSampler {
     private static final String LOGTAG = "JavaSampler";
     private static Thread sSamplingThread;
     private static SamplingThread sSamplingRunnable;
     private static Thread sMainThread;
 
     // Use the same timer primitive as the profiler
     // to get a perfect sample syncing.
-    @WrapForJNI
     private static native double getProfilerTime();
 
     private static class Sample {
         public Frame[] mFrames;
         public double mTime;
         public long mJavaTime; // non-zero if Android system time is used
         public Sample(StackTraceElement[] aStack) {
             mFrames = new Frame[aStack.length];
@@ -204,8 +203,11 @@ public class GeckoJavaSampler {
             } catch (InterruptedException e) {
                 e.printStackTrace();
             }
             sSamplingThread = null;
             sSamplingRunnable = null;
         }
     }
 }
+
+
+
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -30,44 +30,24 @@
 #include "nsThreadUtils.h"
 #endif
 #include "ProfilerMarkers.h"
 
 #if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
   #include "AndroidBridge.h"
 #endif
 
-#ifdef SPS_OS_android
-#include "GeneratedJNINatives.h"
-#endif
-
 #ifndef SPS_STANDALONE
 #if defined(SPS_PLAT_amd64_linux) || defined(SPS_PLAT_x86_linux)
 # define USE_LUL_STACKWALK
 # include "lul/LulMain.h"
 # include "lul/platform-linux-lul.h"
 #endif
 #endif
 
-#ifdef SPS_OS_android
-class GeckoJavaSampler : public widget::GeckoJavaSampler::Natives<GeckoJavaSampler>
-{
-private:
-  GeckoJavaSampler();
-
-public:
-  static double GetProfilerTime() {
-    if (!profiler_is_active()) {
-      return 0.0;
-    }
-    return profiler_time();
-  };
-};
-#endif
-
 mozilla::ThreadLocal<PseudoStack *> tlsPseudoStack;
 mozilla::ThreadLocal<GeckoSampler *> tlsTicker;
 mozilla::ThreadLocal<void *> tlsStackTop;
 // We need to track whether we've been initialized otherwise
 // we end up using tlsStack without initializing it.
 // Because tlsStack is totally opaque to us we can't reuse
 // it as the flag itself.
 bool stack_key_initialized;
@@ -488,22 +468,16 @@ void mozilla_sampler_init(void* stackTop
 
   // platform specific initialization
   OS::Startup();
 
 #ifndef SPS_STANDALONE
   set_stderr_callback(mozilla_sampler_log);
 #endif
 
-#ifdef SPS_OS_android
-  if (mozilla::jni::IsAvailable()) {
-    GeckoJavaSampler::Init();
-  }
-#endif
-
   // We can't open pref so we use an environment variable
   // to know if we should trigger the profiler on startup
   // NOTE: Default
   const char *val = getenv("MOZ_PROFILER_STARTUP");
   if (!val || !*val) {
     return;
   }
 
--- a/widget/android/AndroidJNI.cpp
+++ b/widget/android/AndroidJNI.cpp
@@ -675,31 +675,31 @@ Java_org_mozilla_gecko_GeckoAppShell_com
     return nsWindow::ComputeRenderIntegrity();
 }
 
 NS_EXPORT void JNICALL
 Java_org_mozilla_gecko_GeckoAppShell_notifyFilePickerResult(JNIEnv* jenv, jclass, jstring filePath, jlong callback)
 {
     class NotifyFilePickerResultRunnable : public nsRunnable {
     public:
-        NotifyFilePickerResultRunnable(nsString& fileDir, long callback) :
+        NotifyFilePickerResultRunnable(nsString& fileDir, long callback) : 
             mFileDir(fileDir), mCallback(callback) {}
 
         NS_IMETHODIMP Run() {
             nsFilePickerCallback* handler = (nsFilePickerCallback*)mCallback;
             handler->handleResult(mFileDir);
             handler->Release();
             return NS_OK;
         }
     private:
         nsString mFileDir;
         long mCallback;
     };
     nsString path = nsJNIString(filePath, jenv);
-
+    
     nsCOMPtr<nsIRunnable> runnable =
         new NotifyFilePickerResultRunnable(path, (long)callback);
     NS_DispatchToMainThread(runnable);
 }
 
 #define MAX_LOCK_ATTEMPTS 10
 
 static bool LockWindowWithRetry(void* window, unsigned char** bits, int* width, int* height, int* format, int* stride)
@@ -762,17 +762,17 @@ Java_org_mozilla_gecko_GeckoAppShell_get
     dstHeight = mozilla::RoundUpPow2(srcHeight);
     dstSize = dstWidth * dstHeight * bpp;
 
     bitsCopy = (unsigned char*)malloc(dstSize);
     bzero(bitsCopy, dstSize);
     for (int i = 0; i < srcHeight; i++) {
         memcpy(bitsCopy + ((dstHeight - i - 1) * dstWidth * bpp), bits + (i * srcStride * bpp), srcStride * bpp);
     }
-
+    
     if (!jSurfaceBitsClass) {
         jSurfaceBitsClass = (jclass)jenv->NewGlobalRef(jenv->FindClass("org/mozilla/gecko/SurfaceBits"));
         jSurfaceBitsCtor = jenv->GetMethodID(jSurfaceBitsClass, "<init>", "()V");
 
         jSurfaceBitsWidth = jenv->GetFieldID(jSurfaceBitsClass, "width", "I");
         jSurfaceBitsHeight = jenv->GetFieldID(jSurfaceBitsClass, "height", "I");
         jSurfaceBitsFormat = jenv->GetFieldID(jSurfaceBitsClass, "format", "I");
         jSurfaceBitsBuffer = jenv->GetFieldID(jSurfaceBitsClass, "buffer", "Ljava/nio/ByteBuffer;");
@@ -847,16 +847,25 @@ Java_org_mozilla_gecko_GeckoAppShell_onS
 }
 
 NS_EXPORT void JNICALL
 Java_org_mozilla_gecko_GeckoAppShell_dispatchMemoryPressure(JNIEnv* jenv, jclass)
 {
     NS_DispatchMemoryPressure(MemPressure_New);
 }
 
+NS_EXPORT jdouble JNICALL
+Java_org_mozilla_gecko_GeckoJavaSampler_getProfilerTime(JNIEnv *jenv, jclass jc)
+{
+  if (!profiler_is_active()) {
+    return 0.0;
+  }
+  return profiler_time();
+}
+
 NS_EXPORT void JNICALL
 Java_org_mozilla_gecko_gfx_NativePanZoomController_abortAnimation(JNIEnv* env, jobject instance)
 {
     APZCTreeManager *controller = nsWindow::GetAPZCTreeManager();
     if (controller) {
         // TODO: Pass in correct values for presShellId and viewId.
         controller->CancelAnimation(ScrollableLayerGuid(nsWindow::RootLayerTreeId(), 0, 0));
     }
--- a/widget/android/GeneratedJNINatives.h
+++ b/widget/android/GeneratedJNINatives.h
@@ -32,31 +32,16 @@ public:
                 ::template Wrap<&Impl::RequestNativeStack>)
     };
 };
 
 template<class Impl>
 constexpr JNINativeMethod ANRReporter::Natives<Impl>::methods[];
 
 template<class Impl>
-class GeckoJavaSampler::Natives : public mozilla::jni::NativeImpl<GeckoJavaSampler, Impl>
-{
-public:
-    static constexpr JNINativeMethod methods[] = {
-
-        mozilla::jni::MakeNativeMethod<GeckoJavaSampler::GetProfilerTime_t>(
-                mozilla::jni::NativeStub<GeckoJavaSampler::GetProfilerTime_t, Impl>
-                ::template Wrap<&Impl::GetProfilerTime>)
-    };
-};
-
-template<class Impl>
-constexpr JNINativeMethod GeckoJavaSampler::Natives<Impl>::methods[];
-
-template<class Impl>
 class GeckoThread::Natives : public mozilla::jni::NativeImpl<GeckoThread, Impl>
 {
 public:
     static constexpr JNINativeMethod methods[] = {
 
         mozilla::jni::MakeNativeMethod<GeckoThread::SpeculativeConnect_t>(
                 mozilla::jni::NativeStub<GeckoThread::SpeculativeConnect_t, Impl>
                 ::template Wrap<&Impl::SpeculativeConnect>)
--- a/widget/android/GeneratedJNIWrappers.cpp
+++ b/widget/android/GeneratedJNIWrappers.cpp
@@ -710,19 +710,16 @@ constexpr char GeckoJavaSampler::name[];
 constexpr char GeckoJavaSampler::GetFrameNameJavaProfilingWrapper_t::name[];
 constexpr char GeckoJavaSampler::GetFrameNameJavaProfilingWrapper_t::signature[];
 
 auto GeckoJavaSampler::GetFrameNameJavaProfilingWrapper(int32_t a0, int32_t a1, int32_t a2) -> mozilla::jni::String::LocalRef
 {
     return mozilla::jni::Method<GetFrameNameJavaProfilingWrapper_t>::Call(nullptr, nullptr, a0, a1, a2);
 }
 
-constexpr char GeckoJavaSampler::GetProfilerTime_t::name[];
-constexpr char GeckoJavaSampler::GetProfilerTime_t::signature[];
-
 constexpr char GeckoJavaSampler::GetSampleTimeJavaProfiling_t::name[];
 constexpr char GeckoJavaSampler::GetSampleTimeJavaProfiling_t::signature[];
 
 auto GeckoJavaSampler::GetSampleTimeJavaProfiling(int32_t a0, int32_t a1) -> double
 {
     return mozilla::jni::Method<GetSampleTimeJavaProfiling_t>::Call(nullptr, nullptr, a0, a1);
 }
 
--- a/widget/android/GeneratedJNIWrappers.h
+++ b/widget/android/GeneratedJNIWrappers.h
@@ -1690,31 +1690,16 @@ public:
         static const bool isMultithreaded = true;
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
     };
 
     static auto GetFrameNameJavaProfilingWrapper(int32_t, int32_t, int32_t) -> mozilla::jni::String::LocalRef;
 
 public:
-    struct GetProfilerTime_t {
-        typedef GeckoJavaSampler Owner;
-        typedef double ReturnType;
-        typedef double SetterType;
-        typedef mozilla::jni::Args<> Args;
-        static constexpr char name[] = "getProfilerTime";
-        static constexpr char signature[] =
-                "()D";
-        static const bool isStatic = true;
-        static const bool isMultithreaded = false;
-        static const mozilla::jni::ExceptionMode exceptionMode =
-                mozilla::jni::ExceptionMode::ABORT;
-    };
-
-public:
     struct GetSampleTimeJavaProfiling_t {
         typedef GeckoJavaSampler Owner;
         typedef double ReturnType;
         typedef double SetterType;
         typedef mozilla::jni::Args<
                 int32_t,
                 int32_t> Args;
         static constexpr char name[] = "getSampleTime";
@@ -1811,18 +1796,16 @@ public:
         static const bool isStatic = true;
         static const bool isMultithreaded = true;
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
     };
 
     static auto UnpauseJavaProfiling() -> void;
 
-public:
-    template<class Impl> class Natives;
 };
 
 class GeckoThread : public mozilla::jni::Class<GeckoThread>
 {
 public:
     typedef mozilla::jni::Ref<GeckoThread> Ref;
     typedef mozilla::jni::LocalRef<GeckoThread> LocalRef;
     typedef mozilla::jni::GlobalRef<GeckoThread> GlobalRef;
--- a/widget/android/moz.build
+++ b/widget/android/moz.build
@@ -14,17 +14,16 @@ XPIDL_SOURCES += [
 ]
 
 XPIDL_MODULE = 'widget_android'
 
 EXPORTS += [
     'AndroidBridge.h',
     'AndroidJavaWrappers.h',
     'AndroidJNIWrapper.h',
-    'GeneratedJNINatives.h',
     'GeneratedJNIWrappers.h',
 ]
 
 UNIFIED_SOURCES += [
     'AndroidBridge.cpp',
     'AndroidContentController.cpp',
     'AndroidDirectTexture.cpp',
     'AndroidGraphicBuffer.cpp',