Index: /trunk/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/RegisterFile.h
===================================================================
--- /trunk/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/RegisterFile.h	(revision 779)
+++ /trunk/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/RegisterFile.h	(revision 780)
@@ -191,8 +191,12 @@
     #elif HAVE(VIRTUALALLOC)
 #if PLATFORM(OS2)
-        APIRET arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
+        APIRET arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE | OBJ_ANY);
         if (arc != NO_ERROR) {
-            fprintf(stderr, "Could not allocate register file: %ld\n", arc);
-            CRASH();
+            // try low mem if high mem (OBJ_ANY) fails
+            arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
+            if (arc != NO_ERROR) {
+                fprintf(stderr, "Could not allocate register file: %ld\n", arc);
+                CRASH();
+            }
         }
         size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize);
Index: /trunk/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
===================================================================
--- /trunk/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp	(revision 779)
+++ /trunk/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp	(revision 780)
@@ -241,5 +241,11 @@
 #elif (PLATFORM(OS2) && !HAVE(POSIX_MEMALIGN))
     void* address = NULL;
-    DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE);
+    APIRET arc = DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_ANY);
+    if (arc != NO_ERROR) {
+        // try low mem if high mem (OBJ_ANY) fails
+        arc = DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE);
+        if (arc != NO_ERROR)
+            CRASH();
+    }
     memset(address, 0, BLOCK_SIZE);
 #elif PLATFORM(WINCE)
Index: /trunk/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp
===================================================================
--- /trunk/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp	(revision 779)
+++ /trunk/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp	(revision 780)
@@ -238,5 +238,11 @@
 #if PLATFORM(OS2)
   void *result = NULL;
-  DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE);
+  APIRET arc = DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_ANY);
+  if (arc != NO_ERROR) {
+    // try low mem if high mem (OBJ_ANY) fails
+    arc = DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE);
+    if (arc != NO_ERROR)
+      result = NULL;
+  }
 #else
   void* result = VirtualAlloc(NULL, size + extra,
Index: /trunk/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h
===================================================================
--- /trunk/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h	(revision 779)
+++ /trunk/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h	(revision 780)
@@ -191,8 +191,12 @@
     #elif HAVE(VIRTUALALLOC)
 #if PLATFORM(OS2)
-        APIRET arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
+        APIRET arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE | OBJ_ANY);
         if (arc != NO_ERROR) {
-            fprintf(stderr, "Could not allocate register file: %ld\n", arc);
-            CRASH();
+            // try low mem if high mem (OBJ_ANY) fails
+            arc = DosAllocMem(reinterpret_cast<PPVOID>(&m_buffer), roundUpAllocationSize(bufferLength, commitSize), PAG_READ | PAG_WRITE);
+            if (arc != NO_ERROR) {
+                fprintf(stderr, "Could not allocate register file: %ld\n", arc);
+                CRASH();
+            }
         }
         size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize);
Index: /trunk/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp
===================================================================
--- /trunk/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp	(revision 779)
+++ /trunk/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp	(revision 780)
@@ -228,5 +228,11 @@
 #elif (PLATFORM(OS2) && !HAVE(POSIX_MEMALIGN))
     void* address = NULL;
-    DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE);
+    APIRET arc = DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_ANY);
+    if (arc != NO_ERROR) {
+        // try low mem if high mem (OBJ_ANY) fails
+        arc = DosAllocMem(&address, BLOCK_SIZE, PAG_COMMIT | PAG_READ | PAG_WRITE);
+        if (arc != NO_ERROR)
+            CRASH();
+    }
     memset(address, 0, BLOCK_SIZE);
 #elif PLATFORM(WINCE)
Index: /trunk/src/3rdparty/webkit/JavaScriptCore/wtf/TCSystemAlloc.cpp
===================================================================
--- /trunk/src/3rdparty/webkit/JavaScriptCore/wtf/TCSystemAlloc.cpp	(revision 779)
+++ /trunk/src/3rdparty/webkit/JavaScriptCore/wtf/TCSystemAlloc.cpp	(revision 780)
@@ -238,5 +238,11 @@
 #if PLATFORM(OS2)
   void *result = NULL;
-  DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE);
+  APIRET arc = DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_ANY);
+  if (arc != NO_ERROR) {
+    // try low mem if high mem (OBJ_ANY) fails
+    arc = DosAllocMem(&result, size + extra, PAG_COMMIT | PAG_READ | PAG_WRITE);
+    if (arc != NO_ERROR)
+      result = NULL;
+  }
 #else
   void* result = VirtualAlloc(NULL, size + extra,
