Commit 187ad09f authored by Kevin Velghe's avatar Kevin Velghe

New upstream version 0.0.0+tp4

parent 24bf2fdc
......@@ -36,6 +36,17 @@ endif ()
string(TOLOWER ${PORT} WEBKIT_PORT_DIR)
# -----------------------------------------------------------------------------
# Determine the compiler
# -----------------------------------------------------------------------------
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
set(COMPILER_IS_CLANG ON)
endif ()
if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
set(COMPILER_IS_GCC_OR_CLANG ON)
endif ()
# -----------------------------------------------------------------------------
# Determine the target processor
# -----------------------------------------------------------------------------
......
......@@ -19,6 +19,11 @@ if (ENABLE_API_TESTS)
add_subdirectory(ThirdParty/gtest)
endif ()
if (USE_WOFF2)
add_subdirectory(ThirdParty/brotli)
add_subdirectory(ThirdParty/woff2)
endif ()
if (ENABLE_WEBKIT)
add_subdirectory(WebKit)
endif ()
......
......@@ -1318,6 +1318,8 @@ if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
endif ()
QT_ADD_EXTRA_WEBKIT_TARGET_EXPORT(JavaScriptCore)
# Force staging of shared scripts, even if they aren't directly used to build JavaScriptCore.
add_custom_target(stageSharedScripts DEPENDS ${JavaScriptCore_SCRIPTS})
......
......@@ -18,6 +18,12 @@ list(APPEND JavaScriptCore_LIBRARIES
${Qt5Core_LIBRARIES}
)
if (QT_STATIC_BUILD)
list(APPEND JavaScriptCore_LIBRARIES
${STATIC_LIB_DEPENDENCIES}
)
endif ()
# From PlatformWin.cmake
if (WIN32)
list(REMOVE_ITEM JavaScriptCore_SOURCES
......
......@@ -704,14 +704,14 @@ public:
Jump branchTest32(ResultCondition cond, RegisterID reg, RegisterID mask)
{
ASSERT((cond == Zero) || (cond == NonZero));
ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == PositiveOrZero);
m_assembler.tst(reg, mask);
return Jump(m_assembler.jmp(ARMCondition(cond)));
}
Jump branchTest32(ResultCondition cond, RegisterID reg, TrustedImm32 mask = TrustedImm32(-1))
{
ASSERT((cond == Zero) || (cond == NonZero));
ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == PositiveOrZero);
ARMWord w = m_assembler.getImm(mask.m_value, ARMRegisters::S0, true);
if (w & ARMAssembler::Op2InvertedImmediate)
m_assembler.bics(ARMRegisters::S0, reg, w & ~ARMAssembler::Op2InvertedImmediate);
......
......@@ -1495,12 +1495,14 @@ public:
Jump branchTest32(ResultCondition cond, RegisterID reg, RegisterID mask)
{
ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == PositiveOrZero);
m_assembler.tst(reg, mask);
return Jump(makeBranch(cond));
}
Jump branchTest32(ResultCondition cond, RegisterID reg, TrustedImm32 mask = TrustedImm32(-1))
{
ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == PositiveOrZero);
test32(reg, mask);
return Jump(makeBranch(cond));
}
......
......@@ -1369,12 +1369,22 @@ private:
RefPtr<TypeSet> typeSet = node->typeLocation()->m_instructionTypeSet;
RuntimeTypeMask seenTypes = typeSet->seenTypes();
if (typeSet->doesTypeConformTo(TypeMachineInt)) {
if (node->child1()->shouldSpeculateInt32())
if (node->child1()->shouldSpeculateInt32()) {
fixEdge<Int32Use>(node->child1());
else
node->remove();
break;
}
if (enableInt52()) {
fixEdge<MachineIntUse>(node->child1());
node->remove();
} else if (typeSet->doesTypeConformTo(TypeNumber | TypeMachineInt)) {
node->remove();
break;
}
// Must not perform fixEdge<NumberUse> here since the type set only includes TypeMachineInt. Double values should be logged.
}
if (typeSet->doesTypeConformTo(TypeNumber | TypeMachineInt)) {
fixEdge<NumberUse>(node->child1());
node->remove();
} else if (typeSet->doesTypeConformTo(TypeString)) {
......
......@@ -1862,7 +1862,8 @@ private:
ASSERT(def->value());
Node* result = def->value();
if (result->replacement())
result = result->replacement();
ASSERT(!result->replacement());
m_localMapping.add(location, result);
......
......@@ -74,7 +74,9 @@ class DemandExecutableAllocator;
#endif
#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
#if CPU(ARM)
#if defined(FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB) && FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB > 0
static const size_t fixedExecutableMemoryPoolSize = FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB * 1024 * 1024;
#elif CPU(ARM)
static const size_t fixedExecutableMemoryPoolSize = 16 * 1024 * 1024;
#elif CPU(ARM64)
static const size_t fixedExecutableMemoryPoolSize = 32 * 1024 * 1024;
......
......@@ -832,7 +832,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSlice(ExecState* exec)
if (UNLIKELY(speciesResult.first == SpeciesConstructResult::Exception))
return JSValue::encode(jsUndefined());
if (LIKELY(speciesResult.first == SpeciesConstructResult::FastPath && isJSArray(thisObj))) {
if (LIKELY(speciesResult.first == SpeciesConstructResult::FastPath && isJSArray(thisObj) && length == getLength(exec, thisObj))) {
if (JSArray* result = asArray(thisObj)->fastSlice(*exec, begin, end - begin))
return JSValue::encode(result);
}
......@@ -899,7 +899,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSplice(ExecState* exec)
return JSValue::encode(jsUndefined());
JSObject* result = nullptr;
if (speciesResult.first == SpeciesConstructResult::FastPath && isJSArray(thisObj))
if (speciesResult.first == SpeciesConstructResult::FastPath && isJSArray(thisObj) && length == getLength(exec, thisObj))
result = asArray(thisObj)->fastSlice(*exec, begin, deleteCount);
if (!result) {
......
......@@ -28,18 +28,37 @@
// MarkedArgumentBuffer of property names, passed to a macro so we can do set them up various
// ways without repeating the list.
#define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
macro(AnimationTimeline) \
macro(Array) \
macro(ArrayBuffer) \
macro(ArrayIterator) \
macro(Audio) \
macro(BYTES_PER_ELEMENT) \
macro(Boolean) \
macro(Collator) \
macro(Date) \
macro(DateTimeFormat) \
macro(DocumentTimeline) \
macro(Error) \
macro(EvalError) \
macro(Function) \
macro(Gamepad) \
macro(GamepadButton) \
macro(GamepadEvent) \
macro(GeneratorFunction) \
macro(HTMLAudioElement) \
macro(HTMLSlotElement) \
macro(IDBCursor) \
macro(IDBCursorWithValue) \
macro(IDBDatabase) \
macro(IDBFactory) \
macro(IDBIndex) \
macro(IDBKeyRange) \
macro(IDBObjectStore) \
macro(IDBOpenDBRequest) \
macro(IDBRequest) \
macro(IDBTransaction) \
macro(IDBVersionChangeEvent) \
macro(Infinity) \
macro(Intl) \
macro(JSON) \
......@@ -59,6 +78,7 @@
macro(RegExp) \
macro(Set)\
macro(SetIterator)\
macro(ShadowRoot) \
macro(String) \
macro(Symbol) \
macro(SyntaxError) \
......@@ -67,6 +87,7 @@
macro(UTC) \
macro(WeakMap)\
macro(WeakSet)\
macro(WebSocket) \
macro(__defineGetter__) \
macro(__defineSetter__) \
macro(__lookupGetter__) \
......@@ -216,6 +237,14 @@
macro(valueOf) \
macro(values) \
macro(webkit) \
macro(webkitIDBCursor) \
macro(webkitIDBDatabase) \
macro(webkitIDBFactory) \
macro(webkitIDBIndex) \
macro(webkitIDBKeyRange) \
macro(webkitIDBObjectStore) \
macro(webkitIDBRequest) \
macro(webkitIDBTransaction) \
macro(webkitIndexedDB) \
macro(weekday) \
macro(window) \
......
......@@ -1301,8 +1301,13 @@ bool JSObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName proper
if (Optional<uint32_t> index = parseIndex(propertyName))
return thisObject->methodTable(vm)->deletePropertyByIndex(thisObject, exec, index.value());
if (!thisObject->staticFunctionsReified())
thisObject->reifyAllStaticProperties(exec);
if (!thisObject->staticFunctionsReified()) {
if (auto* entry = thisObject->findPropertyHashEntry(propertyName)) {
if (entry->attributes() & DontDelete)
return false;
thisObject->reifyAllStaticProperties(exec);
}
}
unsigned attributes;
if (isValidOffset(thisObject->structure(vm)->get(vm, propertyName, attributes))) {
......
if (QT_STATIC_BUILD)
list(APPEND JSC_LIBRARIES
${DEPEND_STATIC_LIBS}
)
endif ()
......@@ -72,12 +72,15 @@ if (NOT TARGET Qt5::qhelpgenerator)
endif ()
query_qmake(QT_INSTALL_DOCS QT_INSTALL_DOCS)
#set(QDOC_CONFIG "${DERIVED_SOURCES_DIR}/qtwebkit.qdocconf")
set(QDOC_CONFIG "${CMAKE_SOURCE_DIR}/Source/qtwebkit.qdocconf")
set(DOC_OUTPUT_DIR "${CMAKE_BINARY_DIR}/doc")
set(DOC_INSTALL_DIR "doc")
set(PROJECT_VERSION_TAG ${PROJECT_VERSION_MAJOR}${PROJECT_VERSION_MINOR}${PROJECT_VERSION_MICRO})
#configure_file(qtwebkit.qdocconf.in ${QDOC_CONFIG} @ONLY)
if (KDE_INSTALL_USE_QT_SYS_PATHS)
set(DOC_INSTALL_DIR ${QT_INSTALL_DOCS})
else ()
set(DOC_INSTALL_DIR "doc")
endif ()
if (WIN32)
set(EXPORT_VAR set)
......@@ -124,6 +127,6 @@ add_custom_target(docs)
add_dependencies(docs qch_docs)
if (GENERATE_DOCUMENTATION)
install(DIRECTORY ${DOC_OUTPUT_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY "${DOC_OUTPUT_DIR}/qtwebkit" DESTINATION ${DOC_INSTALL_DIR})
install(FILES "${DOC_OUTPUT_DIR}/qtwebkit.qch" DESTINATION ${DOC_INSTALL_DIR})
endif ()
@[email protected]
find_dependency(Qt5Core @[email protected] REQUIRED)
find_dependency(Qt5Gui @[email protected] REQUIRED)
find_dependency(Qt5Network @[email protected] REQUIRED)
find_dependency(Qt5Core @[email protected] EXACT)
find_dependency(Qt5Gui @[email protected] EXACT)
find_dependency(Qt5Network @[email protected] EXACT)
include("${CMAKE_CURRENT_LIST_DIR}/WebKitTargets.cmake")
@[email protected]
find_dependency(Qt5Core @[email protected] REQUIRED)
find_dependency(Qt5Gui @[email protected] REQUIRED)
find_dependency(Qt5Network @[email protected] REQUIRED)
find_dependency(Qt5Widgets @[email protected] REQUIRED)
find_dependency(Qt5Core @[email protected] EXACT)
find_dependency(Qt5Gui @[email protected] EXACT)
find_dependency(Qt5Network @[email protected] EXACT)
find_dependency(Qt5Widgets @[email protected] EXACT)
find_dependency(Qt5WebKit @[email protected] EXACT)
......
set(BROTLI_DIR "${THIRDPARTY_DIR}/brotli")
set(BROTLI_INCLUDE_DIRECTORIES
"${BROTLI_DIR}/dec"
)
set(BROTLI_SOURCES
${BROTLI_DIR}/dec/bit_reader.c
${BROTLI_DIR}/dec/decode.c
${BROTLI_DIR}/dec/dictionary.c
${BROTLI_DIR}/dec/huffman.c
${BROTLI_DIR}/dec/state.c
)
include_directories("${BROTLI_INCLUDE_DIRECTORIES}")
add_definitions(-DBROTLI_BUILD_PORTABLE)
add_library(brotli STATIC ${BROTLI_SOURCES})
WEBKIT_SET_EXTRA_COMPILER_FLAGS(brotli)
if (COMPILER_IS_CLANG)
ADD_TARGET_PROPERTIES(brotli COMPILE_FLAGS "-Wno-cast-align")
endif ()
QT_ADD_EXTRA_WEBKIT_TARGET_EXPORT(brotli)
Copyright (c) 2009, 2010, 2013-2015 by the Brotli Authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This is the Brotli data compression library from
https://github.com/google/brotli.
Currently, we import only the Brotli decoder (the /dec/ subdirectory), not the
encoder (/enc/ subdirectory).
Upstream code can be viewed at
https://github.com/google/brotli/tree/master/dec
and cloned by
git clone https://github.com/google/brotli
The in-tree copy is updated by running
sh update.sh
from within the modules/brotli directory.
Current version: [commit 29d31d5921b0a2b323ac24e7f7d0cdc9a3c0dd08].
/* Copyright 2013 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
/* Bit reading helpers */
#include "./bit_reader.h"
#include "./port.h"
#include "./types.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
void BrotliInitBitReader(BrotliBitReader* const br) {
br->val_ = 0;
br->bit_pos_ = sizeof(br->val_) << 3;
}
int BrotliWarmupBitReader(BrotliBitReader* const br) {
size_t aligned_read_mask = (sizeof(br->val_) >> 1) - 1;
/* Fixing alignment after unaligned BrotliFillWindow would result accumulator
overflow. If unalignment is caused by BrotliSafeReadBits, then there is
enough space in accumulator to fix aligment. */
if (!BROTLI_ALIGNED_READ) {
aligned_read_mask = 0;
}
if (BrotliGetAvailableBits(br) == 0) {
if (!BrotliPullByte(br)) {
return 0;
}
}
while ((((size_t)br->next_in) & aligned_read_mask) != 0) {
if (!BrotliPullByte(br)) {
/* If we consumed all the input, we don't care about the alignment. */
return 1;
}
}
return 1;
}
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
#endif
/* Copyright 2013 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
/* Bit reading helpers */
#ifndef BROTLI_DEC_BIT_READER_H_
#define BROTLI_DEC_BIT_READER_H_
#include <string.h> /* memcpy */
#include "./port.h"
#include "./types.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#if (BROTLI_64_BITS)
#define BROTLI_SHORT_FILL_BIT_WINDOW_READ 4
typedef uint64_t reg_t;
#else
#define BROTLI_SHORT_FILL_BIT_WINDOW_READ 2
typedef uint32_t reg_t;
#endif
static const uint32_t kBitMask[33] = { 0x0000,
0x00000001, 0x00000003, 0x00000007, 0x0000000F,