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

[JSC] Move JSLock / JSUnlock from SPI to API #1439

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Constellation
Copy link
Member

2a82116

[JSC] Move JSLock / JSUnlock from SPI to API
https://bugs.webkit.org/show_bug.cgi?id=241504

Reviewed by NOBODY (OOPS!).

Tadeu demonstrated that this JSLock and JSUnlock are useful for performance (via API bench).
And it is also motivated by external clients too: "bun" from Jarred is adding literally the
similar API in his own fork of JavaScriptCore to make it fast. We should move them from SPI
to API to make it available to external clients.

* PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c:
* PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m:
* PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h:
* PerformanceTests/APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m:
* PerformanceTests/APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m:
* PerformanceTests/APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h:
* Source/JavaScriptCore/API/JSContextRef.h:
* Source/JavaScriptCore/API/JSLockRef.cpp:
* Source/JavaScriptCore/API/JSLockRefPrivate.h: Removed.
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:

https://bugs.webkit.org/show_bug.cgi?id=241504

Reviewed by NOBODY (OOPS!).

Tadeu demonstrated that this JSLock and JSUnlock are useful for performance (via API bench).
And it is also motivated by external clients too: "bun" from Jarred is adding literally the
similar API in his own fork of JavaScriptCore to make it fast. We should move them from SPI
to API to make it available to external clients.

* PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c:
* PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m:
* PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h:
* PerformanceTests/APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m:
* PerformanceTests/APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m:
* PerformanceTests/APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h:
* Source/JavaScriptCore/API/JSContextRef.h:
* Source/JavaScriptCore/API/JSLockRef.cpp:
* Source/JavaScriptCore/API/JSLockRefPrivate.h: Removed.
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
@Constellation Constellation self-assigned this Jun 10, 2022
@Constellation Constellation added JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. WebKit Nightly Build labels Jun 10, 2022
@geoffreygaren
Copy link
Contributor

Since this will be API on Apple platforms, have we done the Apple-internal API review?

Can we offer an ObjC API version too that automatically takes the lock, invokes a block, and then releases the lock? It's nice for our ObjC API to have feature parity, and also nice that it can do a little better than our C API in ease of use.

@webkit-early-warning-system webkit-early-warning-system added the merging-blocked Applied to prevent a change from being merged label Jun 20, 2022
@Constellation Constellation requested a review from a team as a code owner July 13, 2022 00:19
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
Development

Successfully merging this pull request may close these issues.

4 participants