Skip to content
Permalink
Browse files

8233942: Update to 609.1 version of WebKit

Co-authored-by: Guru HB <guru.hb@oracle.com>
Co-authored-by: Arun Joseph <arun.aj.joseph@oracle.com>
Co-authored-by: Kevin Rushforth <kevin.rushforth@oracle.com>
Reviewed-by: kcr, jvos, ajoseph
  • Loading branch information
4 people committed Jan 23, 2020
1 parent f5ee963 commit b2d85645ffc7edc327b28e12eede6505912d7491
Showing 5,731 changed files with 206,972 additions and 109,687 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -1,4 +1,4 @@
## WebKit Open Source Project: WebKit v608.1
## WebKit Open Source Project: WebKit v609.1

### WebKit Notice
```
@@ -2,13 +2,13 @@
# Determine CMake version and build type.
# -----------------------------------------------------------------------------
#
# NOTE: cmake_minimum_required() and project() *MUST* be the two fist commands
# NOTE: cmake_minimum_required() and project() *MUST* be the two first commands
# used, see https://cmake.org/cmake/help/v3.3/command/project.html -- the
# latter in particular handles loading a bunch of shared CMake definitions
# and loading the cross-compilation settings from CMAKE_TOOLCHAIN_FILE.
#

cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.10)

project(WebKit)

@@ -37,6 +37,7 @@ endif ()
set(ALL_PORTS
AppleWin
Efl
FTW
GTK
JSCOnly
Mac
@@ -62,8 +63,8 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQU
endif ()

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "6.0.0")
message(FATAL_ERROR "GCC 6.0.0 is required to build WebKitGTK+, use a newer GCC version or clang")
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "7.3.0")
message(FATAL_ERROR "GCC 7.3 or newer is required to build WebKit. Use a newer GCC version or Clang.")
endif ()
endif ()

@@ -94,7 +95,15 @@ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^mips64")
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
set(WTF_CPU_MIPS 1)
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(x64|x86_64|amd64)")
set(WTF_CPU_X86_64 1)
# FORCE_32BIT is set in the build script when --32-bit is passed
# on a Linux/intel 64bit host. This allows us to produce 32bit
# binaries without setting the build up as a crosscompilation,
# which is the only way to modify CMAKE_SYSTEM_PROCESSOR.
if (FORCE_32BIT)
set(WTF_CPU_X86 1)
else ()
set(WTF_CPU_X86_64 1)
endif ()
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86)")
set(WTF_CPU_X86 1)
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc")
@@ -132,6 +141,7 @@ endif ()
# By default, only the highest-level libraries, WebKitLegacy and WebKit, are
# shared, because properly building shared libraries that depend on each other
# can be tricky. Override these in Options*.cmake for your port as needed.
set(bmalloc_LIBRARY_TYPE STATIC)
set(WTF_LIBRARY_TYPE STATIC)
set(JavaScriptCore_LIBRARY_TYPE STATIC)
set(PAL_LIBRARY_TYPE STATIC)
@@ -13,7 +13,7 @@ endif ()

add_subdirectory(JavaScriptCore)

if (WIN32 AND ENABLE_GRAPHICS_CONTEXT_3D)
if (ENABLE_GRAPHICS_CONTEXT_3D)
add_subdirectory(ThirdParty/ANGLE)
endif ()

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006 Apple Inc. All rights reserved.
* Copyright (C) 2006-2019 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -114,7 +114,7 @@ inline JSC::JSObject* toJS(JSObjectRef o)
{
JSC::JSObject* object = uncheckedToJS(o);
if (object)
RELEASE_ASSERT(object->methodTable(*object->vm()));
RELEASE_ASSERT(object->methodTable(object->vm()));
return object;
}

@@ -27,6 +27,8 @@

#include "JSGlobalObject.h"

OBJC_CLASS JSScript;

namespace JSC {

class JSAPIGlobalObject : public JSGlobalObject {
@@ -54,6 +56,9 @@ class JSAPIGlobalObject : public JSGlobalObject {
static Identifier moduleLoaderResolve(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue keyValue, JSValue referrerValue, JSValue);
static JSInternalPromise* moduleLoaderFetch(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue, JSValue);
static JSObject* moduleLoaderCreateImportMetaProperties(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSModuleRecord*, JSValue);
static JSValue moduleLoaderEvaluate(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue, JSValue);

JSValue loadAndEvaluateJSScriptModule(const JSLockHolder&, JSScript *);

private:
JSAPIGlobalObject(VM& vm, Structure* structure)
@@ -25,6 +25,7 @@

#include "config.h"
#include "JSBase.h"
#include "JSBaseInternal.h"
#include "JSBasePrivate.h"

#include "APICast.h"
@@ -47,25 +48,15 @@

using namespace JSC;

JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
JSValueRef JSEvaluateScriptInternal(const JSLockHolder&, ExecState* exec, JSContextRef ctx, JSObjectRef thisObject, const SourceCode& source, JSValueRef* exception)
{
if (!ctx) {
ASSERT_NOT_REACHED();
return 0;
}
ExecState* exec = toJS(ctx);
VM& vm = exec->vm();
JSLockHolder locker(vm);
UNUSED_PARAM(ctx);

JSObject* jsThisObject = toJS(thisObject);

startingLineNumber = std::max(1, startingLineNumber);

// evaluate sets "this" to the global object if it is NULL
VM& vm = exec->vm();
JSGlobalObject* globalObject = vm.vmEntryGlobalObject(exec);
auto sourceURLString = sourceURL ? sourceURL->string() : String();
SourceCode source = makeSource(script->string(), SourceOrigin { sourceURLString }, URL({ }, sourceURLString), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber()));

NakedPtr<Exception> evaluationException;
JSValue returnValue = profiledEvaluate(globalObject->globalExec(), ProfilingReason::API, source, jsThisObject, evaluationException);

@@ -80,7 +71,7 @@ JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef th
// We could stash it in the inspector in case an inspector is ever opened.
globalObject->inspectorController().reportAPIException(exec, evaluationException);
#endif
return 0;
return nullptr;
}

if (returnValue)
@@ -90,6 +81,24 @@ JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef th
return toRef(exec, jsUndefined());
}

JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
{
if (!ctx) {
ASSERT_NOT_REACHED();
return nullptr;
}
ExecState* exec = toJS(ctx);
VM& vm = exec->vm();
JSLockHolder locker(vm);

startingLineNumber = std::max(1, startingLineNumber);

auto sourceURLString = sourceURL ? sourceURL->string() : String();
SourceCode source = makeSource(script->string(), SourceOrigin { sourceURLString }, URL({ }, sourceURLString), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber()));

return JSEvaluateScriptInternal(locker, exec, ctx, thisObject, source, exception);
}

bool JSCheckScriptSyntax(JSContextRef ctx, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
{
if (!ctx) {
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2019 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. ``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
* 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.
*/

#pragma once

#include <JavaScriptCore/JSBase.h>
#include <JavaScriptCore/WebKitAvailability.h>

namespace JSC {
class JSLockHolder;
class ExecState;
class SourceCode;
}

extern "C" JSValueRef JSEvaluateScriptInternal(const JSC::JSLockHolder&, JSC::ExecState*, JSContextRef, JSObjectRef thisObject, const JSC::SourceCode&, JSValueRef* exception);
@@ -43,7 +43,7 @@ owns a large non-GC memory region. Calling this function will encourage the
garbage collector to collect soon, hoping to reclaim that large non-GC memory
region.
*/
JS_EXPORT void JSReportExtraMemoryCost(JSContextRef ctx, size_t size) JSC_API_AVAILABLE(macosx(10.6), ios(7.0));
JS_EXPORT void JSReportExtraMemoryCost(JSContextRef ctx, size_t size) JSC_API_AVAILABLE(macos(10.6), ios(7.0));

JS_EXPORT void JSDisableGCTimer(void);

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2006-2019 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -48,7 +48,7 @@ JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, Struc
void JSCallbackConstructor::finishCreation(JSGlobalObject* globalObject, JSClassRef jsClass)
{
Base::finishCreation(globalObject->vm());
ASSERT(inherits(*vm(), info()));
ASSERT(inherits(vm(), info()));
if (m_class)
JSClassRetain(jsClass);
}
@@ -58,7 +58,7 @@ struct JSCallbackObjectData {
void setPrivateProperty(VM& vm, JSCell* owner, const Identifier& propertyName, JSValue value)
{
if (!m_privateProperties)
m_privateProperties = std::make_unique<JSPrivatePropertyMap>();
m_privateProperties = makeUnique<JSPrivatePropertyMap>();
m_privateProperties->setPrivateProperty(vm, owner, propertyName, value);
}

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006, 2008, 2016 Apple Inc. All rights reserved.
* Copyright (C) 2006-2019 Apple Inc. All rights reserved.
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -43,22 +43,22 @@ namespace JSC {
template <class Parent>
inline JSCallbackObject<Parent>* JSCallbackObject<Parent>::asCallbackObject(JSValue value)
{
ASSERT(asObject(value)->inherits(*value.getObject()->vm(), info()));
ASSERT(asObject(value)->inherits(value.getObject()->vm(), info()));
return jsCast<JSCallbackObject*>(asObject(value));
}

template <class Parent>
inline JSCallbackObject<Parent>* JSCallbackObject<Parent>::asCallbackObject(EncodedJSValue encodedValue)
{
JSValue value = JSValue::decode(encodedValue);
ASSERT(asObject(value)->inherits(*value.getObject()->vm(), info()));
ASSERT(asObject(value)->inherits(value.getObject()->vm(), info()));
return jsCast<JSCallbackObject*>(asObject(value));
}

template <class Parent>
JSCallbackObject<Parent>::JSCallbackObject(ExecState* exec, Structure* structure, JSClassRef jsClass, void* data)
: Parent(exec->vm(), structure)
, m_callbackObjectData(std::make_unique<JSCallbackObjectData>(data, jsClass))
, m_callbackObjectData(makeUnique<JSCallbackObjectData>(data, jsClass))
{
}

@@ -67,24 +67,24 @@ JSCallbackObject<Parent>::JSCallbackObject(ExecState* exec, Structure* structure
template <class Parent>
JSCallbackObject<Parent>::JSCallbackObject(VM& vm, JSClassRef jsClass, Structure* structure)
: Parent(vm, structure)
, m_callbackObjectData(std::make_unique<JSCallbackObjectData>(nullptr, jsClass))
, m_callbackObjectData(makeUnique<JSCallbackObjectData>(nullptr, jsClass))
{
}

template <class Parent>
JSCallbackObject<Parent>::~JSCallbackObject()
{
VM* vm = this->HeapCell::vm();
vm->currentlyDestructingCallbackObject = this;
VM& vm = this->HeapCell::vm();
vm.currentlyDestructingCallbackObject = this;
ASSERT(m_classInfo);
vm->currentlyDestructingCallbackObjectClassInfo = m_classInfo;
vm.currentlyDestructingCallbackObjectClassInfo = m_classInfo;
JSObjectRef thisRef = toRef(static_cast<JSObject*>(this));
for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
if (JSObjectFinalizeCallback finalize = jsClass->finalize)
finalize(thisRef);
}
vm->currentlyDestructingCallbackObject = nullptr;
vm->currentlyDestructingCallbackObjectClassInfo = nullptr;
vm.currentlyDestructingCallbackObject = nullptr;
vm.currentlyDestructingCallbackObjectClassInfo = nullptr;
}

template <class Parent>
@@ -215,7 +215,8 @@ bool JSCallbackObject<Parent>::getOwnPropertySlot(JSObject* object, ExecState* e
template <class Parent>
bool JSCallbackObject<Parent>::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot)
{
return object->methodTable(exec->vm())->getOwnPropertySlot(object, exec, Identifier::from(exec, propertyName), slot);
VM& vm = exec->vm();
return object->methodTable(vm)->getOwnPropertySlot(object, exec, Identifier::from(vm, propertyName), slot);
}

template <class Parent>
@@ -320,7 +321,7 @@ bool JSCallbackObject<Parent>::putByIndex(JSCell* cell, ExecState* exec, unsigne
JSObjectRef thisRef = toRef(thisObject);
RefPtr<OpaqueJSString> propertyNameRef;
JSValueRef valueRef = toRef(exec, value);
Identifier propertyName = Identifier::from(exec, propertyIndex);
Identifier propertyName = Identifier::from(vm, propertyIndex);

for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) {
if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) {
@@ -421,8 +422,9 @@ bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, Pro
template <class Parent>
bool JSCallbackObject<Parent>::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
{
VM& vm = exec->vm();
JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
return thisObject->methodTable(exec->vm())->deleteProperty(thisObject, exec, Identifier::from(exec, propertyName));
return thisObject->methodTable(vm)->deleteProperty(thisObject, exec, Identifier::from(vm, propertyName));
}

template <class Parent>
@@ -547,6 +549,7 @@ EncodedJSValue JSCallbackObject<Parent>::call(ExecState* exec)
template <class Parent>
void JSCallbackObject<Parent>::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
VM& vm = exec->vm();
JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(object);
JSContextRef execRef = toRef(exec);
JSObjectRef thisRef = toRef(thisObject);
@@ -565,7 +568,7 @@ void JSCallbackObject<Parent>::getOwnNonIndexPropertyNames(JSObject* object, Exe
StaticValueEntry* entry = it->value.get();
if (entry->getProperty && (!(entry->attributes & kJSPropertyAttributeDontEnum) || mode.includeDontEnumProperties())) {
ASSERT(!name->isSymbol());
propertyNames.add(Identifier::fromString(exec, String(name)));
propertyNames.add(Identifier::fromString(vm, String(name)));
}
}
}
@@ -578,7 +581,7 @@ void JSCallbackObject<Parent>::getOwnNonIndexPropertyNames(JSObject* object, Exe
StaticFunctionEntry* entry = it->value.get();
if (!(entry->attributes & kJSPropertyAttributeDontEnum) || mode.includeDontEnumProperties()) {
ASSERT(!name->isSymbol());
propertyNames.add(Identifier::fromString(exec, String(name)));
propertyNames.add(Identifier::fromString(vm, String(name)));
}
}
}

0 comments on commit b2d8564

Please sign in to comment.
You can’t perform that action at this time.