Commit graph

370 commits

Author SHA1 Message Date
Niko Matsakis
7a5b515279 make DatabaseStorageTypes have supertrait of Database 2020-07-04 14:17:11 +00:00
Niko Matsakis
12f54d66f4 move query/query-mut to DatabaseQueryExt 2020-07-04 14:17:11 +00:00
Niko Matsakis
28b642e8c0 make DB ?Sized on execute_query_implementation helper 2020-07-04 14:17:11 +00:00
Niko Matsakis
d1fe9950c5 simplify salsa_event and make it dyn-safe 2020-07-04 14:17:11 +00:00
Niko Matsakis
67687376ed implement the Storage<DB> change 2020-07-04 14:17:10 +00:00
Niko Matsakis
c6663f3dcb return durability of modified data and remove SharedStateWriteGuard
Now the `with_incremented_revision` method signature does not
reference the database DB in any way.
2020-07-04 14:16:50 +00:00
Niko Matsakis
705a35d4b7 pass 'new revision' as an explicit argument
The goal is to eliminate the "shared state guard" argument, which
currently requires access to the database.
2020-07-04 14:16:50 +00:00
Niko Matsakis
d71a7a2751 make with_incremented_revision dyn-safe 2020-07-04 14:16:50 +00:00
Niko Matsakis
64f3eb96a1 remove GroupKey associated type 2020-07-04 14:16:50 +00:00
Niko Matsakis
1a07944efe remove DatabaseKey associated type 2020-07-04 14:16:50 +00:00
Niko Matsakis
799ddce157 remove unused GroupData associated type 2020-07-04 14:16:50 +00:00
Niko Matsakis
1b778760ae track and report cycles using DatabaseKeyIndex 2020-07-04 14:16:50 +00:00
Niko Matsakis
7b5ac6e717 implement ability to get readable debug output for DatabaseKeyIndex 2020-07-04 14:16:50 +00:00
Niko Matsakis
5a1bf10ba6 add a query_name associated constant 2020-07-04 14:16:50 +00:00
Niko Matsakis
b4c6e69faf rewrite get_cycle_path to push to a vector 2020-07-04 14:16:50 +00:00
Niko Matsakis
07623fb962 remove the DatabaseData and associated unsafe code 2020-07-04 14:16:50 +00:00
Niko Matsakis
f7a14f2309 use DatabaseKeyIndex instead of Dependency 2020-07-04 14:16:49 +00:00
Niko Matsakis
29b6b833d1 compute database-key-index for interned fields 2020-07-04 14:16:14 +00:00
Niko Matsakis
a45087a322 compute database-key-index for input slots 2020-07-04 14:16:14 +00:00
Niko Matsakis
ed1632d151 compute database-key-index for derived slots 2020-07-04 14:16:14 +00:00
Niko Matsakis
8664e7e43c add database-key-index type 2020-07-04 14:16:14 +00:00
Niko Matsakis
206c086bac thread group index to storage initializers 2020-07-04 14:16:14 +00:00
Jonas Schievink
786168fc99 Simplify collect call 2020-07-03 19:30:23 +02:00
Jonas Schievink
e2569e7afc Use a boxed slice to store dependencies 2020-07-03 19:26:38 +02:00
Aleksey Kladov
9c7ac995d8 Make salsa buildable on power
rust-analyzer fails in rust-lang/rust repo on the power target,
because it doesn't have `AtomicU64`. So, lets just use `AtomicUsize`
as a revision number.

Semantically this is wrong, as we are not using revision to address
arrays, but, practically, it's a nice compromise to build on targets
without AtomicU64 and to have large revision numbers on most relevant
targets.
2020-07-03 16:27:19 +02:00
Aleksey Kladov
a6b162aba1 Replace mpsc channels with hand-written future implementation
cargo llvm-lines shows that some amount of llvm lines is spend on
`std::mpsc`. Given that this is not the most loved standard library
module, and that our usage of mpsc is extremely limited, it seems
worth-while to implement oneshot channel using parking_lot.
2020-07-02 01:17:52 +02:00
Markus Westerlind
380306930b feat: Prune unnecessary dependencies
Only AtomicCell is used from crossbeam and SmallRng from rand so we can
easily disable the default features
2020-07-01 22:42:07 +02:00
Laurențiu Nicola
cfb4e18eba Remove workaround for parking_lot#101 2020-06-27 13:59:29 +03:00
Laurențiu Nicola
2bf383861b Fix doctest 2020-06-27 12:46:24 +02:00
Laurențiu Nicola
bb1c308380 Revert "Bump parking_lot and remove workaround"
This reverts commit 025c882cbb.
2020-06-27 12:46:24 +02:00
Laurențiu Nicola
c627cda525 Bump parking_lot and remove workaround 2020-06-27 12:46:24 +02:00
Niko Matsakis
dd60d91e75 disable fragile LRU tests for now 2020-06-24 14:16:32 +00:00
Michal Terepeta
97ed750a9d Update some comments in slot.rs
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-13 12:10:26 +01:00
Declan Kelly
564fa155d4 Correct mutability in on demand example, fix doc links
Fix query_mut documentation link

Fix more documentation links

More doc links
2019-10-05 18:30:42 -07:00
Laurențiu Nicola
c99580ba14 implement QueryTable constructor manually 2019-10-03 19:26:20 +03:00
Niko Matsakis
b0710416d0 require &mut self for with_incremented_revision 2019-09-27 05:54:42 -04:00
Niko Matsakis
236c2eae84 require &mut self for QueryTableMut methods (breaking) 2019-09-27 05:54:10 -04:00
Niko Matsakis
1715d44555 store &mut DB in QueryTableMut 2019-09-27 05:53:16 -04:00
Niko Matsakis
0a94efeac3 emit WillChangeInputValue before new revision (breaking change!)
Otherwise we need to borrow the `db` in `with_incremented_revision`
and it's a pain.
2019-09-27 05:51:27 -04:00
Niko Matsakis
8c133e7a4d make synthetic_write require &mut self (breaking change!)
This was an oversight before -- the current type implies that
one introduce a synthetic write (and hence a new revision) from
a `Frozen<DB>`! Not cool.
2019-09-27 05:50:16 -04:00
Niko Matsakis
b9f00726da introduce Database::salsa_runtime_mut method (breaking change!) 2019-09-27 05:49:15 -04:00
Niko Matsakis
c789219bc5 move query-storage into an Arc
This way, we can hold a reference to it without borrowing the database.
2019-09-27 05:34:33 -04:00
Niko Matsakis
2e9b418bbb rework book a little bit
- extend some of the empty sections, add a new common pattern
- also, show how to use anchors and include so we can test the sources
  for common patterns
2019-09-24 06:13:51 -04:00
Aleksey Kladov
3616014391
Apply suggestions from code review
Co-Authored-By: Niko Matsakis <niko@alum.mit.edu>
2019-09-24 12:08:13 +03:00
Aleksey Kladov
a798f1d918 Update src/runtime.rs
Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
2019-09-22 18:31:38 +03:00
Aleksey Kladov
60a475202a add add_synthetic_read method to allow tweaking of the durability 2019-09-20 12:24:46 +03:00
Aleksey Kladov
95d0392f9c add invalidate method to queries 2019-09-20 10:40:26 +03:00
Niko Matsakis
a9860bf37f
Merge pull request #147 from Marwes/cycles
feat: Allow queries to avoid panics on cycles
2019-09-19 05:56:39 -04:00
Guanqun Lu
5eb6c6f0bd some random typo fixes 2019-08-23 00:54:29 +08:00
Markus Westerlind
360c78397b nits 2019-08-21 10:18:01 +02:00