Bug 115299 - fourthTier: WatchpointSet should make racy uses easier to reason about
Summary: fourthTier: WatchpointSet should make racy uses easier to reason about
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
Depends on:
Blocks: 112839
  Show dependency treegraph
Reported: 2013-04-26 23:19 PDT by Filip Pizlo
Modified: 2013-04-27 12:21 PDT (History)
7 users (show)

See Also:

the ptach (5.86 KB, patch)
2013-04-26 23:23 PDT, Filip Pizlo
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2013-04-26 23:19:07 PDT
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.
Comment 1 Filip Pizlo 2013-04-26 23:23:54 PDT
Created attachment 199893 [details]
the ptach
Comment 2 Filip Pizlo 2013-04-27 11:22:56 PDT
Landed in http://trac.webkit.org/changeset/149239
Comment 3 Geoffrey Garen 2013-04-27 12:21:10 PDT
I like this.