diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/double-conversion/utils.h | 2 | ||||
-rw-r--r-- | src/3rdparty/masm/masm.pri | 3 | ||||
-rw-r--r-- | src/3rdparty/masm/stubs/ExecutableAllocator.h | 2 | ||||
-rw-r--r-- | src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp | 66 | ||||
-rw-r--r-- | src/3rdparty/masm/wtf/PageBlock.cpp | 4 | ||||
-rw-r--r-- | src/3rdparty/masm/wtf/Platform.h | 5 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4global_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4mm.cpp | 2 |
8 files changed, 82 insertions, 4 deletions
diff --git a/src/3rdparty/double-conversion/utils.h b/src/3rdparty/double-conversion/utils.h index 29c7626345..1eca476913 100644 --- a/src/3rdparty/double-conversion/utils.h +++ b/src/3rdparty/double-conversion/utils.h @@ -57,7 +57,7 @@ // disabled.) // On Linux,x86 89255e-22 != Div_double(89255.0/1e22) #if defined(_M_X64) || defined(__x86_64__) || \ - defined(__ARMEL__) || defined(__avr32__) || \ + defined(__ARMEL__) || defined(__avr32__) || _M_ARM_FP || \ defined(__hppa__) || defined(__ia64__) || \ defined(__mips__) || defined(__powerpc__) || \ defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ diff --git a/src/3rdparty/masm/masm.pri b/src/3rdparty/masm/masm.pri index d7b315602e..3fd4aa6cec 100644 --- a/src/3rdparty/masm/masm.pri +++ b/src/3rdparty/masm/masm.pri @@ -11,7 +11,8 @@ HEADERS += $$PWD/wtf/FilePrintStream.h HEADERS += $$PWD/wtf/RawPointer.h -win32: SOURCES += $$PWD/wtf/OSAllocatorWin.cpp +winrt: SOURCES += $$PWD/wtf/OSAllocatorWinRT.cpp +else:win32: SOURCES += $$PWD/wtf/OSAllocatorWin.cpp else: SOURCES += $$PWD/wtf/OSAllocatorPosix.cpp HEADERS += $$PWD/wtf/OSAllocator.h diff --git a/src/3rdparty/masm/stubs/ExecutableAllocator.h b/src/3rdparty/masm/stubs/ExecutableAllocator.h index a8f54df39f..d8618b3b44 100644 --- a/src/3rdparty/masm/stubs/ExecutableAllocator.h +++ b/src/3rdparty/masm/stubs/ExecutableAllocator.h @@ -119,8 +119,10 @@ struct ExecutableAllocator { size_t iaddr = reinterpret_cast<size_t>(addr); size_t roundAddr = iaddr & ~(pageSize - static_cast<size_t>(1)); #if OS(WINDOWS) +#if !OS(WINRT) DWORD oldProtect; VirtualProtect(reinterpret_cast<void*>(roundAddr), size + (iaddr - roundAddr), PAGE_EXECUTE_READWRITE, &oldProtect); +#endif #else int mode = PROT_READ | PROT_EXEC; #if !ENABLE(ASSEMBLER_WX_EXCLUSIVE) diff --git a/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp b/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp new file mode 100644 index 0000000000..f851087eb2 --- /dev/null +++ b/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "OSAllocator.h" + +#if OS(WINRT) + +#include "windows.h" +#include <wtf/Assertions.h> + +namespace WTF { + +void* OSAllocator::reserveUncommitted(size_t bytes, Usage, bool, bool, bool) +{ + void* result = _aligned_malloc(bytes, 16); + if (!result) + CRASH(); + return result; +} + +void* OSAllocator::reserveAndCommit(size_t bytes, Usage usage, bool writable, bool executable, bool) +{ + return reserveUncommitted(bytes, usage, writable, executable); +} + +void OSAllocator::commit(void* address, size_t bytes, bool writable, bool executable) +{ + CRASH(); // Unimplemented +} + +void OSAllocator::decommit(void* address, size_t) +{ + _aligned_free(address); +} + +void OSAllocator::releaseDecommitted(void* address, size_t bytes) +{ + decommit(address, bytes); +} + +} // namespace WTF + +#endif // OS(WINRT) diff --git a/src/3rdparty/masm/wtf/PageBlock.cpp b/src/3rdparty/masm/wtf/PageBlock.cpp index 8bbd7eb600..a6f5585925 100644 --- a/src/3rdparty/masm/wtf/PageBlock.cpp +++ b/src/3rdparty/masm/wtf/PageBlock.cpp @@ -53,7 +53,11 @@ inline size_t systemPageSize() { static size_t size = 0; SYSTEM_INFO system_info; +#if OS(WINRT) + GetNativeSystemInfo(&system_info); +#else GetSystemInfo(&system_info); +#endif size = system_info.dwPageSize; return size; } diff --git a/src/3rdparty/masm/wtf/Platform.h b/src/3rdparty/masm/wtf/Platform.h index c81a9fe40f..c845f5e23c 100644 --- a/src/3rdparty/masm/wtf/Platform.h +++ b/src/3rdparty/masm/wtf/Platform.h @@ -404,6 +404,11 @@ #define WTF_OS_WINCE 1 #endif +/* OS(WINCE) - Windows Runtime; note that for this platform OS(WINDOWS) is also defined */ +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) +#define WTF_OS_WINRT 1 +#endif + /* OS(WINDOWS) - Any version of Windows */ #if defined(WIN32) || defined(_WIN32) #define WTF_OS_WINDOWS 1 diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index 53b306a1fe..7d7338f19c 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -84,7 +84,7 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); } // Black list some platforms #if defined(V4_ENABLE_JIT) -#if defined(Q_OS_IOS) || defined(Q_OS_WIN64) +#if defined(Q_OS_IOS) || defined(Q_OS_WIN64) || defined(Q_OS_WINRT) # undef V4_ENABLE_JIT #endif #endif diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp index c2d0c3a5ed..3a53588809 100644 --- a/src/qml/jsruntime/qv4mm.cpp +++ b/src/qml/jsruntime/qv4mm.cpp @@ -340,7 +340,7 @@ void MemoryManager::mark() if (!m_d->exactGC) { // push all caller saved registers to the stack, so we can find the objects living in these registers -#if COMPILER(MSVC) +#if COMPILER(MSVC) && !OS(WINRT) // WinRT must use exact GC # if CPU(X86_64) HANDLE thread = GetCurrentThread(); WOW64_CONTEXT ctxt; |