Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert JavaScriptCore to Modern Objective-C #9692

Conversation

AtariDreams
Copy link
Contributor

@AtariDreams AtariDreams commented Feb 6, 2023

5828788aa36b103f16a1990848521e05c1100c00

Convert JavaScriptCore to Modern Objective-C
https://bugs.webkit.org/show_bug.cgi?id=251797

Reviewed by NOBODY (OOPS!).

JavaScriptCore was run through the Xcode's Modern Objective-C converter.
However, the results were not buildable alone, so some additional
changes were made to get the JavaScriptCore framework to build again.

As this is an API change, this warrants modernization as:
1. This code has roots going back years, which makes sense as Safari has
   been around for 2 decades. Modernizing the code helps as it lays the
   groundwork for future patches to follow modern Objective-C coding
   conventions as well as being consistent with newer code written.
2. These modernizations make the code more safe while improving
   performance in some places.
3. If we ever need to write Swift code calling this library directly, it
   will be much easier to get Swift to work with this framework.

* Source/JavaScriptCore/API/APICallbackFunction.h:
* Source/JavaScriptCore/API/JSAPIGlobalObject.mm:
* Source/JavaScriptCore/API/JSContext.mm:
* Source/JavaScriptCore/API/JSContextInternal.h:
* Source/JavaScriptCore/API/JSManagedValue.h:
* Source/JavaScriptCore/API/JSManagedValue.mm:
* Source/JavaScriptCore/API/JSScript.h:
* Source/JavaScriptCore/API/JSScript.mm:
* Source/JavaScriptCore/API/JSScriptInternal.h:
* Source/JavaScriptCore/API/JSScriptSourceProvider.mm:
* Source/JavaScriptCore/API/JSValue.mm:
* Source/JavaScriptCore/API/JSVirtualMachine.mm:
* Source/JavaScriptCore/API/JSWrapperMap.mm:
* Source/JavaScriptCore/API/ObjCCallbackFunction.mm:
* Source/JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.mm:
* Source/JavaScriptCore/API/tests/DateTests.mm:
* Source/JavaScriptCore/API/tests/Regress141275.mm:
* Source/JavaScriptCore/API/tests/Regress141809.mm:
* Source/JavaScriptCore/API/tests/testapi.mm:
* Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp:
* Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm:
* Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorXPCConnection.mm:
* Source/JavaScriptCore/testmem/testmem.mm:
* Source/WTF/wtf/cocoa/FileSystemCocoa.mm:
* Source/WTF/wtf/cocoa/LanguageCocoa.mm:
* Source/WTF/wtf/cocoa/NSURLExtras.mm:
* Source/WebCore/bridge/objc/objc_utility.mm:
* Source/WebCore/platform/mac/PluginBlocklist.mm:
* Source/WebGPU/WebGPU/Adapter.mm:
* Source/WebGPU/WebGPU/Device.mm:
* Source/WebGPU/WebGPU/HardwareCapabilities.mm:
* Source/WebKit/UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerConfiguration.mm:
* Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
* Source/bmalloc/bmalloc/ProcessCheck.mm:

7f1fd02

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  πŸ§ͺ jsc βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2 ⏳ πŸ§ͺ api-gtk
βœ… πŸ›  πŸ§ͺ jsc-arm64 βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ›  jsc-armv7
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress βœ… πŸ§ͺ jsc-armv7-tests
βœ… πŸ›  watch-sim βœ… πŸ›  jsc-mips
βœ… πŸ§ͺ jsc-mips-tests

@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from fcf3aaf to 0e35859 Compare February 6, 2023 16:23
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 6, 2023
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 0e35859 to 87b4d16 Compare February 6, 2023 16:37
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 87b4d16 to 7d1b8a1 Compare February 6, 2023 16:48
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 7d1b8a1 to c0a198f Compare February 6, 2023 17:13
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from c0a198f to f8684f9 Compare February 6, 2023 17:39
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from f8684f9 to 6ea2139 Compare February 6, 2023 18:38
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 6ea2139 to 7ae3b6f Compare February 6, 2023 19:18
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 7ae3b6f to 2e2249c Compare February 6, 2023 19:42
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 2e2249c to 9a86a36 Compare February 6, 2023 22:49
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 9a86a36 to f8ef026 Compare February 6, 2023 22:50
@Ahmad-S792 Ahmad-S792 added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Feb 6, 2023
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from f8ef026 to 3063547 Compare February 7, 2023 14:54
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from b3f7c47 to 0c4b437 Compare March 10, 2023 16:42
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 0c4b437 to db66d93 Compare March 14, 2023 15:21
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from db66d93 to 4a881a1 Compare March 15, 2023 16:17
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 4a881a1 to 5828788 Compare March 16, 2023 14:54
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 5828788 to 94c2deb Compare March 19, 2023 19:28
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 94c2deb to 6947ebc Compare March 19, 2023 19:38
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 6947ebc to e46d6b7 Compare March 19, 2023 19:50
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from e46d6b7 to ccd50e4 Compare March 19, 2023 19:53
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from ccd50e4 to 263fb41 Compare March 19, 2023 19:54
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 263fb41 to 7a49778 Compare March 19, 2023 19:55
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 7a49778 to 92fa339 Compare March 19, 2023 20:01
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 92fa339 to 84907dd Compare March 19, 2023 20:17
https://bugs.webkit.org/show_bug.cgi?id=251797

Reviewed by NOBODY (OOPS!).

JavaScriptCore was run through the Xcode's Modern Objective-C converter.
However, the results were not buildable alone, so some additional
changes were made to get the JavaScriptCore framework to build again.

As this is an API change, this warrants modernization as:
1. This code has roots going back years, which makes sense as Safari has
   been around for 2 decades. Modernizing the code helps as it lays the
   groundwork for future patches to follow modern Objective-C coding
   conventions as well as being consistent with newer code written.
2. These modernizations make the code more safe while improving
   performance in some places.
3. If we ever need to write Swift code calling this library directly, it
   will be much easier to get Swift to work with this framework.

* Source/JavaScriptCore/API/APICallbackFunction.h:
* Source/JavaScriptCore/API/JSAPIGlobalObject.mm:
* Source/JavaScriptCore/API/JSContext.mm:
* Source/JavaScriptCore/API/JSContextInternal.h:
* Source/JavaScriptCore/API/JSManagedValue.h:
* Source/JavaScriptCore/API/JSManagedValue.mm:
* Source/JavaScriptCore/API/JSScript.h:
* Source/JavaScriptCore/API/JSScript.mm:
* Source/JavaScriptCore/API/JSScriptInternal.h:
* Source/JavaScriptCore/API/JSScriptSourceProvider.mm:
* Source/JavaScriptCore/API/JSValue.mm:
* Source/JavaScriptCore/API/JSVirtualMachine.mm:
* Source/JavaScriptCore/API/JSWrapperMap.mm:
* Source/JavaScriptCore/API/ObjCCallbackFunction.mm:
* Source/JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.mm:
* Source/JavaScriptCore/API/tests/DateTests.mm:
* Source/JavaScriptCore/API/tests/Regress141275.mm:
* Source/JavaScriptCore/API/tests/Regress141809.mm:
* Source/JavaScriptCore/API/tests/testapi.mm:
* Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp:
* Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm:
* Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorXPCConnection.mm:
* Source/JavaScriptCore/testmem/testmem.mm:
* Source/WTF/wtf/cocoa/FileSystemCocoa.mm:
* Source/WTF/wtf/cocoa/LanguageCocoa.mm:
* Source/WTF/wtf/cocoa/NSURLExtras.mm:
* Source/WebCore/bridge/objc/objc_utility.mm:
* Source/WebCore/platform/mac/PluginBlocklist.mm:
* Source/WebGPU/WebGPU/Adapter.mm:
* Source/WebGPU/WebGPU/Device.mm:
* Source/WebGPU/WebGPU/HardwareCapabilities.mm:
* Source/WebKit/UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerConfiguration.mm:
* Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
* Source/bmalloc/bmalloc/ProcessCheck.mm:
@AtariDreams AtariDreams force-pushed the eng/Convert-JavaScriptCore-to-Modern-Objective-C branch from 84907dd to 7f1fd02 Compare March 26, 2023 19:13
@JonWBedard
Copy link
Member

We're going to close this pull-request because modifications of JavaScriptCore's API in this way does not appear to be something we are capable of resolving in a GitHub pull-request. At this point, if you'd like to join the WebKit project on Slack, we can discuss these changes further.

@JonWBedard JonWBedard closed this Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. merging-blocked Applied to prevent a change from being merged
Projects
None yet