You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve how QueryCaches and QueryStates are stored.
`QuerySystem` has these fields:
```
pub states: QueryStates<'tcx>,
pub caches: QueryCaches<'tcx>,
pub query_vtables: PerQueryVTables<'tcx>,
```
Each one has an entry for each query.
Some methods that take a query-specific `QueryVTable` (via a
`SemiDynamicQueryDispatcher` wrapper) need to access the corresponding
query-specific states and/or caches. So `QueryVTable` stores the *byte
offset* to the relevant fields within `states` and `caches`, and uses
that to (with `unsafe`) access the fields. This is bizarre, and I hope
it made sense in the past when the code was structured differently.
This commit moves `QueryState` and `QueryCache` inside `QueryVTable`. As
a result, the query-specific states and/or caches are directly
accessible, and no unsafe offset computations are required. Much simpler
and more normal. Also, `QueryCaches` and `QueryStates` are no longer
needed, which makes `define_callbacks!` a bit simpler. `QueryVTable` no
longer impls `DynSync`, which required the change in the preceding
commit.
0 commit comments