Changeset 62544 in webkit


Ignore:
Timestamp:
Jul 6, 2010 4:34:33 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-07-06 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r62511.
http://trac.webkit.org/changeset/62511
https://bugs.webkit.org/show_bug.cgi?id=41686

Breaks Linux/64bit compilation (Requested by xan_ on #webkit).

  • jit/ExecutableAllocator.cpp:
  • jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): (JSC::FixedVMPoolAllocator::free): (JSC::ExecutablePool::systemAlloc):
  • jit/ExecutableAllocatorPosix.cpp: (JSC::ExecutableAllocator::reprotectRegion): (JSC::ExecutableAllocator::cacheFlush):
  • jit/ExecutableAllocatorSymbian.cpp:
  • jit/ExecutableAllocatorWin.cpp:
  • wtf/Platform.h:
Location:
trunk/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r62511 r62544  
     12010-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
    1212010-07-05  Gavin Barraclough  <barraclough@apple.com>
    222
  • trunk/JavaScriptCore/jit/ExecutableAllocator.cpp

    r62511 r62544  
    3434size_t ExecutableAllocator::pageSize = 0;
    3535
    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 up
    50     size += (pageSize - 1);
    51     size &= ~(pageSize - 1);
    52 
    53     mprotect(pageStart, size, (setting == Writable) ? PROTECTION_FLAGS_RW : PROTECTION_FLAGS_RX);
    54 }
    55 #endif
    56 
    57 #if CPU(ARM_TRADITIONAL) && OS(LINUX) && COMPILER(RVCT)
    58 __asm void ExecutableAllocator::cacheFlush(void* code, size_t size)
    59 {
    60     ARM
    61     push {r7}
    62     add r1, r1, r0
    63     mov r7, #0xf0000
    64     add r7, r7, #0x2
    65     mov r2, #0x0
    66     svc #0x0
    67     pop {r7}
    68     bx lr
    69 }
    70 #endif
    71 
    7236}
    7337
  • trunk/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp

    r62511 r62544  
    2828#include "ExecutableAllocator.h"
    2929
    30 #if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
     30#if ENABLE(ASSEMBLER) && OS(DARWIN) && CPU(X86_64)
    3131
    3232#include <errno.h>
     
    4040#include <wtf/VMTags.h>
    4141
    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) // 2Gb
    45     #define COALESCE_LIMIT (16u * 1024u * 1024u) // 16Mb
    46     #define VM_POOL_ASLR 1
    47 #else
    48     // These limits are hopefully sensible on embedded platforms.
    49     #define VM_POOL_SIZE (32u * 1024u * 1024u) // 32Mb
    50     #define COALESCE_LIMIT (4u * 1024u * 1024u) // 4Mb
    51     #define VM_POOL_ASLR 0
    52 #endif
    53 
    5442using namespace WTF;
    5543
    5644namespace JSC {
     45
     46#define TWO_GB (2u * 1024u * 1024u * 1024u)
     47#define SIXTEEN_MB (16u * 1024u * 1024u)
    5748
    5849// FreeListEntry describes a free chunk of memory, stored in the freeList.
     
    301292        // 2^24, which should put up somewhere in the middle of usespace (in the address range
    302293        // 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);
    306295        randomLocation += (1 << 24);
    307296        randomLocation <<= 21;
    308 #endif
    309297        m_base = mmap(reinterpret_cast<void*>(randomLocation), m_totalHeapSize, INITIAL_PROTECTION_FLAGS, MAP_PRIVATE | MAP_ANON, VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY, 0);
    310298        if (!m_base)
     
    400388        // coalescing any neighboring fragments.
    401389        m_countFreedSinceLastCoalesce += size;
    402         if (m_countFreedSinceLastCoalesce >= COALESCE_LIMIT) {
     390        if (m_countFreedSinceLastCoalesce >= SIXTEEN_MB) {
    403391            m_countFreedSinceLastCoalesce = 0;
    404392            coalesceFreeSpace();
     
    442430
    443431    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);
    445433    ExecutablePool::Allocation alloc = {reinterpret_cast<char*>(allocator->alloc(size)), size};
    446434    return alloc;
  • trunk/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp

    r62511 r62544  
    2828#include "ExecutableAllocator.h"
    2929
    30 #if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND) && !OS(WINDOWS) && !OS(SYMBIAN)
     30#if ENABLE(ASSEMBLER) && OS(UNIX) && !OS(SYMBIAN)
    3131
    3232#include <sys/mman.h>
     
    3535
    3636namespace JSC {
     37
     38#if !(OS(DARWIN) && CPU(X86_64))
    3739
    3840void ExecutableAllocator::intializePageSize()
     
    5658}
    5759
     60#endif // !(OS(DARWIN) && CPU(X86_64))
     61
     62#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
     63void 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
    5898}
    5999
    60 #endif
     100#endif // HAVE(ASSEMBLER)
  • trunk/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp

    r62511 r62544  
    2323#include "ExecutableAllocator.h"
    2424
    25 #if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND) && OS(SYMBIAN)
     25#if ENABLE(ASSEMBLER) && OS(SYMBIAN)
    2626
    2727#include <e32hal.h>
  • trunk/JavaScriptCore/jit/ExecutableAllocatorWin.cpp

    r62511 r62544  
    2828#include "ExecutableAllocator.h"
    2929
    30 #if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND) && OS(WINDOWS)
     30#if ENABLE(ASSEMBLER) && OS(WINDOWS)
    3131
    3232#include "windows.h"
  • trunk/JavaScriptCore/wtf/Platform.h

    r62511 r62544  
    10441044#endif
    10451045
    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 1
    1051 #else
    1052 #define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1
    1053 #endif
    1054 #endif
    1055 
    10561046#if !defined(ENABLE_PAN_SCROLLING) && OS(WINDOWS)
    10571047#define ENABLE_PAN_SCROLLING 1
Note: See TracChangeset for help on using the changeset viewer.