Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (100036 => 100037)
--- trunk/Source/_javascript_Core/ChangeLog 2011-11-11 23:40:57 UTC (rev 100036)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-11-11 23:43:00 UTC (rev 100037)
@@ -1,3 +1,23 @@
+2011-11-11 Gavin Barraclough <[email protected]>
+
+ 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.
+
2011-11-11 David Kilzer <[email protected]>
Only define BUILDING_ON_* and TARGETING_* macros when building for Mac OS X
Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.h (100036 => 100037)
--- trunk/Source/_javascript_Core/interpreter/Interpreter.h 2011-11-11 23:40:57 UTC (rev 100036)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.h 2011-11-11 23:43:00 UTC (rev 100037)
@@ -80,7 +80,13 @@
CallFrame* oldCallFrame;
};
+#if PLATFORM(IOS)
+ // We use a smaller reentrancy limit on iPhone because of the high amount of
+ // stack space required on the web thread.
+ enum { MaxLargeThreadReentryDepth = 93, MaxSmallThreadReentryDepth = 32 };
+#else
enum { MaxLargeThreadReentryDepth = 256, MaxSmallThreadReentryDepth = 32 };
+#endif // PLATFORM(IOS)
class Interpreter {
WTF_MAKE_FAST_ALLOCATED;
Modified: trunk/Source/_javascript_Core/runtime/DatePrototype.cpp (100036 => 100037)
--- trunk/Source/_javascript_Core/runtime/DatePrototype.cpp 2011-11-11 23:40:57 UTC (rev 100036)
+++ trunk/Source/_javascript_Core/runtime/DatePrototype.cpp 2011-11-11 23:43:00 UTC (rev 100037)
@@ -60,7 +60,7 @@
#include <sys/timeb.h>
#endif
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) || PLATFORM(IOS)
#include <CoreFoundation/CoreFoundation.h>
#endif
@@ -128,7 +128,7 @@
enum LocaleDateTimeFormat { LocaleDateAndTime, LocaleDate, LocaleTime };
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) || PLATFORM(IOS)
// FIXME: Since this is superior to the strftime-based version, why limit this to PLATFORM(MAC)?
// Instead we should consider using this whenever USE(CF) is true.
@@ -195,7 +195,7 @@
return jsNontrivialString(exec, UString(buffer, length));
}
-#else // !PLATFORM(MAC)
+#else // !PLATFORM(MAC) && !PLATFORM(IOS)
static JSCell* formatLocaleDate(ExecState* exec, const GregorianDateTime& gdt, LocaleDateTimeFormat format)
{
@@ -282,7 +282,7 @@
return formatLocaleDate(exec, *gregorianDateTime, format);
}
-#endif // !PLATFORM(MAC)
+#endif // !PLATFORM(MAC) && !PLATFORM(IOS)
// Converts a list of arguments sent to a Date member function into milliseconds, updating
// ms (representing milliseconds) and t (representing the rest of the date structure) appropriately.
Modified: trunk/Source/_javascript_Core/wtf/FastMalloc.cpp (100036 => 100037)
--- trunk/Source/_javascript_Core/wtf/FastMalloc.cpp 2011-11-11 23:40:57 UTC (rev 100036)
+++ trunk/Source/_javascript_Core/wtf/FastMalloc.cpp 2011-11-11 23:43:00 UTC (rev 100037)
@@ -100,7 +100,11 @@
#endif
// Use a background thread to periodically scavenge memory to release back to the system
+#if PLATFORM(IOS)
+#define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 0
+#else
#define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 1
+#endif
#ifndef NDEBUG
namespace WTF {
@@ -638,7 +642,11 @@
// Lower and upper bounds on the per-thread cache sizes
static const size_t kMinThreadCacheSize = kMaxSize * 2;
+#if PLATFORM(IOS)
+static const size_t kMaxThreadCacheSize = 512 * 1024;
+#else
static const size_t kMaxThreadCacheSize = 2 << 20;
+#endif
// Default bound on the total amount of thread caches
static const size_t kDefaultOverallThreadCacheSize = 16 << 20;
@@ -1940,9 +1948,13 @@
scavenge_counter_ -= n;
if (scavenge_counter_ >= 0) return; // Not yet time to scavenge
+#if PLATFORM(IOS)
+ static const size_t kDefaultReleaseDelay = 64;
+#else
// If there is nothing to release, wait for so many pages before
// scavenging again. With 4K pages, this comes to 16MB of memory.
static const size_t kDefaultReleaseDelay = 1 << 8;
+#endif
// Find index of free list to scavenge
size_t index = scavenge_index_ + 1;
@@ -1958,7 +1970,11 @@
s->decommitted = true;
DLL_Prepend(&slist->returned, s);
+#if PLATFORM(IOS)
+ scavenge_counter_ = std::max<size_t>(16UL, std::min<size_t>(kDefaultReleaseDelay, kDefaultReleaseDelay - (free_pages_ / kDefaultReleaseDelay)));
+#else
scavenge_counter_ = std::max<size_t>(64UL, std::min<size_t>(kDefaultReleaseDelay, kDefaultReleaseDelay - (free_pages_ / kDefaultReleaseDelay)));
+#endif
if (index == kMaxPages && !DLL_IsEmpty(&slist->normal))
scavenge_index_ = index - 1;
@@ -4647,10 +4663,10 @@
malloc_introspection_t jscore_fastmalloc_introspection = { &FastMallocZone::enumerate, &FastMallocZone::goodSize, &FastMallocZone::check, &FastMallocZone::print,
&FastMallocZone::log, &FastMallocZone::forceLock, &FastMallocZone::forceUnlock, &FastMallocZone::statistics
-#ifndef BUILDING_ON_LEOPARD
+#if !defined(BUILDING_ON_LEOPARD) || OS(IOS)
, 0 // zone_locked will not be called on the zone unless it advertises itself as version five or higher.
#endif
-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) || OS(IOS)
, 0, 0, 0, 0 // These members will not be used unless the zone advertises itself as version seven or higher.
#endif
Modified: trunk/Source/_javascript_Core/wtf/OSAllocatorPosix.cpp (100036 => 100037)
--- trunk/Source/_javascript_Core/wtf/OSAllocatorPosix.cpp 2011-11-11 23:40:57 UTC (rev 100036)
+++ trunk/Source/_javascript_Core/wtf/OSAllocatorPosix.cpp 2011-11-11 23:43:00 UTC (rev 100037)
@@ -54,6 +54,10 @@
protection |= PROT_EXEC;
int flags = MAP_PRIVATE | MAP_ANON;
+#if defined MAP_JIT
+ if (executable)
+ flags |= MAP_JIT;
+#endif
#if OS(LINUX)
// Linux distros usually do not allow overcommit by default, so
Modified: trunk/Source/_javascript_Core/wtf/Platform.h (100036 => 100037)
--- trunk/Source/_javascript_Core/wtf/Platform.h 2011-11-11 23:40:57 UTC (rev 100036)
+++ trunk/Source/_javascript_Core/wtf/Platform.h 2011-11-11 23:43:00 UTC (rev 100037)
@@ -547,6 +547,10 @@
#define WTF_USE_WK_SCROLLBAR_PAINTER 1
#endif
+#if PLATFORM(IOS)
+#define DONT_FINALIZE_ON_MAIN_THREAD 1
+#endif
+
#if PLATFORM(QT) && OS(DARWIN)
#define WTF_USE_CF 1
#endif
@@ -562,18 +566,34 @@
#define ENABLE_FTPDIR 1
#define ENABLE_GEOLOCATION 1
#define ENABLE_ICONDATABASE 0
-#define ENABLE_INSPECTOR 0
+#define ENABLE_INSPECTOR 1
#define ENABLE_JAVA_BRIDGE 0
#define ENABLE_NETSCAPE_PLUGIN_API 0
#define ENABLE_ORIENTATION_EVENTS 1
#define ENABLE_REPAINT_THROTTLING 1
+#define ENABLE_WEB_ARCHIVE 1
+#define HAVE_NETWORK_CFDATA_ARRAY_CALLBACK 1
+#define HAVE_PTHREAD_RWLOCK 1
#define HAVE_READLINE 1
+#define HAVE_RUNLOOP_TIMER 0
#define WTF_USE_CF 1
+#define WTF_USE_CFNETWORK 1
#define WTF_USE_PTHREADS 1
-#define HAVE_PTHREAD_RWLOCK 1
-#define ENABLE_WEB_ARCHIVE 1
+
+#if PLATFORM(IOS_SIMULATOR)
+ #define ENABLE_INTERPRETER 1
+ #define ENABLE_JIT 0
+ #define ENABLE_YARR 0
+ #define ENABLE_YARR_JIT 0
+#else
+ #define ENABLE_INTERPRETER 1
+ #define ENABLE_JIT 1
+ #define ENABLE_YARR 1
+ #define ENABLE_YARR_JIT 1
#endif
+#endif
+
#if PLATFORM(WIN) && !OS(WINCE)
#define WTF_USE_CF 1
#define WTF_USE_PTHREADS 0
@@ -583,7 +603,7 @@
#define WTF_USE_CFNETWORK 1
#endif
-#if USE(CFNETWORK) || PLATFORM(MAC)
+#if USE(CFNETWORK) || PLATFORM(MAC) || PLATFORM(IOS)
#define WTF_USE_CFURLCACHE 1
#define WTF_USE_CFURLSTORAGESESSIONS 1
#endif
@@ -674,6 +694,7 @@
#if PLATFORM(IOS)
#define HAVE_MADV_FREE 1
+#define HAVE_PTHREAD_SETNAME_NP 1
#endif
#elif OS(WINDOWS)
@@ -967,16 +988,11 @@
#if ENABLE(JIT) || ENABLE(YARR_JIT)
#define ENABLE_ASSEMBLER 1
#endif
-/* Setting this flag prevents the assembler from using RWX memory; this may improve
- security but currectly comes at a significant performance cost. */
-#if PLATFORM(IOS)
-#define ENABLE_ASSEMBLER_WX_EXCLUSIVE 1
-#endif
/* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */
#if ENABLE(ASSEMBLER)
-#if CPU(X86_64)
+#if CPU(X86_64) || PLATFORM(IOS)
#define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1
#else
#define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1
@@ -1040,7 +1056,7 @@
#define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
/* FIXME: Eventually we should enable this for all platforms and get rid of the define. */
-#if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)
+#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)
#define WTF_USE_PLATFORM_STRATEGIES 1
#endif