The compiler often does things like:
1c) Observe something that would imply that a WatchpointSet ought to be invalid
2c) Check that it is invalid
The main thread often does things like:
1m) Fire the watchpoint set
2m) Do some other thing that would cause the compiler to assume that the WatchpointSet ought to be invalid
An example is structure transitions.
This is totally fine, except that (1c) and (2c), and (1m) and (2m) could be reordered.
We already have some idioms to put load-load and store-store fences in the right places. But we should just make WatchpointSet take care of this for us, to reduce the chances of us getting this wrong.
Created attachment 199893 [details]
Landed in http://trac.webkit.org/changeset/149239
I like this.