Changeset 780


Ignore:
Timestamp:
Aug 11, 2010, 3:00:59 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

3rdparty: jsc/webkit: Try to allocate memory blocks in high memory on OS/2 first and fall bacl to low memory on failure.

Location:
trunk/src/3rdparty
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/RegisterFile.h

    r639 r780  
    191191    #elif HAVE(VIRTUALALLOC)
    192192#if PLATFORM(OS2)
    193         APIRET arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
     193        APIRET arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
    194194        if (arc != NO_ERROR) {
    195             fprintf(stderr, "Could not allocate register file: %ld\n", arc);
    196             CRASH();
     195            // try low mem if high mem (OBJ_ANY) fails
     196            arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
     197            if (arc != NO_ERROR) {
     198                fprintf(stderr, "Could not allocate register file: %ld\n", arc);
     199                CRASH();
     200            }
    197201        }
    198202        size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize);
  • trunk/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp

    r730 r780  
    241241#elif (PLATFORM(OS2) && !HAVE(POSIX_MEMALIGN))
    242242    void* address = NULL;
    243     DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE);
     243    APIRET arc = DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_ANY);
     244    if (arc != NO_ERROR) {
     245        // try low mem if high mem (OBJ_ANY) fails
     246        arc = DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE);
     247        if (arc != NO_ERROR)
     248            CRASH();
     249    }
    244250    memset(address, 0, BLOCK_SIZE);
    245251#elif PLATFORM(WINCE)
  • trunk/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp

    r592 r780  
    238238#if PLATFORM(OS2)
    239239  void *result = NULL;
    240   DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE);
     240  APIRET arc = DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_ANY);
     241  if (arc != NO_ERROR) {
     242    // try low mem if high mem (OBJ_ANY) fails
     243    arc = DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE);
     244    if (arc != NO_ERROR)
     245      result = NULL;
     246  }
    241247#else
    242248  void* result = VirtualAlloc(NULL, size + extra,
  • trunk/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h

    r639 r780  
    191191    #elif HAVE(VIRTUALALLOC)
    192192#if PLATFORM(OS2)
    193         APIRET arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
     193        APIRET arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
    194194        if (arc != NO_ERROR) {
    195             fprintf(stderr, "Could not allocate register file: %ld\n", arc);
    196             CRASH();
     195            // try low mem if high mem (OBJ_ANY) fails
     196            arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
     197            if (arc != NO_ERROR) {
     198                fprintf(stderr, "Could not allocate register file: %ld\n", arc);
     199                CRASH();
     200            }
    197201        }
    198202        size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize);
  • trunk/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp

    r769 r780  
    228228#elif (PLATFORM(OS2) && !HAVE(POSIX_MEMALIGN))
    229229    void* address = NULL;
    230     DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE);
     230    APIRET arc = DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_ANY);
     231    if (arc != NO_ERROR) {
     232        // try low mem if high mem (OBJ_ANY) fails
     233        arc = DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE);
     234        if (arc != NO_ERROR)
     235            CRASH();
     236    }
    231237    memset(address, 0, BLOCK_SIZE);
    232238#elif PLATFORM(WINCE)
  • trunk/src/3rdparty/webkit/JavaScriptCore/wtf/TCSystemAlloc.cpp

    r636 r780  
    238238#if PLATFORM(OS2)
    239239  void *result = NULL;
    240   DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE);
     240  APIRET arc = DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_ANY);
     241  if (arc != NO_ERROR) {
     242    // try low mem if high mem (OBJ_ANY) fails
     243    arc = DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE);
     244    if (arc != NO_ERROR)
     245      result = NULL;
     246  }
    241247#else
    242248  void* result = VirtualAlloc(NULL, size + extra,
Note: See TracChangeset for help on using the changeset viewer.