Bug 604799: allocate 64K code memory chunks on Windows, r=dvander
authorDavid Mandelin <dmandelin@mozilla.com>
Fri, 15 Oct 2010 15:42:56 -0700
changeset 56035 b36e628efeaede2cc6acc346cabe430c365e57bd
parent 56034 4545f5987736ebd43aad26ec5e26b261dcb4a7bd
child 56036 59b339eca10ffcfbd4d5114ddbdb50334770e42e
push id16371
push userrsayre@mozilla.com
push dateMon, 18 Oct 2010 17:04:27 +0000
treeherderautoland@eae6bdacf6d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs604799
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 604799: allocate 64K code memory chunks on Windows, r=dvander
js/src/assembler/jit/ExecutableAllocator.h
--- a/js/src/assembler/jit/ExecutableAllocator.h
+++ b/js/src/assembler/jit/ExecutableAllocator.h
@@ -50,17 +50,26 @@
 
 #if WTF_PLATFORM_WINCE
 // From pkfuncs.h (private header file from the Platform Builder)
 #define CACHE_SYNC_ALL 0x07F
 extern "C" __declspec(dllimport) void CacheRangeFlush(LPVOID pAddr, DWORD dwLength, DWORD dwFlags);
 #endif
 
 #define JIT_ALLOCATOR_PAGE_SIZE (ExecutableAllocator::pageSize)
-#define JIT_ALLOCATOR_LARGE_ALLOC_SIZE (ExecutableAllocator::pageSize * 4)
+#if WTF_PLATFORM_WIN_OS || WTF_PLATFORM_WINCE
+/*
+ * In practice, VirtualAlloc allocates in 64K chunks. (Technically, it
+ * allocates in page chunks, but the starting address is always a multiple
+ * of 64K, so each allocation uses up 64K of address space.
+ */
+# define JIT_ALLOCATOR_LARGE_ALLOC_SIZE (ExecutableAllocator::pageSize * 16)
+#else
+# define JIT_ALLOCATOR_LARGE_ALLOC_SIZE (ExecutableAllocator::pageSize * 4)
+#endif
 
 #if ENABLE_ASSEMBLER_WX_EXCLUSIVE
 #define PROTECTION_FLAGS_RW (PROT_READ | PROT_WRITE)
 #define PROTECTION_FLAGS_RX (PROT_READ | PROT_EXEC)
 #define INITIAL_PROTECTION_FLAGS PROTECTION_FLAGS_RX
 #else
 #define INITIAL_PROTECTION_FLAGS (PROT_READ | PROT_WRITE | PROT_EXEC)
 #endif