Skip to content

Commit

Permalink
WebKit-7620.1.16.10.11
Browse files Browse the repository at this point in the history
Imported from WebKit-7620.1.16.10.11.tar.gz
  • Loading branch information
AppleOSSDistributions committed Jan 15, 2025
1 parent 4c7d87d commit e093a14
Show file tree
Hide file tree
Showing 17,522 changed files with 299,081 additions and 265,456 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions Configurations/CommonBase.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ OTHER_CFLAGS = $(inherited) $(WK_COMMON_OTHER_CFLAGS);
WK_COMMON_OTHER_CPLUSPLUSFLAGS = $(WK_LIBCPP_ASSERTIONS_CFLAGS) $(WK_SANITIZER_OTHER_CPLUSPLUSFLAGS);
OTHER_CPLUSPLUSFLAGS = $(inherited) $(WK_COMMON_OTHER_CPLUSPLUSFLAGS);

WK_COMMON_OTHER_SWIFT_FLAGS = $(WK_COMMON_OTHER_SWIFT_FLAGS_$(USE_INTERNAL_SDK));
WK_COMMON_OTHER_SWIFT_FLAGS_YES = -DUSE_APPLE_INTERNAL_SDK;
OTHER_SWIFT_FLAGS = $(WK_COMMON_OTHER_SWIFT_FLAGS);

WK_COMMON_OTHER_LDFLAGS = $(WK_SANITIZER_OTHER_LDFLAGS);
OTHER_LDFLAGS = $(inherited) $(WK_COMMON_OTHER_LDFLAGS);

Expand Down
8 changes: 4 additions & 4 deletions Configurations/Version.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MAJOR_VERSION = 619;
MAJOR_VERSION = 620;
MINOR_VERSION = 1;
TINY_VERSION = 26;
MICRO_VERSION = 30;
NANO_VERSION = 5;
TINY_VERSION = 16;
MICRO_VERSION = 10;
NANO_VERSION = 11;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(TINY_VERSION).$(MICRO_VERSION).$(NANO_VERSION);

// The bundle version and short version string are set based on the current build configuration, see below.
Expand Down
8 changes: 7 additions & 1 deletion Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ if (USE_SKIA)
add_subdirectory(ThirdParty/skia)
endif ()

if (USE_SYSPROF_CAPTURE)
if (USE_SYSTEM_SYSPROF_CAPTURE)
find_package(SysProfCapture)
if (NOT SysProfCapture_FOUND)
message(FATAL_ERROR "system libsysprof-capture-4 not found, "
"consider using USE_SYSTEM_SYSPROF_CAPTURE=NO")
endif ()
elseif (USE_SYSPROF_CAPTURE)
add_subdirectory(ThirdParty/libsysprof-capture)
endif ()

Expand Down
13 changes: 9 additions & 4 deletions Source/JavaScriptCore/API/JSContext.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013-2019 Apple Inc. All rights reserved.
* Copyright (C) 2013-2024 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand All @@ -23,10 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#import <JavaScriptCore/JavaScript.h>
#import <JavaScriptCore/WebKitAvailability.h>
#ifndef JSContext_h
#define JSContext_h

#if JSC_OBJC_API_ENABLED
#include <JavaScriptCore/JavaScript.h>
#include <JavaScriptCore/WebKitAvailability.h>

#if defined(__OBJC__) && JSC_OBJC_API_ENABLED

@class JSScript, JSVirtualMachine, JSValue, JSContext;

Expand Down Expand Up @@ -238,3 +241,5 @@ JSC_CLASS_AVAILABLE(macos(10.9), ios(7.0))
@end

#endif

#endif /* JSContext_h */
11 changes: 8 additions & 3 deletions Source/JavaScriptCore/API/JSExport.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
* Copyright (C) 2013-2024 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand All @@ -23,9 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#import <JavaScriptCore/JavaScriptCore.h>
#ifndef JSExport_h
#define JSExport_h

#if JSC_OBJC_API_ENABLED
#include <JavaScriptCore/JavaScriptCore.h>

#if defined(__OBJC__) && JSC_OBJC_API_ENABLED

/*!
@protocol
Expand Down Expand Up @@ -144,3 +147,5 @@
@optional Selector __JS_EXPORT_AS__##PropertyName:(id)argument; @required Selector

#endif

#endif /* JSExport_h */
12 changes: 6 additions & 6 deletions Source/JavaScriptCore/API/JSManagedValue.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
* Copyright (C) 2013-2024 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand All @@ -26,10 +26,10 @@
#ifndef JSManagedValue_h
#define JSManagedValue_h

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

#if JSC_OBJC_API_ENABLED
#if defined(__OBJC__) && JSC_OBJC_API_ENABLED

@class JSValue;
@class JSContext;
Expand Down Expand Up @@ -76,6 +76,6 @@ NS_CLASS_AVAILABLE(10_9, 7_0)

@end

#endif // JSC_OBJC_API_ENABLED
#endif

#endif // JSManagedValue_h
#endif /* JSManagedValue_h */
7 changes: 4 additions & 3 deletions Source/JavaScriptCore/API/JSManagedValue.mm
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ - (instancetype)initWithValue:(JSValue *)value
return self;

JSC::JSGlobalObject* globalObject = toJS([value.context JSGlobalContextRef]);
JSC::VM& vm = globalObject->vm();
JSC::JSLockHolder apiLocker(vm);
auto& owner = managedValueHandleOwner();
JSC::Weak<JSC::JSGlobalObject> weak(globalObject, &owner, (__bridge void*)self);
m_globalObject.swap(weak);

m_lock = &globalObject->vm().apiLock();
m_lock = &vm.apiLock();

NSPointerFunctionsOptions weakIDOptions = NSPointerFunctionsWeakMemory | NSPointerFunctionsObjectPersonality;
NSPointerFunctionsOptions integerOptions = NSPointerFunctionsOpaqueMemory | NSPointerFunctionsIntegerPersonality;
Expand Down Expand Up @@ -149,11 +151,10 @@ - (JSValue *)value
return nil;

WTF::Locker<JSC::JSLock> locker(m_lock.get());
JSC::VM* vm = m_lock->vm();
RefPtr<JSC::VM> vm = m_lock->vm();
if (!vm)
return nil;

JSC::JSLockHolder apiLocker(vm);
if (!m_globalObject)
return nil;
if (m_weakValue.isClear())
Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/API/JSScriptRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static bool parseScript(VM& vm, const SourceCode& source, ParserError& error)
{
return !!parseRootNode<ProgramNode>(
vm, source, ImplementationVisibility::Public, JSParserBuiltinMode::NotBuiltin,
JSParserStrictMode::NotStrict, JSParserScriptMode::Classic, SourceParseMode::ProgramMode, error);
NoLexicallyScopedFeatures, JSParserScriptMode::Classic, SourceParseMode::ProgramMode, error);
}

extern "C" {
Expand Down
3 changes: 0 additions & 3 deletions Source/JavaScriptCore/API/JSStringRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ size_t JSStringGetUTF8CString(JSStringRef string, char* buffer, size_t bufferSiz
result = WTF::Unicode::convert(string->span8(), target);
else
result = WTF::Unicode::convert(string->span16(), target);
if (result.code == WTF::Unicode::ConversionResultCode::SourceInvalid)
return 0;

buffer[result.buffer.size()] = '\0';
return result.buffer.size() + 1;
}
Expand Down
4 changes: 3 additions & 1 deletion Source/JavaScriptCore/API/JSTypedArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,17 @@ static JSObject* createTypedArray(JSGlobalObject* globalObject, JSTypedArrayType
throwOutOfMemoryError(globalObject, scope);
return nullptr;
}
constexpr JSTypedArrayType kJSTypedArrayTypeFloat16Array = static_cast<JSTypedArrayType>(kJSTypedArrayTypeBigUint64Array + 1);
bool isResizableOrGrowableShared = buffer->isResizableOrGrowableShared();
switch (type) {
switch (static_cast<int>(type)) {
#define JSC_TYPED_ARRAY_FACTORY(type) case kJSTypedArrayType##type##Array: { \
return JS##type##Array::create(globalObject, globalObject->typedArrayStructure(Type##type, isResizableOrGrowableShared), WTFMove(buffer), offset, length.value()); \
}
FOR_EACH_TYPED_ARRAY_TYPE_EXCLUDING_DATA_VIEW(JSC_TYPED_ARRAY_FACTORY)
#undef JSC_TYPED_ARRAY_CHECK
case kJSTypedArrayTypeArrayBuffer:
case kJSTypedArrayTypeNone:
default:
RELEASE_ASSERT_NOT_REACHED();
}
return nullptr;
Expand Down
26 changes: 13 additions & 13 deletions Source/JavaScriptCore/API/JSValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#ifndef JSValue_h
#define JSValue_h

#if JSC_OBJC_API_ENABLED
#if defined(__OBJC__) && JSC_OBJC_API_ENABLED

#import <CoreGraphics/CGGeometry.h>

Expand Down Expand Up @@ -179,7 +179,7 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@result The JSValue representing a JavaScript value with type BigInt.
@discussion This is equivalent to calling the <code>BigInt</code> constructor from JavaScript with a string argument.
*/
+ (nullable JSValue *)valueWithNewBigIntFromString:(nonnull NSString *)string inContext:(nonnull JSContext *)context JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
+ (nullable JSValue *)valueWithNewBigIntFromString:(nonnull NSString *)string inContext:(nonnull JSContext *)context JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
Expand All @@ -188,7 +188,7 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@param context The JSContext to which the resulting JSValue belongs.
@result The JSValue representing a JavaScript value with type BigInt.
*/
+ (nullable JSValue *)valueWithNewBigIntFromInt64:(int64_t)int64 inContext:(nonnull JSContext *)context JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
+ (nullable JSValue *)valueWithNewBigIntFromInt64:(int64_t)int64 inContext:(nonnull JSContext *)context JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
Expand All @@ -197,7 +197,7 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@param context The JSContext to which the resulting JSValue belongs.
@result The JSValue representing a JavaScript value with type BigInt.
*/
+ (nullable JSValue *)valueWithNewBigIntFromUInt64:(uint64_t)uint64 inContext:(nonnull JSContext *)context JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
+ (nullable JSValue *)valueWithNewBigIntFromUInt64:(uint64_t)uint64 inContext:(nonnull JSContext *)context JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
Expand All @@ -207,7 +207,7 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@result The JSValue representing a JavaScript value with type BigInt.
@discussion If the value is not an integer, an exception is thrown.
*/
+ (nullable JSValue *)valueWithNewBigIntFromDouble:(double)value inContext:(nonnull JSContext *)context JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
+ (nullable JSValue *)valueWithNewBigIntFromDouble:(double)value inContext:(nonnull JSContext *)context JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
Expand Down Expand Up @@ -327,14 +327,14 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@abstract Convert a JSValue to a <code>int64_t</code>.
@discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language. If the value is a BigInt, then the value is truncated to an <code>int64_t</code>.
*/
- (int64_t)toInt64 JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
- (int64_t)toInt64 JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
@abstract Convert a JSValue to a <code>uint64_t</code>.
@discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language. If the value is a BigInt, then the value is truncated to a <code>uint64_t</code>.
*/
- (uint64_t)toUInt64 JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
- (uint64_t)toUInt64 JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
Expand Down Expand Up @@ -454,7 +454,7 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@property
@abstract Check if a JSValue is a BigInt.
*/
@property (readonly) BOOL isBigInt JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
@property (readonly) BOOL isBigInt JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
Expand Down Expand Up @@ -488,7 +488,7 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown.
@discussion The result is computed by comparing the results of JavaScript's <code>==</code>, <code><</code>, and <code>></code> operators. If either <code>self</code> or <code>other</code> is (or would coerce to) <code>NaN</code> in JavaScript, then the result is kJSRelationConditionUndefined.
*/
- (JSRelationCondition)compareJSValue:(nonnull JSValue *)other JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
- (JSRelationCondition)compareJSValue:(nonnull JSValue *)other JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
Expand All @@ -497,7 +497,7 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown.
@discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language then compared with <code>other</code>.
*/
- (JSRelationCondition)compareInt64:(int64_t)other JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
- (JSRelationCondition)compareInt64:(int64_t)other JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
Expand All @@ -506,7 +506,7 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown.
@discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language then compared with <code>other</code>.
*/
- (JSRelationCondition)compareUInt64:(uint64_t)other JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
- (JSRelationCondition)compareUInt64:(uint64_t)other JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@method
Expand All @@ -515,7 +515,7 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
@result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown.
@discussion The JSValue is converted to a double according to the rules specified by the JavaScript language then compared with <code>other</code>.
*/
- (JSRelationCondition)compareDouble:(double)other JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA));
- (JSRelationCondition)compareDouble:(double)other JSC_API_AVAILABLE(macos(15.0), ios(18.0));

/*!
@methodgroup Calling Functions and Constructors
Expand Down Expand Up @@ -821,4 +821,4 @@ JS_EXPORT extern NSString * _Null_unspecified const JSPropertyDescriptorSetKey;

#endif

#endif // JSValue_h
#endif /* JSValue_h */
Loading

0 comments on commit e093a14

Please sign in to comment.