Bug 217362 - [JSC] More consistent PtrTagging for code types
Summary: [JSC] More consistent PtrTagging for code types
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-10-05 21:13 PDT by Yusuke Suzuki
Modified: 2020-10-06 15:05 PDT (History)
7 users (show)

See Also:


Attachments
Patch (49.95 KB, patch)
2020-10-05 21:14 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (50.05 KB, patch)
2020-10-05 22:22 PDT, 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-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>