Bug 166847 - GC barrier shouldn't need any fences
Summary: GC barrier shouldn't need any fences
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords: InRadar
Depends on:
Blocks: 165909
  Show dependency treegraph
 
Reported: 2017-01-09 09:59 PST by Filip Pizlo
Modified: 2017-01-09 21:00 PST (History)
1 user (show)

See Also:


Attachments
work in progress (41.40 KB, patch)
2017-01-09 10:58 PST, Filip Pizlo
no flags Details | Formatted Diff | Diff
all of the optimizations _except_ the rescan/fence removal (32.38 KB, patch)
2017-01-09 20:18 PST, Filip Pizlo
no flags Details | Formatted Diff | Diff
it seems to work (74.53 KB, patch)
2017-01-09 20:57 PST, Filip Pizlo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2017-01-09 09:59:29 PST
My initial implementation of the retreating wavefront barrier required a store-load fence.

This is not necessary if you do some double-buffering.
Comment 1 Filip Pizlo 2017-01-09 10:58:09 PST
Created attachment 298366 [details]
work in progress

I ought to be able to benchmark this soon.
Comment 2 Radar WebKit Bug Importer 2017-01-09 13:47:56 PST
<rdar://problem/29934388>
Comment 3 Filip Pizlo 2017-01-09 20:18:02 PST
Created attachment 298439 [details]
all of the optimizations _except_ the rescan/fence removal
Comment 4 Filip Pizlo 2017-01-09 20:56:46 PST
It appears that the barrier based on the rescan bit is best for programs that repeatedly store into the same object.

The barrier based on an optimized, and inlined, store-load fence is best for programs that obey the generational hypothesis.

I think that the latter kind of barrier is also giving better splay-latency numbers.

I'm going to create a new bug for the optimized (but not rescan log) barrier, and get that landed.  I'll leave this bug in limbo for now.  It seems like it's sometimes, but not always, a good idea.
Comment 5 Filip Pizlo 2017-01-09 20:57:52 PST
Created attachment 298443 [details]
it seems to work

But it doesn't seem as good as the TSO barrier, after the TSO barrier gets all of the other optimizations.