Commit 8bef6983 authored by Kevin Velghe's avatar Kevin Velghe

New upstream version 0.0.0+tp5

parent 187ad09f
load(qt_build_config)
QMAKEPATH += $$PWD/Tools/qmake
ROOT_WEBKIT_DIR = $$PWD
ROOT_BUILD_DIR = $$shadowed($$PWD)
This diff is collapsed.
......@@ -11,7 +11,7 @@ add_subdirectory(JavaScriptCore)
add_subdirectory(WebCore)
if (WIN32 AND ENABLE_GRAPHICS_CONTEXT_3D)
if (${PORT} STREQUAL "Win" AND ENABLE_GRAPHICS_CONTEXT_3D)
add_subdirectory(ThirdParty/ANGLE)
endif ()
......
......@@ -987,6 +987,7 @@ target_link_libraries(LLIntOffsetsExtractor WTF)
# after every asm.rb run.
if (MSVC)
set(LLIntOutput LowLevelInterpreterWin.asm)
set(OFFLINE_ASM_ARGS --assembler=MASM)
else ()
set(LLIntOutput LLIntAssembly.h)
endif ()
......@@ -995,7 +996,7 @@ add_custom_command(
OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput} ${OFFLINE_ASM_ARGS}
COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
VERBATIM)
......
......@@ -29,16 +29,4 @@ if (WIN32)
list(REMOVE_ITEM JavaScriptCore_SOURCES
inspector/JSGlobalObjectInspectorController.cpp
)
file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore)
set(JavaScriptCore_PRE_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore/preBuild.cmd")
file(REMOVE "${JavaScriptCore_PRE_BUILD_COMMAND}")
foreach (_directory ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES})
file(APPEND "${JavaScriptCore_PRE_BUILD_COMMAND}" "@xcopy /y /d /f \"${JAVASCRIPTCORE_DIR}/${_directory}/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
endforeach ()
set(JavaScriptCore_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore/postBuild.cmd")
file(WRITE "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
endif ()
......@@ -32,6 +32,10 @@
#include "AbstractMacroAssembler.h"
#include <wtf/Optional.h>
#if COMPILER(MSVC)
#include <intrin.h>
#endif
namespace JSC {
class MacroAssemblerX86Common : public AbstractMacroAssembler<X86Assembler, MacroAssemblerX86Common> {
......
......@@ -61,7 +61,7 @@ public:
// line and column are in base 0 e.g. the first line is line 0.
int line() const { return m_position.m_line.zeroBasedInt(); }
int column() const { return m_position.m_column.zeroBasedInt(); }
JS_EXPORT_PRIVATE const TextPosition& position() const { return m_position; }
const TextPosition& position() const { return m_position; }
JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject() const;
JS_EXPORT_PRIVATE DebuggerScope* scope();
......
......@@ -23,7 +23,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define __STDC_FORMAT_MACROS
#include "config.h"
#if USE(ARM64_DISASSEMBLER)
......
......@@ -23,7 +23,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define __STDC_FORMAT_MACROS
#include "config.h"
#include "Disassembler.h"
......
......@@ -483,7 +483,7 @@ JSValue CLoop::execute(OpcodeID entryOpcodeID, void* executableAddress, VM* vm,
} // namespace JSC
#elif !OS(WINDOWS)
#elif !COMPILER(MSVC)
//============================================================================
// Define the opcode dispatch mechanism when using an ASM loop:
......
......@@ -29,6 +29,7 @@ require "config"
require "backends"
require "digest/sha1"
require "offsets"
require 'optparse'
require "parser"
require "self_hash"
require "settings"
......@@ -301,6 +302,15 @@ asmFile = ARGV.shift
offsetsFile = ARGV.shift
outputFlnm = ARGV.shift
$options = {}
OptionParser.new do |opts|
opts.banner = "Usage: asm.rb asmFile offsetsFile outputFileName [--assembler=<ASM>]"
# This option is currently only used to specify the masm assembler
opts.on("--assembler=[ASM]", "Specify an assembler to use.") do |assembler|
$options[:assembler] = assembler
end
end.parse!
begin
configurationList = offsetsAndConfigurationIndex(offsetsFile)
rescue MissingMagicValuesException
......@@ -319,7 +329,8 @@ $commentPrefix = $emitWinAsm ? ";" : "//"
inputHash =
$commentPrefix + " offlineasm input hash: " + parseHash(asmFile) +
" " + Digest::SHA1.hexdigest(configurationList.map{|v| (v[0] + [v[1]]).join(' ')}.join(' ')) +
" " + selfHash
" " + selfHash +
" " + Digest::SHA1.hexdigest($options.has_key?(:assembler) ? $options[:assembler] : "")
if FileTest.exist? outputFlnm
File.open(outputFlnm, "r") {
......
......@@ -125,20 +125,12 @@ def useX87
end
end
def isCompilingOnWindows
ENV['OS'] == 'Windows_NT'
end
def isGCC
!isCompilingOnWindows
end
def isMSVC
isCompilingOnWindows
$options.has_key?(:assembler) && $options[:assembler] == "MASM"
end
def isIntelSyntax
isCompilingOnWindows
$options.has_key?(:assembler) && $options[:assembler] == "MASM"
end
def register(name)
......@@ -520,7 +512,6 @@ class Sequence
end
class Instruction
@@floatingPointCompareImplicitOperand = isIntelSyntax ? "st(0), " : ""
def x86Operands(*kinds)
raise unless kinds.size == operands.size
......@@ -574,6 +565,10 @@ class Instruction
raise
end
end
def getImplicitOperandString
isIntelSyntax ? "st(0), " : ""
end
def handleX86OpWithNumOperands(opcode, kind, numOperands)
if numOperands == 3
......@@ -808,20 +803,21 @@ class Instruction
end
def handleX87Compare(mode)
floatingPointCompareImplicitOperand = getImplicitOperandString
case mode
when :normal
if (operands[0].x87DefaultStackPosition == 0)
$asm.puts "fucomi #{@@floatingPointCompareImplicitOperand}#{operands[1].x87Operand(0)}"
$asm.puts "fucomi #{floatingPointCompareImplicitOperand}#{operands[1].x87Operand(0)}"
else
$asm.puts "fld #{operands[0].x87Operand(0)}"
$asm.puts "fucomip #{@@floatingPointCompareImplicitOperand}#{operands[1].x87Operand(1)}"
$asm.puts "fucomip #{floatingPointCompareImplicitOperand}#{operands[1].x87Operand(1)}"
end
when :reverse
if (operands[1].x87DefaultStackPosition == 0)
$asm.puts "fucomi #{@@floatingPointCompareImplicitOperand}#{operands[0].x87Operand(0)}"
$asm.puts "fucomi #{floatingPointCompareImplicitOperand}#{operands[0].x87Operand(0)}"
else
$asm.puts "fld #{operands[1].x87Operand(0)}"
$asm.puts "fucomip #{@@floatingPointCompareImplicitOperand}#{operands[0].x87Operand(1)}"
$asm.puts "fucomip #{floatingPointCompareImplicitOperand}#{operands[0].x87Operand(1)}"
end
else
raise mode.inspect
......@@ -1108,6 +1104,7 @@ class Instruction
$asm.puts "cvttsd2si #{operands[0].x86Operand(:double)}, #{operands[1].x86Operand(:int)}"
when "bcd2i"
if useX87
floatingPointCompareImplicitOperand = getImplicitOperandString
sp = RegisterID.new(nil, "sp")
if (operands[0].x87DefaultStackPosition == 0)
$asm.puts "fistl -4(#{sp.x86Operand(:ptr)})"
......@@ -1119,7 +1116,7 @@ class Instruction
$asm.puts "test#{x86Suffix(:int)} #{operands[1].x86Operand(:int)}, #{operands[1].x86Operand(:int)}"
$asm.puts "je #{operands[2].asmLabel}"
$asm.puts "fild#{x86Suffix(:int)} #{getSizeString(:int)}#{offsetRegister(-4, sp.x86Operand(:ptr))}"
$asm.puts "fucomip #{@@floatingPointCompareImplicitOperand}#{operands[0].x87Operand(1)}"
$asm.puts "fucomip #{floatingPointCompareImplicitOperand}#{operands[0].x87Operand(1)}"
$asm.puts "jp #{operands[2].asmLabel}"
$asm.puts "jne #{operands[2].asmLabel}"
else
......
......@@ -247,10 +247,10 @@ public:
JS_EXPORT_PRIVATE ~VM();
JS_EXPORT_PRIVATE Watchdog& ensureWatchdog();
JS_EXPORT_PRIVATE Watchdog* watchdog() { return m_watchdog.get(); }
Watchdog* watchdog() { return m_watchdog.get(); }
#if ENABLE(SAMPLING_PROFILER)
JS_EXPORT_PRIVATE SamplingProfiler* samplingProfiler() { return m_samplingProfiler.get(); }
SamplingProfiler* samplingProfiler() { return m_samplingProfiler.get(); }
JS_EXPORT_PRIVATE void ensureSamplingProfiler(RefPtr<Stopwatch>&&);
#endif
......@@ -597,7 +597,7 @@ public:
JS_EXPORT_PRIVATE void queueMicrotask(JSGlobalObject*, PassRefPtr<Microtask>);
JS_EXPORT_PRIVATE void drainMicrotasks();
JS_EXPORT_PRIVATE void setShouldRewriteConstAsVar(bool shouldRewrite) { m_shouldRewriteConstAsVar = shouldRewrite; }
void setShouldRewriteConstAsVar(bool shouldRewrite) { m_shouldRewriteConstAsVar = shouldRewrite; }
ALWAYS_INLINE bool shouldRewriteConstAsVar() { return m_shouldRewriteConstAsVar; }
inline bool shouldTriggerTermination(ExecState*);
......
......@@ -37,7 +37,7 @@ if (SHOULD_INSTALL_JS_SHELL)
install(TARGETS jsc DESTINATION "${EXEC_INSTALL_DIR}")
endif ()
if (WIN32)
if (TARGET jscLib)
add_dependencies(jsc jscLib)
endif ()
......
......@@ -130,3 +130,15 @@ if (GENERATE_DOCUMENTATION)
install(DIRECTORY "${DOC_OUTPUT_DIR}/qtwebkit" DESTINATION ${DOC_INSTALL_DIR})
install(FILES "${DOC_OUTPUT_DIR}/qtwebkit.qch" DESTINATION ${DOC_INSTALL_DIR})
endif ()
# Uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY
)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)
......@@ -16,20 +16,20 @@ angle::Platform *currentPlatform = nullptr;
}
// static
ANGLE_EXPORT angle::Platform *ANGLEPlatformCurrent()
angle::Platform *ANGLEPlatformCurrent()
{
return currentPlatform;
}
// static
ANGLE_EXPORT void ANGLEPlatformInitialize(angle::Platform *platformImpl)
void ANGLEPlatformInitialize(angle::Platform *platformImpl)
{
ASSERT(platformImpl != nullptr);
currentPlatform = platformImpl;
}
// static
ANGLE_EXPORT void ANGLEPlatformShutdown()
void ANGLEPlatformShutdown()
{
currentPlatform = nullptr;
}
......@@ -38,6 +38,8 @@
Defining any of the symbols explicitly prevents this from having any effect.
*/
#undef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
......@@ -85,10 +87,13 @@
#define WTF_PRETTY_FUNCTION __FUNCTION__
#endif
#if COMPILER(MINGW)
/* By default MinGW emits warnings when C99 format attributes are used, even if __USE_MINGW_ANSI_STDIO is defined */
#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__((__format__(gnu_printf, formatStringArgument, extraArguments)))
#elif COMPILER(GCC_OR_CLANG) && !defined(__OBJC__)
/* WTF logging functions can process %@ in the format string to log a NSObject* but the printf format attribute
emits a warning when %@ is used in the format string. Until <rdar://problem/5195437> is resolved we can't include
the attribute when being used from Objective-C code in case it decides to use %@. */
#if COMPILER(GCC_OR_CLANG) && !defined(__OBJC__)
#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__((__format__(printf, formatStringArgument, extraArguments)))
#else
#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments)
......
......@@ -101,6 +101,11 @@
#if defined(_MSC_VER)
#define WTF_COMPILER_MSVC 1
#if _MSC_VER >= 1900
#define WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS 1
#endif
#endif
#if defined(_MSC_VER) && _MSC_VER < 1800
......
......@@ -80,10 +80,11 @@
#if OS(DARWIN)
#define LOCAL_LABEL_STRING(name) "L" #name
#elif OS(LINUX) \
|| OS(FREEBSD) \
|| OS(OPENBSD) \
|| OS(HURD) \
|| OS(NETBSD)
|| OS(FREEBSD) \
|| OS(OPENBSD) \
|| OS(HURD) \
|| OS(NETBSD) \
|| COMPILER(MINGW)
// GNU as-compatible syntax.
#define LOCAL_LABEL_STRING(name) ".L" #name
#endif
......
......@@ -162,12 +162,18 @@
|| defined(_X86_) \
|| defined(__THW_INTEL)
#define WTF_CPU_X86 1
#if defined(__SSE2__) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
#define WTF_CPU_X86_SSE2 1
#endif
#endif
/* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */
#if defined(__x86_64__) \
|| defined(_M_X64)
#define WTF_CPU_X86_64 1
#define WTF_CPU_X86_SSE2 1
#endif
/* CPU(ARM64) - Apple */
......@@ -595,6 +601,10 @@
#define USE_CFURLCACHE 1
#endif
#if PLATFORM(QT) && OS(DARWIN)
#define USE_CF 1
#endif
#if !defined(HAVE_ACCESSIBILITY)
#if PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(EFL)
#define HAVE_ACCESSIBILITY 1
......@@ -930,11 +940,6 @@
#define USE_TEXTURE_MAPPER_GL 1
#endif
/* Compositing on the UI-process in WebKit2 */
#if USE(3D_GRAPHICS) && PLATFORM(QT)
#define USE_COORDINATED_GRAPHICS 1
#endif
#if PLATFORM(COCOA)
#define USE_PROTECTION_SPACE_AUTH_CALLBACK 1
#endif
......
......@@ -15,12 +15,24 @@ list(APPEND WTF_LIBRARIES
${CMAKE_THREAD_LIBS_INIT}
)
if (SHARED_CORE)
set(WTF_LIBRARY_TYPE SHARED)
else ()
set(WTF_LIBRARY_TYPE STATIC)
endif ()
if (QT_STATIC_BUILD)
list(APPEND WTF_LIBRARIES
${STATIC_LIB_DEPENDENCIES}
)
endif ()
if (UNIX AND NOT APPLE)
list(APPEND WTF_SOURCES
UniStdExtras.cpp
)
endif ()
if (USE_GLIB)
list(APPEND WTF_SOURCES
glib/GRefPtr.cpp
......@@ -28,19 +40,25 @@ if (USE_GLIB)
list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES
${GLIB_INCLUDE_DIRS}
)
list(APPEND WTF_LIBRARIES
${GLIB_GOBJECT_LIBRARIES}
${GLIB_LIBRARIES}
)
endif ()
if (WIN32)
list(APPEND WTF_LIBRARIES
winmm
)
set(WTF_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WTF/postBuild.cmd")
file(WRITE "${WTF_POST_BUILD_COMMAND}" "@xcopy /y /s /d /f \"${WTF_DIR}/wtf/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/WTF\" >nul 2>nul\n@xcopy /y /s /d /f \"${DERIVED_SOURCES_DIR}/WTF/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/WTF\" >nul 2>nul\n")
file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WTF)
endif ()
if (APPLE)
list(APPEND WTF_SOURCES
text/cf/AtomicStringImplCF.cpp
text/cf/StringCF.cpp
text/cf/StringImplCF.cpp
text/cf/StringViewCF.cpp
)
list(APPEND WTF_LIBRARIES
${COREFOUNDATION_LIBRARY}
)
......
......@@ -52,6 +52,12 @@
#include <wtf/win/WorkItemWin.h>
#endif
#if PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QProcess;
QT_END_NAMESPACE
#endif
namespace WTF {
class WorkQueue final : public FunctionDispatcher {
......@@ -83,6 +89,7 @@ public:
void unregisterSocketEventHandler(int);
#elif PLATFORM(QT)
QSocketNotifier* registerSocketEventHandler(int, QSocketNotifier::Type, std::function<void()>);
void dispatchOnTermination(QProcess*, std::function<void()>);
#elif OS(DARWIN)
dispatch_queue_t dispatchQueue() const { return m_dispatchQueue; }
#endif
......
/*
* Copyright (C) 2010, 2012 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 "RunLoop.h"
#include <CoreFoundation/CoreFoundation.h>
#include <dispatch/dispatch.h>
#include <wtf/AutodrainedPool.h>
namespace WTF {
void RunLoop::performWork(void* context)
{
AutodrainedPool pool;
static_cast<RunLoop*>(context)->performWork();
}
RunLoop::RunLoop()
: m_runLoop(CFRunLoopGetCurrent())