Bug 215746 - [JSC] Add concurrency-aware version of isCallable / isConstructor to make it usable in DFG compiler
Summary: [JSC] Add concurrency-aware version of isCallable / isConstructor to make it ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-21 17:55 PDT by Yusuke Suzuki
Modified: 2020-08-25 01:07 PDT (History)
11 users (show)

See Also:


Attachments
Patch (21.60 KB, patch)
2020-08-21 17:56 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (26.07 KB, patch)
2020-08-21 18:12 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (26.18 KB, patch)
2020-08-21 18:20 PDT, Yusuke Suzuki
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2020-08-21 17:55:06 PDT
[JSC] Add concurrency-aware version of isCallable / isConstructor to make it usable in DFG compiler
Comment 1 Yusuke Suzuki 2020-08-21 17:56:56 PDT
Created attachment 407035 [details]
Patch
Comment 2 Yusuke Suzuki 2020-08-21 18:12:13 PDT
Created attachment 407036 [details]
Patch
Comment 3 Yusuke Suzuki 2020-08-21 18:20:25 PDT
Created attachment 407037 [details]
Patch
Comment 4 Saam Barati 2020-08-24 13:39:25 PDT
Comment on attachment 407037 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407037&action=review

> Source/JavaScriptCore/runtime/Concurrency.h:34
> +    OnMainThread,
> +    Concurrently,

to make these names match, I'd do:
OnMainThread, OnConcurrentThread

MainThread, ConcurrentThread

Main, Concurrent

> Source/JavaScriptCore/runtime/JSCellInlines.h:254
> +        else {

Do we need an else here, since previous "if constexpr" ends in a return?

> Source/JavaScriptCore/runtime/JSCellInlines.h:257
> +            if (type() == InternalFunctionType)

Maybe add a FIXME + link to bug about your plan to when NPAPI is removed b/c its concurrency issue, and rename getCallData to indicate it can be concurrent?

Or perhaps, if that doesn't work out, add a new getCallDataConcurrently version?

> Source/JavaScriptCore/runtime/JSCellInlines.h:272
> +    else {

Do we need an else here, since previous "if constexpr" ends in a return?
Comment 5 Yusuke Suzuki 2020-08-25 01:03:57 PDT
Comment on attachment 407037 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407037&action=review

Thanks!

>> Source/JavaScriptCore/runtime/Concurrency.h:34
>> +    Concurrently,
> 
> to make these names match, I'd do:
> OnMainThread, OnConcurrentThread
> 
> MainThread, ConcurrentThread
> 
> Main, Concurrent

Changing it to MainThread / ConcurrentThread.

>> Source/JavaScriptCore/runtime/JSCellInlines.h:254
>> +        else {
> 
> Do we need an else here, since previous "if constexpr" ends in a return?

Strictly speaking, this else makes else branch `if-constexpr-else`, but in this case, the above branch returns so maybe this does not affect on the generated code. Removed.

>> Source/JavaScriptCore/runtime/JSCellInlines.h:257
>> +            if (type() == InternalFunctionType)
> 
> Maybe add a FIXME + link to bug about your plan to when NPAPI is removed b/c its concurrency issue, and rename getCallData to indicate it can be concurrent?
> 
> Or perhaps, if that doesn't work out, add a new getCallDataConcurrently version?

Added FIXME.

>> Source/JavaScriptCore/runtime/JSCellInlines.h:272
>> +    else {
> 
> Do we need an else here, since previous "if constexpr" ends in a return?

Removed because of the same reason above.
Comment 6 Yusuke Suzuki 2020-08-25 01:06:56 PDT
Committed r266107: <https://trac.webkit.org/changeset/266107>
Comment 7 Radar WebKit Bug Importer 2020-08-25 01:07:13 PDT
<rdar://problem/67724632>