Bug 184702 - Templatize CodePtr/Refs/FunctionPtrs with PtrTags.
Summary: Templatize CodePtr/Refs/FunctionPtrs with PtrTags.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-17 10:48 PDT by Mark Lam
Modified: 2018-04-18 06:32 PDT (History)
10 users (show)

See Also:


Attachments
proposed patch. (611.81 KB, patch)
2018-04-17 14:49 PDT, Mark Lam
no flags Details | Formatted Diff | Diff
proposed patch rebased. (611.78 KB, patch)
2018-04-17 14:53 PDT, Mark Lam
fpizlo: review+
Details | Formatted Diff | Diff
patch for landing. (612.46 KB, patch)
2018-04-17 16:17 PDT, Mark Lam
no flags Details | Formatted Diff | Diff
patch for landing + speculative build fix for Windows. (612.78 KB, patch)
2018-04-17 17:38 PDT, Mark Lam
no flags Details | Formatted Diff | Diff
patch for landing + speculative build fix for Windows. (612.74 KB, patch)
2018-04-17 18:44 PDT, Mark Lam
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2018-04-17 10:48:46 PDT
<rdar://problem/35391681>
Comment 1 Mark Lam 2018-04-17 14:49:37 PDT
Created attachment 338151 [details]
proposed patch.
Comment 2 EWS Watchlist 2018-04-17 14:52:24 PDT
Attachment 338151 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/assembler/LinkBuffer.h:355:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h:221:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/ftl/FTLSlowPathCallKey.h:56:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 3 in 187 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Mark Lam 2018-04-17 14:53:39 PDT
Created attachment 338152 [details]
proposed patch rebased.
Comment 4 EWS Watchlist 2018-04-17 14:56:23 PDT
Attachment 338152 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/assembler/LinkBuffer.h:355:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h:221:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/ftl/FTLSlowPathCallKey.h:56:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 3 in 187 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Filip Pizlo 2018-04-17 15:13:33 PDT
Comment on attachment 338152 [details]
proposed patch rebased.

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

r=me.  The suggestions about using alternate tags can be addressed in another bug.

> Source/JavaScriptCore/bytecode/CallLinkInfo.h:332
> +    CodeLocationLabel<JSEntryPtrTag> m_callReturnLocationOrPatchableJump;
> +    CodeLocationLabel<JSEntryPtrTag> m_hotPathBeginOrSlowPathStart;
> +    CodeLocationNearCall<JSEntryPtrTag> m_hotPathOther;

I think these should be JSInternalPtrTag, since these are not being used as targets for a JS call.  They are being used to point at some patchable stuff in the call IC.

> Source/JavaScriptCore/ftl/FTLLazySlowPath.h:88
> +    CodeLocationLabel<JSEntryPtrTag> m_done;

I think this should be JSInternalPtrTag.  It's not meant to point to the call entrypoint of anything.

> Source/JavaScriptCore/jit/JITMathIC.h:67
> +    CodeLocationLabel<JSEntryPtrTag> doneLocation() { return m_inlineStart.labelAtOffset(m_inlineSize); }
> +    CodeLocationLabel<JSEntryPtrTag> slowPathStartLocation() { return m_inlineStart.labelAtOffset(m_deltaFromStartToSlowPathStart); }
> +    CodeLocationCall<JSEntryPtrTag> slowPathCallLocation() { return m_inlineStart.callAtOffset(m_deltaFromStartToSlowPathCallLocation); }

I think these should be JSInternal, since none of these are meant to call to the JS call entrypoint of any function.

> Source/JavaScriptCore/jit/JITMathIC.h:250
> +    CodeLocationLabel<JSEntryPtrTag> m_inlineStart;

ISInternal, because this does not for doing JS calls

> Source/JavaScriptCore/llint/LLIntData.cpp:78
> +        JSEntryPtrTag, // llint_program_prologue
> +        JSEntryPtrTag, // llint_eval_prologue
> +        JSEntryPtrTag, // llint_module_program_prologue
> +        JSEntryPtrTag, // llint_function_for_call_prologue
> +        JSEntryPtrTag, // llint_function_for_construct_prologue
> +        JSEntryPtrTag, // llint_function_for_call_arity_check
> +        JSEntryPtrTag, // llint_function_for_construct_arity_check
> +        JSEntryPtrTag, // llint_generic_return_point
>          BytecodePtrTag, // llint_throw_from_slow_path_trampoline
>          ExceptionHandlerPtrTag, // llint_throw_during_call_trampoline
> -        CodePtrTag, // llint_native_call_trampoline
> -        CodePtrTag, // llint_native_construct_trampoline
> -        CodePtrTag, // llint_internal_function_call_trampoline
> -        CodePtrTag, // llint_internal_function_construct_trampoline
> +        JSEntryPtrTag, // llint_native_call_trampoline
> +        JSEntryPtrTag, // llint_native_construct_trampoline
> +        JSEntryPtrTag, // llint_internal_function_call_trampoline
> +        JSEntryPtrTag, // llint_internal_function_construct_trampoline

It would be cool if we could give these JSInternal since these aren't meant to be used as targets of JS calls.
Comment 6 Mark Lam 2018-04-17 16:17:39 PDT
Created attachment 338157 [details]
patch for landing.
Comment 7 EWS Watchlist 2018-04-17 16:21:18 PDT
Attachment 338157 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/assembler/LinkBuffer.h:355:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h:221:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/ftl/FTLSlowPathCallKey.h:56:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 3 in 187 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Mark Lam 2018-04-17 17:38:53 PDT
Created attachment 338170 [details]
patch for landing + speculative build fix for Windows.
Comment 9 EWS Watchlist 2018-04-17 17:41:06 PDT
Attachment 338170 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/assembler/LinkBuffer.h:355:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h:221:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/ftl/FTLSlowPathCallKey.h:56:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 3 in 187 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Mark Lam 2018-04-17 18:44:49 PDT
Created attachment 338179 [details]
patch for landing + speculative build fix for Windows.
Comment 11 EWS Watchlist 2018-04-17 18:46:58 PDT
Attachment 338179 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/assembler/LinkBuffer.h:355:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h:221:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/ftl/FTLSlowPathCallKey.h:56:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 3 in 187 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 EWS Watchlist 2018-04-17 20:05:00 PDT
Comment on attachment 338179 [details]
patch for landing + speculative build fix for Windows.

Attachment 338179 [details] did not pass jsc-ews (mac):
Output: http://webkit-queues.webkit.org/results/7351388

New failing tests:
stress/ftl-put-by-id-setter-exception-interesting-live-state.js.no-cjit-collect-continuously
Comment 13 Mark Lam 2018-04-17 20:28:36 PDT
(In reply to Build Bot from comment #12)
> Comment on attachment 338179 [details]
> patch for landing + speculative build fix for Windows.
> 
> Attachment 338179 [details] did not pass jsc-ews (mac):
> Output: http://webkit-queues.webkit.org/results/7351388
> 
> New failing tests:
> stress/ftl-put-by-id-setter-exception-interesting-live-state.js.no-cjit-
> collect-continuously

I'm quite sure that this is not caused by my patch.  I also cannot reproduce it locally.  Will land shortly.
Comment 14 Mark Lam 2018-04-17 20:32:07 PDT
Landed in r230748: <http://trac.webkit.org/r230748>.
Comment 15 Fujii Hironori 2018-04-18 04:08:39 PDT
WinCairo builds get broken. Bug 184725
Comment 16 Tomas Popela 2018-04-18 06:04:18 PDT
I pushed a build fix for ARM in https://trac.webkit.org/r230762
Comment 17 Tomas Popela 2018-04-18 06:05:11 PDT
And also one small for GCC - https://trac.webkit.org/r230761 (that was triggered by our hardening flags in Fedora)
Comment 18 Tomas Popela 2018-04-18 06:32:34 PDT
And another build failure on ARM - bug 184730