Skip to content

Commit b2d8564

Browse files
Guru Hbguruhbarun-josephkevinrushforth
committed
8233942: Update to 609.1 version of WebKit
Co-authored-by: Guru HB <[email protected]> Co-authored-by: Arun Joseph <[email protected]> Co-authored-by: Kevin Rushforth <[email protected]> Reviewed-by: kcr, jvos, ajoseph
1 parent f5ee963 commit b2d8564

File tree

5,729 files changed

+206900
-109615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,729 files changed

+206900
-109615
lines changed

modules/javafx.web/src/main/legal/webkit.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## WebKit Open Source Project: WebKit v608.1
1+
## WebKit Open Source Project: WebKit v609.1
22

33
### WebKit Notice
44
```

modules/javafx.web/src/main/native/CMakeLists.txt

+15-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# Determine CMake version and build type.
33
# -----------------------------------------------------------------------------
44
#
5-
# NOTE: cmake_minimum_required() and project() *MUST* be the two fist commands
5+
# NOTE: cmake_minimum_required() and project() *MUST* be the two first commands
66
# used, see https://cmake.org/cmake/help/v3.3/command/project.html -- the
77
# latter in particular handles loading a bunch of shared CMake definitions
88
# and loading the cross-compilation settings from CMAKE_TOOLCHAIN_FILE.
99
#
1010

11-
cmake_minimum_required(VERSION 3.3)
11+
cmake_minimum_required(VERSION 3.10)
1212

1313
project(WebKit)
1414

@@ -37,6 +37,7 @@ endif ()
3737
set(ALL_PORTS
3838
AppleWin
3939
Efl
40+
FTW
4041
GTK
4142
JSCOnly
4243
Mac
@@ -62,8 +63,8 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQU
6263
endif ()
6364

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

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

modules/javafx.web/src/main/native/Source/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ endif ()
1313

1414
add_subdirectory(JavaScriptCore)
1515

16-
if (WIN32 AND ENABLE_GRAPHICS_CONTEXT_3D)
16+
if (ENABLE_GRAPHICS_CONTEXT_3D)
1717
add_subdirectory(ThirdParty/ANGLE)
1818
endif ()
1919

modules/javafx.web/src/main/native/Source/JavaScriptCore/API/APICast.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006 Apple Inc. All rights reserved.
2+
* Copyright (C) 2006-2019 Apple Inc. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -114,7 +114,7 @@ inline JSC::JSObject* toJS(JSObjectRef o)
114114
{
115115
JSC::JSObject* object = uncheckedToJS(o);
116116
if (object)
117-
RELEASE_ASSERT(object->methodTable(*object->vm()));
117+
RELEASE_ASSERT(object->methodTable(object->vm()));
118118
return object;
119119
}
120120

modules/javafx.web/src/main/native/Source/JavaScriptCore/API/JSAPIGlobalObject.h

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#include "JSGlobalObject.h"
2929

30+
OBJC_CLASS JSScript;
31+
3032
namespace JSC {
3133

3234
class JSAPIGlobalObject : public JSGlobalObject {
@@ -54,6 +56,9 @@ class JSAPIGlobalObject : public JSGlobalObject {
5456
static Identifier moduleLoaderResolve(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue keyValue, JSValue referrerValue, JSValue);
5557
static JSInternalPromise* moduleLoaderFetch(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue, JSValue);
5658
static JSObject* moduleLoaderCreateImportMetaProperties(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSModuleRecord*, JSValue);
59+
static JSValue moduleLoaderEvaluate(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue, JSValue);
60+
61+
JSValue loadAndEvaluateJSScriptModule(const JSLockHolder&, JSScript *);
5762

5863
private:
5964
JSAPIGlobalObject(VM& vm, Structure* structure)

modules/javafx.web/src/main/native/Source/JavaScriptCore/API/JSBase.cpp

+23-14
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "config.h"
2727
#include "JSBase.h"
28+
#include "JSBaseInternal.h"
2829
#include "JSBasePrivate.h"
2930

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

4849
using namespace JSC;
4950

50-
JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
51+
JSValueRef JSEvaluateScriptInternal(const JSLockHolder&, ExecState* exec, JSContextRef ctx, JSObjectRef thisObject, const SourceCode& source, JSValueRef* exception)
5152
{
52-
if (!ctx) {
53-
ASSERT_NOT_REACHED();
54-
return 0;
55-
}
56-
ExecState* exec = toJS(ctx);
57-
VM& vm = exec->vm();
58-
JSLockHolder locker(vm);
53+
UNUSED_PARAM(ctx);
5954

6055
JSObject* jsThisObject = toJS(thisObject);
6156

62-
startingLineNumber = std::max(1, startingLineNumber);
63-
6457
// evaluate sets "this" to the global object if it is NULL
58+
VM& vm = exec->vm();
6559
JSGlobalObject* globalObject = vm.vmEntryGlobalObject(exec);
66-
auto sourceURLString = sourceURL ? sourceURL->string() : String();
67-
SourceCode source = makeSource(script->string(), SourceOrigin { sourceURLString }, URL({ }, sourceURLString), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber()));
68-
6960
NakedPtr<Exception> evaluationException;
7061
JSValue returnValue = profiledEvaluate(globalObject->globalExec(), ProfilingReason::API, source, jsThisObject, evaluationException);
7162

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

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

84+
JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
85+
{
86+
if (!ctx) {
87+
ASSERT_NOT_REACHED();
88+
return nullptr;
89+
}
90+
ExecState* exec = toJS(ctx);
91+
VM& vm = exec->vm();
92+
JSLockHolder locker(vm);
93+
94+
startingLineNumber = std::max(1, startingLineNumber);
95+
96+
auto sourceURLString = sourceURL ? sourceURL->string() : String();
97+
SourceCode source = makeSource(script->string(), SourceOrigin { sourceURLString }, URL({ }, sourceURLString), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber()));
98+
99+
return JSEvaluateScriptInternal(locker, exec, ctx, thisObject, source, exception);
100+
}
101+
93102
bool JSCheckScriptSyntax(JSContextRef ctx, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
94103
{
95104
if (!ctx) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (C) 2019 Apple Inc. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
* 1. Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions and the following disclaimer.
9+
* 2. Redistributions in binary form must reproduce the above copyright
10+
* notice, this list of conditions and the following disclaimer in the
11+
* documentation and/or other materials provided with the distribution.
12+
*
13+
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21+
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24+
*/
25+
26+
#pragma once
27+
28+
#include <JavaScriptCore/JSBase.h>
29+
#include <JavaScriptCore/WebKitAvailability.h>
30+
31+
namespace JSC {
32+
class JSLockHolder;
33+
class ExecState;
34+
class SourceCode;
35+
}
36+
37+
extern "C" JSValueRef JSEvaluateScriptInternal(const JSC::JSLockHolder&, JSC::ExecState*, JSContextRef, JSObjectRef thisObject, const JSC::SourceCode&, JSValueRef* exception);

modules/javafx.web/src/main/native/Source/JavaScriptCore/API/JSBasePrivate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ owns a large non-GC memory region. Calling this function will encourage the
4343
garbage collector to collect soon, hoping to reclaim that large non-GC memory
4444
region.
4545
*/
46-
JS_EXPORT void JSReportExtraMemoryCost(JSContextRef ctx, size_t size) JSC_API_AVAILABLE(macosx(10.6), ios(7.0));
46+
JS_EXPORT void JSReportExtraMemoryCost(JSContextRef ctx, size_t size) JSC_API_AVAILABLE(macos(10.6), ios(7.0));
4747

4848
JS_EXPORT void JSDisableGCTimer(void);
4949

modules/javafx.web/src/main/native/Source/JavaScriptCore/API/JSCallbackConstructor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
2+
* Copyright (C) 2006-2019 Apple Inc. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -48,7 +48,7 @@ JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, Struc
4848
void JSCallbackConstructor::finishCreation(JSGlobalObject* globalObject, JSClassRef jsClass)
4949
{
5050
Base::finishCreation(globalObject->vm());
51-
ASSERT(inherits(*vm(), info()));
51+
ASSERT(inherits(vm(), info()));
5252
if (m_class)
5353
JSClassRetain(jsClass);
5454
}

modules/javafx.web/src/main/native/Source/JavaScriptCore/API/JSCallbackObject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct JSCallbackObjectData {
5858
void setPrivateProperty(VM& vm, JSCell* owner, const Identifier& propertyName, JSValue value)
5959
{
6060
if (!m_privateProperties)
61-
m_privateProperties = std::make_unique<JSPrivatePropertyMap>();
61+
m_privateProperties = makeUnique<JSPrivatePropertyMap>();
6262
m_privateProperties->setPrivateProperty(vm, owner, propertyName, value);
6363
}
6464

modules/javafx.web/src/main/native/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006, 2008, 2016 Apple Inc. All rights reserved.
2+
* Copyright (C) 2006-2019 Apple Inc. All rights reserved.
33
* Copyright (C) 2007 Eric Seidel <[email protected]>
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -43,22 +43,22 @@ namespace JSC {
4343
template <class Parent>
4444
inline JSCallbackObject<Parent>* JSCallbackObject<Parent>::asCallbackObject(JSValue value)
4545
{
46-
ASSERT(asObject(value)->inherits(*value.getObject()->vm(), info()));
46+
ASSERT(asObject(value)->inherits(value.getObject()->vm(), info()));
4747
return jsCast<JSCallbackObject*>(asObject(value));
4848
}
4949

5050
template <class Parent>
5151
inline JSCallbackObject<Parent>* JSCallbackObject<Parent>::asCallbackObject(EncodedJSValue encodedValue)
5252
{
5353
JSValue value = JSValue::decode(encodedValue);
54-
ASSERT(asObject(value)->inherits(*value.getObject()->vm(), info()));
54+
ASSERT(asObject(value)->inherits(value.getObject()->vm(), info()));
5555
return jsCast<JSCallbackObject*>(asObject(value));
5656
}
5757

5858
template <class Parent>
5959
JSCallbackObject<Parent>::JSCallbackObject(ExecState* exec, Structure* structure, JSClassRef jsClass, void* data)
6060
: Parent(exec->vm(), structure)
61-
, m_callbackObjectData(std::make_unique<JSCallbackObjectData>(data, jsClass))
61+
, m_callbackObjectData(makeUnique<JSCallbackObjectData>(data, jsClass))
6262
{
6363
}
6464

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

7474
template <class Parent>
7575
JSCallbackObject<Parent>::~JSCallbackObject()
7676
{
77-
VM* vm = this->HeapCell::vm();
78-
vm->currentlyDestructingCallbackObject = this;
77+
VM& vm = this->HeapCell::vm();
78+
vm.currentlyDestructingCallbackObject = this;
7979
ASSERT(m_classInfo);
80-
vm->currentlyDestructingCallbackObjectClassInfo = m_classInfo;
80+
vm.currentlyDestructingCallbackObjectClassInfo = m_classInfo;
8181
JSObjectRef thisRef = toRef(static_cast<JSObject*>(this));
8282
for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
8383
if (JSObjectFinalizeCallback finalize = jsClass->finalize)
8484
finalize(thisRef);
8585
}
86-
vm->currentlyDestructingCallbackObject = nullptr;
87-
vm->currentlyDestructingCallbackObjectClassInfo = nullptr;
86+
vm.currentlyDestructingCallbackObject = nullptr;
87+
vm.currentlyDestructingCallbackObjectClassInfo = nullptr;
8888
}
8989

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

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

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

428430
template <class Parent>
@@ -547,6 +549,7 @@ EncodedJSValue JSCallbackObject<Parent>::call(ExecState* exec)
547549
template <class Parent>
548550
void JSCallbackObject<Parent>::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
549551
{
552+
VM& vm = exec->vm();
550553
JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(object);
551554
JSContextRef execRef = toRef(exec);
552555
JSObjectRef thisRef = toRef(thisObject);
@@ -565,7 +568,7 @@ void JSCallbackObject<Parent>::getOwnNonIndexPropertyNames(JSObject* object, Exe
565568
StaticValueEntry* entry = it->value.get();
566569
if (entry->getProperty && (!(entry->attributes & kJSPropertyAttributeDontEnum) || mode.includeDontEnumProperties())) {
567570
ASSERT(!name->isSymbol());
568-
propertyNames.add(Identifier::fromString(exec, String(name)));
571+
propertyNames.add(Identifier::fromString(vm, String(name)));
569572
}
570573
}
571574
}
@@ -578,7 +581,7 @@ void JSCallbackObject<Parent>::getOwnNonIndexPropertyNames(JSObject* object, Exe
578581
StaticFunctionEntry* entry = it->value.get();
579582
if (!(entry->attributes & kJSPropertyAttributeDontEnum) || mode.includeDontEnumProperties()) {
580583
ASSERT(!name->isSymbol());
581-
propertyNames.add(Identifier::fromString(exec, String(name)));
584+
propertyNames.add(Identifier::fromString(vm, String(name)));
582585
}
583586
}
584587
}

0 commit comments

Comments
 (0)