Title: [94191] trunk/Source
Revision
94191
Author
andr...@google.com
Date
2011-08-31 08:10:10 -0700 (Wed, 31 Aug 2011)

Log Message

Investigate current uses of OS(ANDROID)
https://bugs.webkit.org/show_bug.cgi?id=66761

Reviewed by Darin Adler.

Remove the last legacy Android code.

No new tests needed as the code wasn't tested in the first place.

Source/_javascript_Core:

* wtf/Atomics.h:
* wtf/Platform.h:
* wtf/ThreadingPthreads.cpp:
(WTF::createThreadInternal):

Source/WebCore:

* bridge/jni/JNIUtility.cpp:
(JSC::Bindings::getJNIEnv):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (94190 => 94191)


--- trunk/Source/_javascript_Core/ChangeLog	2011-08-31 15:02:48 UTC (rev 94190)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-08-31 15:10:10 UTC (rev 94191)
@@ -1,3 +1,19 @@
+2011-08-31  Andrei Popescu  <andr...@google.com>
+
+        Investigate current uses of OS(ANDROID)
+        https://bugs.webkit.org/show_bug.cgi?id=66761
+
+        Reviewed by Darin Adler.
+
+        Remove the last legacy Android code.
+
+        No new tests needed as the code wasn't tested in the first place.
+
+        * wtf/Atomics.h:
+        * wtf/Platform.h:
+        * wtf/ThreadingPthreads.cpp:
+        (WTF::createThreadInternal):
+
 2011-08-30  Aaron Colwell  <acolw...@chromium.org>
 
         Add MediaSource API to HTMLMediaElement

Modified: trunk/Source/_javascript_Core/wtf/Atomics.h (94190 => 94191)


--- trunk/Source/_javascript_Core/wtf/Atomics.h	2011-08-31 15:02:48 UTC (rev 94190)
+++ trunk/Source/_javascript_Core/wtf/Atomics.h	2011-08-31 15:10:10 UTC (rev 94191)
@@ -65,8 +65,6 @@
 #include <windows.h>
 #elif OS(DARWIN)
 #include <libkern/OSAtomic.h>
-#elif OS(ANDROID)
-#include <cutils/atomic.h>
 #elif OS(QNX)
 #include <atomic.h>
 #elif COMPILER(GCC) && !OS(SYMBIAN)
@@ -103,11 +101,6 @@
 inline int atomicIncrement(int volatile* addend) { return static_cast<int>(atomic_add_value(reinterpret_cast<unsigned volatile*>(addend), 1)) + 1; }
 inline int atomicDecrement(int volatile* addend) { return static_cast<int>(atomic_sub_value(reinterpret_cast<unsigned volatile*>(addend), 1)) - 1; }
 
-#elif OS(ANDROID)
-
-inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); }
-inline int atomicDecrement(int volatile* addend) { return android_atomic_dec(addend); }
-
 #elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc
 #define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1
 

Modified: trunk/Source/_javascript_Core/wtf/Platform.h (94190 => 94191)


--- trunk/Source/_javascript_Core/wtf/Platform.h	2011-08-31 15:02:48 UTC (rev 94190)
+++ trunk/Source/_javascript_Core/wtf/Platform.h	2011-08-31 15:10:10 UTC (rev 94191)
@@ -177,7 +177,6 @@
     && !defined(__EABI__) \
     && !defined(__VFP_FP__) \
     && !defined(_WIN32_WCE) \
-    && !defined(ANDROID)
 #define WTF_CPU_MIDDLE_ENDIAN 1
 
 #endif
@@ -303,11 +302,6 @@
 /* ==== OS() - underlying operating system; only to be used for mandated low-level services like 
    virtual memory, not to choose a GUI toolkit ==== */
 
-/* OS(ANDROID) - Android */
-#ifdef ANDROID
-#define WTF_OS_ANDROID 1
-#endif
-
 /* OS(AIX) - AIX */
 #ifdef _AIX
 #define WTF_OS_AIX 1
@@ -395,7 +389,6 @@
 
 /* OS(UNIX) - Any Unix-like system */
 #if   OS(AIX)              \
-    || OS(ANDROID)          \
     || OS(DARWIN)           \
     || OS(FREEBSD)          \
     || OS(HAIKU)            \
@@ -695,7 +688,7 @@
 
 #if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \
     && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \
-    && !OS(ANDROID) && !PLATFORM(BREWMP)
+    && !PLATFORM(BREWMP)
 #define HAVE_TM_GMTOFF 1
 #define HAVE_TM_ZONE 1
 #define HAVE_TIMEGM 1
@@ -768,16 +761,6 @@
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_SYS_TIME_H 1
 
-#elif OS(ANDROID)
-
-#define HAVE_ERRNO_H 1
-#define HAVE_LANGINFO_H 0
-#define HAVE_MMAP 1
-#define HAVE_SBRK 1
-#define HAVE_STRINGS_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_TIME_H 1
-
 #else
 
 /* FIXME: is this actually used or do other platforms generate their own config.h? */

Modified: trunk/Source/_javascript_Core/wtf/ThreadingPthreads.cpp (94190 => 94191)


--- trunk/Source/_javascript_Core/wtf/ThreadingPthreads.cpp	2011-08-31 15:02:48 UTC (rev 94190)
+++ trunk/Source/_javascript_Core/wtf/ThreadingPthreads.cpp	2011-08-31 15:10:10 UTC (rev 94191)
@@ -50,13 +50,6 @@
 #include <sys/time.h>
 #endif
 
-#if OS(ANDROID)
-#include "JNIUtility.h"
-#include "ThreadFunctionInvocation.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
-#endif
-
 #if OS(MAC_OS_X) && !defined(BUILDING_ON_LEOPARD)
 #include <objc/objc-auto.h>
 #endif
@@ -153,41 +146,9 @@
     threadMap().remove(id);
 }
 
-#if OS(ANDROID)
-static void* runThreadWithRegistration(void* arg)
-{
-    OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(static_cast<ThreadFunctionInvocation*>(arg));
-    JavaVM* vm = JSC::Bindings::getJavaVM();
-    JNIEnv* env;
-    void* ret = 0;
-    if (vm->AttachCurrentThread(&env, 0) == JNI_OK) {
-        ret = invocation->function(invocation->data);
-        vm->DetachCurrentThread();
-    }
-    return ret;
-}
-
 ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*)
 {
     pthread_t threadHandle;
-
-    // On the Android platform, threads must be registered with the VM before they run.
-    OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
-
-    if (pthread_create(&threadHandle, 0, runThreadWithRegistration, invocation.get())) {
-        LOG_ERROR("Failed to create pthread at entry point %p with data %p", entryPoint, data);
-        return 0;
-    }
-
-    // The thread will take ownership of invocation.
-    invocation.leakPtr();
-
-    return establishIdentifierForPthreadHandle(threadHandle);
-}
-#else
-ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*)
-{
-    pthread_t threadHandle;
     if (pthread_create(&threadHandle, 0, entryPoint, data)) {
         LOG_ERROR("Failed to create pthread at entry point %p with data %p", entryPoint, data);
         return 0;
@@ -195,7 +156,6 @@
 
     return establishIdentifierForPthreadHandle(threadHandle);
 }
-#endif
 
 void initializeCurrentThreadInternal(const char* threadName)
 {

Modified: trunk/Source/WebCore/ChangeLog (94190 => 94191)


--- trunk/Source/WebCore/ChangeLog	2011-08-31 15:02:48 UTC (rev 94190)
+++ trunk/Source/WebCore/ChangeLog	2011-08-31 15:10:10 UTC (rev 94191)
@@ -1,3 +1,17 @@
+2011-08-31  Andrei Popescu  <andr...@google.com>
+
+        Investigate current uses of OS(ANDROID)
+        https://bugs.webkit.org/show_bug.cgi?id=66761
+
+        Reviewed by Darin Adler.
+
+        Remove the last legacy Android code.
+
+        No new tests needed as the code wasn't tested in the first place.
+
+        * bridge/jni/JNIUtility.cpp:
+        (JSC::Bindings::getJNIEnv):
+
 2011-08-31  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r94082.

Modified: trunk/Source/WebCore/bridge/jni/JNIUtility.cpp (94190 => 94191)


--- trunk/Source/WebCore/bridge/jni/JNIUtility.cpp	2011-08-31 15:02:48 UTC (rev 94190)
+++ trunk/Source/WebCore/bridge/jni/JNIUtility.cpp	2011-08-31 15:10:10 UTC (rev 94191)
@@ -90,11 +90,8 @@
     } u;
     jint jniError = 0;
 
-#if OS(ANDROID)
-    jniError = getJavaVM()->AttachCurrentThread(&u.env, 0);
-#else
     jniError = getJavaVM()->AttachCurrentThread(&u.dummy, 0);
-#endif
+
     if (jniError == JNI_OK)
         return u.env;
     LOG_ERROR("AttachCurrentThread failed, returned %ld", static_cast<long>(jniError));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to