Bug 199291 - FTL keepAlive()'s patchpoint should also declare that it reads HeapRange::top().
Summary: FTL keepAlive()'s patchpoint should also declare that it reads HeapRange::top().
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: 2019-06-27 15:13 PDT by Mark Lam
Modified: 2019-06-27 17:31 PDT (History)
9 users (show)

See Also:


Attachments
proposed patch. (2.08 KB, patch)
2019-06-27 15:19 PDT, Mark Lam
ysuzuki: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2019-06-27 15:13:20 PDT
The main purpose of keepAlive() is to communicate to B3 that an LValue needs to be kept alive pass the last opportunity for a GC.  The only way we can get a GC is via a function call.  Hence, what keepAlive() really needs to communicate is that the LValue needs to be kept alive pass the last function call.  Function calls read and write HeapRange::top().  Currently, B3 does not shuffle writes.  Hence, simply inserting the keepAlive() after the calls that can GC is sufficient.  But to be strictly correct, keepAlive() should also declare that it reads HeapRange::top().  This will guarantee that the keepAlive patchpoint won't ever be moved before the function call should B3 gain the ability to shuffle writes in the future.
Comment 1 Mark Lam 2019-06-27 15:19:04 PDT
Created attachment 373057 [details]
proposed patch.
Comment 2 Yusuke Suzuki 2019-06-27 15:23:42 PDT
Comment on attachment 373057 [details]
proposed patch.

r=me
Comment 3 Filip Pizlo 2019-06-27 16:00:05 PDT
Comment on attachment 373057 [details]
proposed patch.

R=me too.
Comment 4 Mark Lam 2019-06-27 17:27:23 PDT
Thanks for the reviews.  Landed in r246910: <http://trac.webkit.org/r246910>.
Comment 5 Radar WebKit Bug Importer 2019-06-27 17:31:35 PDT
<rdar://problem/52296737>