metaborg / nabl

Spoofax' Name Binding Language
Apache License 2.0
7 stars 12 forks source link

Reintroduce optimized name resolution when dataLeq is always true #41

Closed AZWN closed 3 years ago

AZWN commented 3 years ago

Introduced an optimization where shadowed subgraphs are not queried. In this version (in contrast to the commented version), DataLeq#alwaysTrue is asynchronous, because it relies on StatixSolver#entails, which is asynchronous as well.

Before merging, there is one point of consideration. The non-internal DataLeq instances can be shared between units. That might that imply that their alwaysTrue method can be invoked from different threads at the same time (is that actually the case???). If that is the case, we might accidentally create multiple alwaysTrue instances, while we intend to create one. I don't think it gives invalid results, but it would be good to synchronize in such situations.