Bug 219847 - [JSC] Introduce vmEntryCustomAccessor and vmEntryHostFunction for JITCage
Summary: [JSC] Introduce vmEntryCustomAccessor and vmEntryHostFunction for JITCage
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-12-13 22:28 PST by Yusuke Suzuki
Modified: 2020-12-16 05:48 PST (History)
10 users (show)

See Also:


Attachments
Patch (53.43 KB, patch)
2020-12-13 22:30 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (54.54 KB, patch)
2020-12-13 23:00 PST, Yusuke Suzuki
mark.lam: 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-12-13 22:28:00 PST
[JSC] Introduce vmEntryCustomAccessor and vmEntryHostFunction for JITCage
Comment 1 Yusuke Suzuki 2020-12-13 22:30:53 PST
Created attachment 416137 [details]
Patch
Comment 2 Yusuke Suzuki 2020-12-13 22:31:59 PST
<rdar://problem/71825625>
Comment 3 Yusuke Suzuki 2020-12-13 23:00:03 PST
Created attachment 416138 [details]
Patch

Removed assertIsHostFunction
Comment 4 Mark Lam 2020-12-13 23:41:12 PST
Comment on attachment 416137 [details]
Patch

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

> Source/JavaScriptCore/runtime/NativeFunction.h:36
> +using RawNativeFunctionWithPtr = EncodedJSValue(JSC_HOST_CALL_ATTRIBUTES*)(JSGlobalObject*, CallFrame*, void*);

Please remove this since it is not used.

> Source/JavaScriptCore/runtime/PutPropertySlot.h:42
> -    typedef bool (*PutValueFunc)(JSGlobalObject*, EncodedJSValue thisObject, EncodedJSValue value);
> +    using PutValueFunc = bool (*)(JSGlobalObject*, EncodedJSValue, EncodedJSValue);
> +    using PutValueFuncWithPtr = bool (*)(JSGlobalObject*, EncodedJSValue, EncodedJSValue, void*);

Would you mind keeping the variable names `thisObject` and `value` to document the different purposes of the 2 EncodedJSValue arguments?

> Source/WTF/wtf/PlatformCallingConventions.h:96
> +#define JSC_DEFINE_JIT_OPERATION_WITH_ATTRIBUTES_WITHOUT_VARIABLE(functionName, attributes, returnType, parameters) \
> +    attributes returnType JIT_OPERATION_ATTRIBUTES functionName parameters

Should we get rid of the attributes argument since it is never used?  Do you think there's value in keeping it?
Comment 5 Mark Lam 2020-12-13 23:42:53 PST
Comment on attachment 416138 [details]
Patch

r=me
Comment 6 Yusuke Suzuki 2020-12-13 23:44:38 PST
Comment on attachment 416137 [details]
Patch

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

Thanks!

>> Source/JavaScriptCore/runtime/NativeFunction.h:36
>> +using RawNativeFunctionWithPtr = EncodedJSValue(JSC_HOST_CALL_ATTRIBUTES*)(JSGlobalObject*, CallFrame*, void*);
> 
> Please remove this since it is not used.

Removed.

>> Source/JavaScriptCore/runtime/PutPropertySlot.h:42
>> +    using PutValueFuncWithPtr = bool (*)(JSGlobalObject*, EncodedJSValue, EncodedJSValue, void*);
> 
> Would you mind keeping the variable names `thisObject` and `value` to document the different purposes of the 2 EncodedJSValue arguments?

Recovered.

>> Source/WTF/wtf/PlatformCallingConventions.h:96
>> +    attributes returnType JIT_OPERATION_ATTRIBUTES functionName parameters
> 
> Should we get rid of the attributes argument since it is never used?  Do you think there's value in keeping it?

Removed.
Comment 7 Yusuke Suzuki 2020-12-14 02:32:40 PST
Committed r270764: <https://trac.webkit.org/changeset/270764>
Comment 8 Yusuke Suzuki 2020-12-16 05:48:17 PST
Committed r270888: <https://trac.webkit.org/changeset/270888>