Bug 219847

Summary: [JSC] Introduce vmEntryCustomAccessor and vmEntryHostFunction for JITCage
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch mark.lam: review+

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>