Bug 190503 - Use currentStackPointer more
Summary: Use currentStackPointer more
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: 2018-10-11 18:03 PDT by Yusuke Suzuki
Modified: 2018-10-11 18:50 PDT (History)
10 users (show)

See Also:


Attachments
Patch (5.22 KB, patch)
2018-10-11 18:04 PDT, Yusuke Suzuki
saam: 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 2018-10-11 18:03:44 PDT
Use currentStackPointer more
Comment 1 Yusuke Suzuki 2018-10-11 18:04:24 PDT
Created attachment 352115 [details]
Patch
Comment 2 Saam Barati 2018-10-11 18:19:03 PDT
Comment on attachment 352115 [details]
Patch

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

> Source/WTF/wtf/StackBounds.cpp:55
> +    volatile uint8_t* stackValue = bitwise_cast<uint8_t*>(currentStackPointer());

Does this work on debug builds where this is an actual function call?
Comment 3 Yusuke Suzuki 2018-10-11 18:31:58 PDT
(In reply to Saam Barati from comment #2)
> Comment on attachment 352115 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=352115&action=review
> 
> > Source/WTF/wtf/StackBounds.cpp:55
> > +    volatile uint8_t* stackValue = bitwise_cast<uint8_t*>(currentStackPointer());
> 
> Does this work on debug builds where this is an actual function call?

Yeah, at least in x64, it works :)
Comment 4 Yusuke Suzuki 2018-10-11 18:33:40 PDT
Landed in https://trac.webkit.org/r237059
Comment 5 Radar WebKit Bug Importer 2018-10-11 18:34:26 PDT
<rdar://problem/45213815>
Comment 6 Mark Lam 2018-10-11 18:50:53 PDT
(In reply to Yusuke Suzuki from comment #3)
> (In reply to Saam Barati from comment #2)
> > Comment on attachment 352115 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=352115&action=review
> > 
> > > Source/WTF/wtf/StackBounds.cpp:55
> > > +    volatile uint8_t* stackValue = bitwise_cast<uint8_t*>(currentStackPointer());
> > 
> > Does this work on debug builds where this is an actual function call?
> 
> Yeah, at least in x64, it works :)

Yes, currentStackPointer() is designed to work on both release and debug builds.  They work differently though: the release build version relies on it being inlined, while the debug build version relies on it not being inlined.