Commit 7993925
committed
Add a JSC API to allow acquiring the JSLock
https://bugs.webkit.org/show_bug.cgi?id=219663
Reviewed by Filip Pizlo.
PerformanceTests:
This patch does 3 things:
- Change how the geomean is calculated in api-bench to avoid overflowing
- Allow linking against the local build we're benchmarking
- Adopt the new JSLock API in the UpcomingAPI subtests
Using the new API the score improves by ~13.5%. Here are the results for each
of the "UpcomingAPI" subtests plus the total score:
Before After
RichardsMostlyC: 77ms 23ms
RichardsMostlyObjC: 309ms 282ms
RichardsMostlySwift 305ms 280ms
RichardsSomeC: 101ms 95ms
RichardsSomeObjC: 160ms 157ms
RichardsSomeSwift: 201ms 202ms
------------------------------------------
Score: 29.5974 33.6404
* APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c:
(workfn):
* APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyObjC.xcscheme: Renamed from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme.
* APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m:
(+[WorkerTask context]):
* APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj:
* APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift.
* APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift:
* APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m:
(main):
* APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m:
(main):
* APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj:
* APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift.
* APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift:
* APIBench/api-bench:
Source/JavaScriptCore:
Introduce two new functions to the C API: JSLock and JSUnlock. These
functions allow users to take control of the JSContext's lock, which
can greatly reduce the overhead of bridging between JS and native.
* API/JSLockRef.cpp: Added.
(JSLock):
(JSUnlock):
* API/JSLockRefPrivate.h: Added.
* API/JSValueRef.cpp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
Canonical link: https://commits.webkit.org/232323@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270659 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent c55acc8 commit 7993925
21 files changed
Lines changed: 261 additions & 17 deletions
File tree
- PerformanceTests
- APIBench
- CurrentAPI/RichardsMostlyC/RichardsMostlyC
- References/RichardsC/RichardsC
- UpcomingAPI
- RichardsMostlyC/RichardsMostlyC
- RichardsMostlyObjC
- RichardsMostlyObjC
- RichardsMostlySwift
- RichardsMostlySwift.xcodeproj
- RichardsMostlySwift
- RichardsSomeC/RichardsSomeC
- RichardsSomeObjC/RichardsSomeObjC
- RichardsSomeSwift
- RichardsSomeSwift.xcodeproj
- RichardsSomeSwift
- Source/JavaScriptCore
- API
- JavaScriptCore.xcodeproj
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | | - | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | | - | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
| 287 | + | |
285 | 288 | | |
286 | 289 | | |
287 | 290 | | |
| |||
291 | 294 | | |
292 | 295 | | |
293 | 296 | | |
| 297 | + | |
294 | 298 | | |
295 | 299 | | |
296 | 300 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
0 commit comments