Changeset 100037 in webkit


Ignore:
Timestamp:
Nov 11, 2011 3:43:00 PM (12 years ago)
Author:
barraclough@apple.com
Message:

Update iOS port's configuration setting, particularly in Platform.h
https://bugs.webkit.org/show_bug.cgi?id=72187

Reviewed by David Kilzer.

  • interpreter/Interpreter.h:
    • Lower the reentry depth.
  • runtime/DatePrototype.cpp:
    • iOS also uses CF.
  • wtf/FastMalloc.cpp:

(WTF::TCMalloc_PageHeap::IncrementalScavenge):

  • Update fastmalloc configuration for iOS.
  • wtf/OSAllocatorPosix.cpp:

(WTF::OSAllocator::reserveAndCommit):

  • Added flag.
  • wtf/Platform.h:
    • Update platform configuration for iOS.
Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r100031 r100037  
     12011-11-11  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Update iOS port's configuration setting, particularly in Platform.h
     4        https://bugs.webkit.org/show_bug.cgi?id=72187
     5       
     6        Reviewed by David Kilzer.
     7
     8        * interpreter/Interpreter.h:
     9            - Lower the reentry depth.
     10        * runtime/DatePrototype.cpp:
     11            - iOS also uses CF.
     12        * wtf/FastMalloc.cpp:
     13        (WTF::TCMalloc_PageHeap::IncrementalScavenge):
     14            - Update fastmalloc configuration for iOS.
     15        * wtf/OSAllocatorPosix.cpp:
     16        (WTF::OSAllocator::reserveAndCommit):
     17            - Added flag.
     18        * wtf/Platform.h:
     19            - Update platform configuration for iOS.
     20
    1212011-11-11  David Kilzer  <ddkilzer@apple.com>
    222
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r96146 r100037  
    8181    };
    8282
     83#if PLATFORM(IOS)
     84    // We use a smaller reentrancy limit on iPhone because of the high amount of
     85    // stack space required on the web thread.
     86    enum { MaxLargeThreadReentryDepth = 93, MaxSmallThreadReentryDepth = 32 };
     87#else
    8388    enum { MaxLargeThreadReentryDepth = 256, MaxSmallThreadReentryDepth = 32 };
     89#endif // PLATFORM(IOS)
    8490
    8591    class Interpreter {
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp

    r100006 r100037  
    6161#endif
    6262
    63 #if PLATFORM(MAC)
     63#if PLATFORM(MAC) || PLATFORM(IOS)
    6464#include <CoreFoundation/CoreFoundation.h>
    6565#endif
     
    129129enum LocaleDateTimeFormat { LocaleDateAndTime, LocaleDate, LocaleTime };
    130130 
    131 #if PLATFORM(MAC)
     131#if PLATFORM(MAC) || PLATFORM(IOS)
    132132
    133133// FIXME: Since this is superior to the strftime-based version, why limit this to PLATFORM(MAC)?
     
    196196}
    197197
    198 #else // !PLATFORM(MAC)
     198#else // !PLATFORM(MAC) && !PLATFORM(IOS)
    199199
    200200static JSCell* formatLocaleDate(ExecState* exec, const GregorianDateTime& gdt, LocaleDateTimeFormat format)
     
    283283}
    284284
    285 #endif // !PLATFORM(MAC)
     285#endif // !PLATFORM(MAC) && !PLATFORM(IOS)
    286286
    287287// Converts a list of arguments sent to a Date member function into milliseconds, updating
  • trunk/Source/JavaScriptCore/wtf/FastMalloc.cpp

    r95934 r100037  
    101101
    102102// Use a background thread to periodically scavenge memory to release back to the system
     103#if PLATFORM(IOS)
     104#define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 0
     105#else
    103106#define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 1
     107#endif
    104108
    105109#ifndef NDEBUG
     
    639643// Lower and upper bounds on the per-thread cache sizes
    640644static const size_t kMinThreadCacheSize = kMaxSize * 2;
     645#if PLATFORM(IOS)
     646static const size_t kMaxThreadCacheSize = 512 * 1024;
     647#else
    641648static const size_t kMaxThreadCacheSize = 2 << 20;
     649#endif
    642650
    643651// Default bound on the total amount of thread caches
     
    19411949  if (scavenge_counter_ >= 0) return;  // Not yet time to scavenge
    19421950
     1951#if PLATFORM(IOS)
     1952  static const size_t kDefaultReleaseDelay = 64;
     1953#else
    19431954  // If there is nothing to release, wait for so many pages before
    19441955  // scavenging again.  With 4K pages, this comes to 16MB of memory.
    19451956  static const size_t kDefaultReleaseDelay = 1 << 8;
     1957#endif
    19461958
    19471959  // Find index of free list to scavenge
     
    19591971      DLL_Prepend(&slist->returned, s);
    19601972
     1973#if PLATFORM(IOS)
     1974      scavenge_counter_ = std::max<size_t>(16UL, std::min<size_t>(kDefaultReleaseDelay, kDefaultReleaseDelay - (free_pages_ / kDefaultReleaseDelay)));
     1975#else
    19611976      scavenge_counter_ = std::max<size_t>(64UL, std::min<size_t>(kDefaultReleaseDelay, kDefaultReleaseDelay - (free_pages_ / kDefaultReleaseDelay)));
     1977#endif
    19621978
    19631979      if (index == kMaxPages && !DLL_IsEmpty(&slist->normal))
     
    46484664    &FastMallocZone::log, &FastMallocZone::forceLock, &FastMallocZone::forceUnlock, &FastMallocZone::statistics
    46494665
    4650 #ifndef BUILDING_ON_LEOPARD
     4666#if !defined(BUILDING_ON_LEOPARD) || OS(IOS)
    46514667    , 0 // zone_locked will not be called on the zone unless it advertises itself as version five or higher.
    46524668#endif
    4653 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     4669#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) || OS(IOS)
    46544670    , 0, 0, 0, 0 // These members will not be used unless the zone advertises itself as version seven or higher.
    46554671#endif
  • trunk/Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp

    r95901 r100037  
    5555
    5656    int flags = MAP_PRIVATE | MAP_ANON;
     57#if defined MAP_JIT
     58    if (executable)
     59        flags |= MAP_JIT;
     60#endif
    5761
    5862#if OS(LINUX)
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r100031 r100037  
    548548#endif
    549549
     550#if PLATFORM(IOS)
     551#define DONT_FINALIZE_ON_MAIN_THREAD 1
     552#endif
     553
    550554#if PLATFORM(QT) && OS(DARWIN)
    551555#define WTF_USE_CF 1
     
    563567#define ENABLE_GEOLOCATION 1
    564568#define ENABLE_ICONDATABASE 0
    565 #define ENABLE_INSPECTOR 0
     569#define ENABLE_INSPECTOR 1
    566570#define ENABLE_JAVA_BRIDGE 0
    567571#define ENABLE_NETSCAPE_PLUGIN_API 0
    568572#define ENABLE_ORIENTATION_EVENTS 1
    569573#define ENABLE_REPAINT_THROTTLING 1
     574#define ENABLE_WEB_ARCHIVE 1
     575#define HAVE_NETWORK_CFDATA_ARRAY_CALLBACK 1
     576#define HAVE_PTHREAD_RWLOCK 1
    570577#define HAVE_READLINE 1
     578#define HAVE_RUNLOOP_TIMER 0
    571579#define WTF_USE_CF 1
     580#define WTF_USE_CFNETWORK 1
    572581#define WTF_USE_PTHREADS 1
    573 #define HAVE_PTHREAD_RWLOCK 1
    574 #define ENABLE_WEB_ARCHIVE 1
     582
     583#if PLATFORM(IOS_SIMULATOR)
     584    #define ENABLE_INTERPRETER 1
     585    #define ENABLE_JIT 0
     586    #define ENABLE_YARR 0
     587    #define ENABLE_YARR_JIT 0
     588#else
     589    #define ENABLE_INTERPRETER 1
     590    #define ENABLE_JIT 1
     591    #define ENABLE_YARR 1
     592    #define ENABLE_YARR_JIT 1
     593#endif
     594
    575595#endif
    576596
     
    584604#endif
    585605
    586 #if USE(CFNETWORK) || PLATFORM(MAC)
     606#if USE(CFNETWORK) || PLATFORM(MAC) || PLATFORM(IOS)
    587607#define WTF_USE_CFURLCACHE 1
    588608#define WTF_USE_CFURLSTORAGESESSIONS 1
     
    675695#if PLATFORM(IOS)
    676696#define HAVE_MADV_FREE 1
     697#define HAVE_PTHREAD_SETNAME_NP 1
    677698#endif
    678699
     
    968989#define ENABLE_ASSEMBLER 1
    969990#endif
    970 /* Setting this flag prevents the assembler from using RWX memory; this may improve
    971    security but currectly comes at a significant performance cost. */
    972 #if PLATFORM(IOS)
    973 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 1
    974 #endif
    975991
    976992/* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
    977993   On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */
    978994#if ENABLE(ASSEMBLER)
    979 #if CPU(X86_64)
     995#if CPU(X86_64) || PLATFORM(IOS)
    980996#define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1
    981997#else
     
    10411057
    10421058/* FIXME: Eventually we should enable this for all platforms and get rid of the define. */
    1043 #if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)
     1059#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)
    10441060#define WTF_USE_PLATFORM_STRATEGIES 1
    10451061#endif
Note: See TracChangeset for help on using the changeset viewer.