Changeset 12300 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jan 22, 2006, 9:44:33 PM (19 years ago)
Author:
staikos
Message:

Reviewed by Maciej and Darin.

  • kjs/collector.cpp: merge major speedup from KDE on Linux

patch by Maks Orlovich, bug #6145
Also unify cpu detection

  • kjs/config.h: define simpler CPU macros
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r12296 r12300  
     12006-01-22  George Staikos <[email protected]>
     2
     3        Reviewed by Maciej.
     4
     5        * kjs/collector.cpp: merge major speedup from KDE on Linux
     6                             patch by Maks Orlovich, bug #6145
     7                             Also unify cpu detection
     8        * kjs/config.h: define simpler CPU macros
     9
    1102006-01-22  George Staikos <[email protected]>
    211
  • trunk/JavaScriptCore/kjs/collector.cpp

    r12296 r12300  
    314314    void *stackBase = (void *)pTib->StackBase;
    315315#else
    316     void *stackBase = 0;
    317     pthread_attr_t sattr;
     316    static void *stackBase = 0;
     317    static pthread_t stackThread;
     318    pthread_t thread = pthread_self();
     319    if (stackBase == 0 || thread != stackThread) {
     320        pthread_attr_t sattr;
    318321#ifdef HAVE_PTHREAD_NP_H
    319     // e.g. on FreeBSD 5.4, [email protected]
    320     pthread_attr_get_np(thread, &sattr);
     322        // e.g. on FreeBSD 5.4, [email protected]
     323        pthread_attr_get_np(thread, &sattr);
    321324#else
    322     // FIXME: this function is non-portable; other POSIX systems may have different np alternatives
    323     pthread_getattr_np(pthread_self(), &sattr);
    324 #endif
    325     // Should work but fails on Linux (?)
    326     //  pthread_attr_getstack(&sattr, &stackBase, &stackSize);
    327     pthread_attr_getstackaddr(&sattr, &stackBase);
    328     assert(stackBase);
     325        // FIXME: this function is non-portable; other POSIX systems may have different np alternatives
     326        pthread_getattr_np(thread, &sattr);
     327#endif
     328        // Should work but fails on Linux (?)
     329        //  pthread_attr_getstack(&sattr, &stackBase, &stackSize);
     330        pthread_attr_getstackaddr(&sattr, &stackBase);
     331        assert(stackBase);
     332        stackThread = thread;
     333    }
    329334#endif
    330335
     
    343348  thread_suspend(thread->machThread);
    344349
    345 #if __i386__
     350#if KJS_CPU_X86
    346351  i386_thread_state_t regs;
    347352  unsigned user_count = sizeof(regs)/sizeof(int);
    348353  thread_state_flavor_t flavor = i386_THREAD_STATE;
    349 #elif __ppc__
     354#elif KJS_CPU_PPC
    350355  ppc_thread_state_t  regs;
    351356  unsigned user_count = PPC_THREAD_STATE_COUNT;
    352357  thread_state_flavor_t flavor = PPC_THREAD_STATE;
    353 #elif __ppc64__
     358#elif KJS_CPU_PPC64
    354359  ppc_thread_state64_t  regs;
    355360  unsigned user_count = PPC_THREAD_STATE64_COUNT;
     
    365370 
    366371  // scan the stack
    367 #if __i386__
     372#if KJS_CPU_X86
    368373  markStackObjectsConservatively((void *)regs.esp, pthread_get_stackaddr_np(thread->posixThread));
    369 #elif defined(__ppc__) || defined(__ppc64__)
     374#elif KJS_CPU_PPC || KJS_CPU_PPC64
    370375  markStackObjectsConservatively((void *)regs.r1, pthread_get_stackaddr_np(thread->posixThread));
    371376#else
  • trunk/JavaScriptCore/kjs/config.h

    r11998 r12300  
    4141#define HAVE_STRING_H 1
    4242
    43 #ifdef __ppc__
     43#ifdef __ppc__ || __PPC__ || __powerpc__
     44#define KJS_CPU_PPC 1
    4445#define WORDS_BIGENDIAN 1
     46#elif __ppc64__ || __PPC64__
     47#define KJS_CPU_PPC64 1
     48#define WORDS_BIGENDIAN 1
     49#elif __i386__
     50#define KJS_CPU_X86 1
    4551#endif
    4652
Note: See TracChangeset for help on using the changeset viewer.