Changeset 94191 in webkit for trunk/Source/JavaScriptCore/wtf


Ignore:
Timestamp:
Aug 31, 2011, 8:10:10 AM (14 years ago)
Author:
[email protected]
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/JavaScriptCore:

  • wtf/Atomics.h:
  • wtf/Platform.h:
  • wtf/ThreadingPthreads.cpp:

(WTF::createThreadInternal):

Source/WebCore:

  • bridge/jni/JNIUtility.cpp:

(JSC::Bindings::getJNIEnv):

Location:
trunk/Source/JavaScriptCore/wtf
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wtf/Atomics.h

    r93450 r94191  
    6666#elif OS(DARWIN)
    6767#include <libkern/OSAtomic.h>
    68 #elif OS(ANDROID)
    69 #include <cutils/atomic.h>
    7068#elif OS(QNX)
    7169#include <atomic.h>
     
    104102inline int atomicDecrement(int volatile* addend) { return static_cast<int>(atomic_sub_value(reinterpret_cast<unsigned volatile*>(addend), 1)) - 1; }
    105103
    106 #elif OS(ANDROID)
    107 
    108 inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); }
    109 inline int atomicDecrement(int volatile* addend) { return android_atomic_dec(addend); }
    110 
    111104#elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc
    112105#define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r94044 r94191  
    178178    && !defined(__VFP_FP__) \
    179179    && !defined(_WIN32_WCE) \
    180     && !defined(ANDROID)
    181180#define WTF_CPU_MIDDLE_ENDIAN 1
    182181
     
    304303   virtual memory, not to choose a GUI toolkit ==== */
    305304
    306 /* OS(ANDROID) - Android */
    307 #ifdef ANDROID
    308 #define WTF_OS_ANDROID 1
    309 #endif
    310 
    311305/* OS(AIX) - AIX */
    312306#ifdef _AIX
     
    396390/* OS(UNIX) - Any Unix-like system */
    397391#if   OS(AIX)              \
    398     || OS(ANDROID)          \
    399392    || OS(DARWIN)           \
    400393    || OS(FREEBSD)          \
     
    696689#if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \
    697690    && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \
    698     && !OS(ANDROID) && !PLATFORM(BREWMP)
     691    && !PLATFORM(BREWMP)
    699692#define HAVE_TM_GMTOFF 1
    700693#define HAVE_TM_ZONE 1
     
    769762#define HAVE_SYS_TIME_H 1
    770763
    771 #elif OS(ANDROID)
    772 
    773 #define HAVE_ERRNO_H 1
    774 #define HAVE_LANGINFO_H 0
    775 #define HAVE_MMAP 1
    776 #define HAVE_SBRK 1
    777 #define HAVE_STRINGS_H 1
    778 #define HAVE_SYS_PARAM_H 1
    779 #define HAVE_SYS_TIME_H 1
    780 
    781764#else
    782765
  • trunk/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp

    r92154 r94191  
    5151#endif
    5252
    53 #if OS(ANDROID)
    54 #include "JNIUtility.h"
    55 #include "ThreadFunctionInvocation.h"
    56 #include <wtf/OwnPtr.h>
    57 #include <wtf/PassOwnPtr.h>
    58 #endif
    59 
    6053#if OS(MAC_OS_X) && !defined(BUILDING_ON_LEOPARD)
    6154#include <objc/objc-auto.h>
     
    154147}
    155148
    156 #if OS(ANDROID)
    157 static void* runThreadWithRegistration(void* arg)
    158 {
    159     OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(static_cast<ThreadFunctionInvocation*>(arg));
    160     JavaVM* vm = JSC::Bindings::getJavaVM();
    161     JNIEnv* env;
    162     void* ret = 0;
    163     if (vm->AttachCurrentThread(&env, 0) == JNI_OK) {
    164         ret = invocation->function(invocation->data);
    165         vm->DetachCurrentThread();
    166     }
    167     return ret;
    168 }
    169 
    170 ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*)
    171 {
    172     pthread_t threadHandle;
    173 
    174     // On the Android platform, threads must be registered with the VM before they run.
    175     OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
    176 
    177     if (pthread_create(&threadHandle, 0, runThreadWithRegistration, invocation.get())) {
    178         LOG_ERROR("Failed to create pthread at entry point %p with data %p", entryPoint, data);
    179         return 0;
    180     }
    181 
    182     // The thread will take ownership of invocation.
    183     invocation.leakPtr();
    184 
    185     return establishIdentifierForPthreadHandle(threadHandle);
    186 }
    187 #else
    188149ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*)
    189150{
     
    196157    return establishIdentifierForPthreadHandle(threadHandle);
    197158}
    198 #endif
    199159
    200160void initializeCurrentThreadInternal(const char* threadName)
Note: See TracChangeset for help on using the changeset viewer.