forked from jasder/antlr
DFA cache on again; dropped from 25 to 16M!!!
This commit is contained in:
parent
8a301f59f8
commit
eda95f7478
|
@ -269,13 +269,12 @@ public class ATNConfigSet implements Set<ATNConfig> {
|
|||
*/
|
||||
protected boolean readonly = false;
|
||||
|
||||
/** Track every config we add */
|
||||
// public final LinkedHashMap<Key,ATNConfig> configToContext;
|
||||
/** All configs but hashed by (s, i, _, pi) not incl context */
|
||||
/** All configs but hashed by (s, i, _, pi) not incl context. Wiped out
|
||||
* when we go readonly as this set becomes a DFA state.
|
||||
*/
|
||||
public ConfigHashSet configLookup;
|
||||
|
||||
/** Track the elements as they are added to the set; supports get(i) */
|
||||
// too hard to keep in sync
|
||||
public final ArrayList<ATNConfig> configs = new ArrayList<ATNConfig>(7);
|
||||
|
||||
// TODO: these fields make me pretty uncomfortable but nice to pack up info together, saves recomputation
|
||||
|
|
|
@ -51,8 +51,8 @@ public abstract class ATNSimulator {
|
|||
* fill this during closure() since there are lots of contexts that
|
||||
* pop up but are not used ever again. It also greatly slows down closure().
|
||||
*/
|
||||
protected final PredictionContextCache sharedContextCache = null;
|
||||
//new PredictionContextCache("shared DFA state context cache");
|
||||
protected final PredictionContextCache sharedContextCache =
|
||||
new PredictionContextCache("shared DFA state context cache");
|
||||
|
||||
/** This context cache tracks all context graphs used during a single
|
||||
* ATN-based prediction operation. There will be significant context graph
|
||||
|
|
Loading…
Reference in New Issue