Bug 217362

Summary: [JSC] More consistent PtrTagging for code types
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: 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-10-05 21:13:21 PDT
[JSC] More consistent PtrTagging for code types
Comment 1 Yusuke Suzuki 2020-10-05 21:14:50 PDT
Created attachment 410608 [details]
Patch
Comment 2 Yusuke Suzuki 2020-10-05 22:22:45 PDT
Created attachment 410612 [details]
Patch
Comment 3 Mark Lam 2020-10-06 13:51:06 PDT
Comment on attachment 410612 [details]
Patch

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

r=me with fixes.

> Source/JavaScriptCore/llint/LLIntExceptions.cpp:76
> +MacroAssemblerCodeRef<ExceptionHandlerPtrTag> catcher(OpcodeSize size)

Can we call this handleCatch (verb) instead of catcher (noun)?

> Source/JavaScriptCore/llint/LLIntExceptions.cpp:80
> +        return catcherThunk(size);

Ditto: handleCatchThunk?

> Source/JavaScriptCore/llint/LLIntThunks.cpp:152
> +            codeRef.construct(generateThunkWithJumpTo<JITThunkPtrTag>(wasm_function_prologue, "function for call"));

Is there any reason this shouldn't also be using JSEntryPtrTag (and obsoleting JITThunkPtrTag)?  Looks like this is the last use of it.  We used to use JITThunkPtrTag for certain pointers based on where they point to.  Now, you've changed this to based on where the pointers will be used.  Based on where the pointer is used, it sounds like wasm_function_prologue should be using JSEntryPtrTag too.

You don't have to do this in this patch, but maybe it warrants a look later.
Comment 4 Yusuke Suzuki 2020-10-06 14:55:30 PDT
Comment on attachment 410612 [details]
Patch

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

Thanks!

>> Source/JavaScriptCore/llint/LLIntExceptions.cpp:76
>> +MacroAssemblerCodeRef<ExceptionHandlerPtrTag> catcher(OpcodeSize size)
> 
> Can we call this handleCatch (verb) instead of catcher (noun)?

Changed.

>> Source/JavaScriptCore/llint/LLIntExceptions.cpp:80
>> +        return catcherThunk(size);
> 
> Ditto: handleCatchThunk?

Changed.

>> Source/JavaScriptCore/llint/LLIntThunks.cpp:152
>> +            codeRef.construct(generateThunkWithJumpTo<JITThunkPtrTag>(wasm_function_prologue, "function for call"));
> 
> Is there any reason this shouldn't also be using JSEntryPtrTag (and obsoleting JITThunkPtrTag)?  Looks like this is the last use of it.  We used to use JITThunkPtrTag for certain pointers based on where they point to.  Now, you've changed this to based on where the pointers will be used.  Based on where the pointer is used, it sounds like wasm_function_prologue should be using JSEntryPtrTag too.
> 
> You don't have to do this in this patch, but maybe it warrants a look later.

wasmFunctionEntryThunk's code is used for jump target. So this I not JSEntry. I think JITThunkPtrTag is the right tag for this thunk.
Comment 5 Yusuke Suzuki 2020-10-06 15:04:46 PDT
Committed r268077: <https://trac.webkit.org/changeset/268077>
Comment 6 Radar WebKit Bug Importer 2020-10-06 15:05:21 PDT
<rdar://problem/70019125>