Changeset 62544 in webkit
- Timestamp:
- Jul 6, 2010 4:34:33 AM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r62511 r62544 1 2010-07-06 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r62511. 4 http://trac.webkit.org/changeset/62511 5 https://bugs.webkit.org/show_bug.cgi?id=41686 6 7 Breaks Linux/64bit compilation (Requested by xan_ on #webkit). 8 9 * jit/ExecutableAllocator.cpp: 10 * jit/ExecutableAllocatorFixedVMPool.cpp: 11 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): 12 (JSC::FixedVMPoolAllocator::free): 13 (JSC::ExecutablePool::systemAlloc): 14 * jit/ExecutableAllocatorPosix.cpp: 15 (JSC::ExecutableAllocator::reprotectRegion): 16 (JSC::ExecutableAllocator::cacheFlush): 17 * jit/ExecutableAllocatorSymbian.cpp: 18 * jit/ExecutableAllocatorWin.cpp: 19 * wtf/Platform.h: 20 1 21 2010-07-05 Gavin Barraclough <barraclough@apple.com> 2 22 -
trunk/JavaScriptCore/jit/ExecutableAllocator.cpp
r62511 r62544 34 34 size_t ExecutableAllocator::pageSize = 0; 35 35 36 #if ENABLE(ASSEMBLER_WX_EXCLUSIVE)37 void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSeting setting)38 {39 if (!pageSize)40 intializePageSize();41 42 // Calculate the start of the page containing this region,43 // and account for this extra memory within size.44 intptr_t startPtr = reinterpret_cast<intptr_t>(start);45 intptr_t pageStartPtr = startPtr & ~(pageSize - 1);46 void* pageStart = reinterpret_cast<void*>(pageStartPtr);47 size += (startPtr - pageStartPtr);48 49 // Round size up50 size += (pageSize - 1);51 size &= ~(pageSize - 1);52 53 mprotect(pageStart, size, (setting == Writable) ? PROTECTION_FLAGS_RW : PROTECTION_FLAGS_RX);54 }55 #endif56 57 #if CPU(ARM_TRADITIONAL) && OS(LINUX) && COMPILER(RVCT)58 __asm void ExecutableAllocator::cacheFlush(void* code, size_t size)59 {60 ARM61 push {r7}62 add r1, r1, r063 mov r7, #0xf000064 add r7, r7, #0x265 mov r2, #0x066 svc #0x067 pop {r7}68 bx lr69 }70 #endif71 72 36 } 73 37 -
trunk/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
r62511 r62544 28 28 #include "ExecutableAllocator.h" 29 29 30 #if ENABLE( EXECUTABLE_ALLOCATOR_FIXED)30 #if ENABLE(ASSEMBLER) && OS(DARWIN) && CPU(X86_64) 31 31 32 32 #include <errno.h> … … 40 40 #include <wtf/VMTags.h> 41 41 42 #if CPU(X86_64)43 // These limits suitable on 64-bit platforms (particularly x86-64, where we require all jumps to have a 2Gb max range).44 #define VM_POOL_SIZE (2u * 1024u * 1024u * 1024u) // 2Gb45 #define COALESCE_LIMIT (16u * 1024u * 1024u) // 16Mb46 #define VM_POOL_ASLR 147 #else48 // These limits are hopefully sensible on embedded platforms.49 #define VM_POOL_SIZE (32u * 1024u * 1024u) // 32Mb50 #define COALESCE_LIMIT (4u * 1024u * 1024u) // 4Mb51 #define VM_POOL_ASLR 052 #endif53 54 42 using namespace WTF; 55 43 56 44 namespace JSC { 45 46 #define TWO_GB (2u * 1024u * 1024u * 1024u) 47 #define SIXTEEN_MB (16u * 1024u * 1024u) 57 48 58 49 // FreeListEntry describes a free chunk of memory, stored in the freeList. … … 301 292 // 2^24, which should put up somewhere in the middle of usespace (in the address range 302 293 // 0x200000000000 .. 0x5fffffffffff). 303 intptr_t randomLocation = 0; 304 #if VM_POOL_ASLR 305 randomLocation = arc4random() & ((1 << 25) - 1); 294 intptr_t randomLocation = arc4random() & ((1 << 25) - 1); 306 295 randomLocation += (1 << 24); 307 296 randomLocation <<= 21; 308 #endif309 297 m_base = mmap(reinterpret_cast<void*>(randomLocation), m_totalHeapSize, INITIAL_PROTECTION_FLAGS, MAP_PRIVATE | MAP_ANON, VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY, 0); 310 298 if (!m_base) … … 400 388 // coalescing any neighboring fragments. 401 389 m_countFreedSinceLastCoalesce += size; 402 if (m_countFreedSinceLastCoalesce >= COALESCE_LIMIT) {390 if (m_countFreedSinceLastCoalesce >= SIXTEEN_MB) { 403 391 m_countFreedSinceLastCoalesce = 0; 404 392 coalesceFreeSpace(); … … 442 430 443 431 if (!allocator) 444 allocator = new FixedVMPoolAllocator(JIT_ALLOCATOR_LARGE_ALLOC_SIZE, VM_POOL_SIZE);432 allocator = new FixedVMPoolAllocator(JIT_ALLOCATOR_LARGE_ALLOC_SIZE, TWO_GB); 445 433 ExecutablePool::Allocation alloc = {reinterpret_cast<char*>(allocator->alloc(size)), size}; 446 434 return alloc; -
trunk/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp
r62511 r62544 28 28 #include "ExecutableAllocator.h" 29 29 30 #if ENABLE( EXECUTABLE_ALLOCATOR_DEMAND) && !OS(WINDOWS) && !OS(SYMBIAN)30 #if ENABLE(ASSEMBLER) && OS(UNIX) && !OS(SYMBIAN) 31 31 32 32 #include <sys/mman.h> … … 35 35 36 36 namespace JSC { 37 38 #if !(OS(DARWIN) && CPU(X86_64)) 37 39 38 40 void ExecutableAllocator::intializePageSize() … … 56 58 } 57 59 60 #endif // !(OS(DARWIN) && CPU(X86_64)) 61 62 #if ENABLE(ASSEMBLER_WX_EXCLUSIVE) 63 void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSeting setting) 64 { 65 if (!pageSize) 66 intializePageSize(); 67 68 // Calculate the start of the page containing this region, 69 // and account for this extra memory within size. 70 intptr_t startPtr = reinterpret_cast<intptr_t>(start); 71 intptr_t pageStartPtr = startPtr & ~(pageSize - 1); 72 void* pageStart = reinterpret_cast<void*>(pageStartPtr); 73 size += (startPtr - pageStartPtr); 74 75 // Round size up 76 size += (pageSize - 1); 77 size &= ~(pageSize - 1); 78 79 mprotect(pageStart, size, (setting == Writable) ? PROTECTION_FLAGS_RW : PROTECTION_FLAGS_RX); 80 } 81 #endif 82 83 #if CPU(ARM_TRADITIONAL) && OS(LINUX) && COMPILER(RVCT) 84 __asm void ExecutableAllocator::cacheFlush(void* code, size_t size) 85 { 86 ARM 87 push {r7} 88 add r1, r1, r0 89 mov r7, #0xf0000 90 add r7, r7, #0x2 91 mov r2, #0x0 92 svc #0x0 93 pop {r7} 94 bx lr 95 } 96 #endif 97 58 98 } 59 99 60 #endif 100 #endif // HAVE(ASSEMBLER) -
trunk/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp
r62511 r62544 23 23 #include "ExecutableAllocator.h" 24 24 25 #if ENABLE( EXECUTABLE_ALLOCATOR_DEMAND) && OS(SYMBIAN)25 #if ENABLE(ASSEMBLER) && OS(SYMBIAN) 26 26 27 27 #include <e32hal.h> -
trunk/JavaScriptCore/jit/ExecutableAllocatorWin.cpp
r62511 r62544 28 28 #include "ExecutableAllocator.h" 29 29 30 #if ENABLE( EXECUTABLE_ALLOCATOR_DEMAND) && OS(WINDOWS)30 #if ENABLE(ASSEMBLER) && OS(WINDOWS) 31 31 32 32 #include "windows.h" -
trunk/JavaScriptCore/wtf/Platform.h
r62511 r62544 1044 1044 #endif 1045 1045 1046 /* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.1047 On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */1048 #if ENABLE(ASSEMBLER)1049 #if CPU(X86_64)1050 #define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 11051 #else1052 #define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 11053 #endif1054 #endif1055 1056 1046 #if !defined(ENABLE_PAN_SCROLLING) && OS(WINDOWS) 1057 1047 #define ENABLE_PAN_SCROLLING 1
Note: See TracChangeset
for help on using the changeset viewer.