aa
com.cliffc.aa.tvar.TV2 Class Reference
Collaboration diagram for com.cliffc.aa.tvar.TV2:
[legend]

Classes

class  ACnts
 

Public Member Functions

void args_put (Comparable key, TV2 tv)
 
boolean eq (Node[] args)
 
final boolean eq (TV2 that)
 
TV2 find ()
 
final int find_dups (VBitSet bs, NonBlockingHashMapLong< String > dups, int scnt)
 
Type find_tvar (Type t, TV2 tv)
 
void free ()
 
boolean fresh_unify (TV2 that, TV2[] vs, boolean test)
 
TV2 get (Comparable key)
 
TV2 get_unified ()
 
boolean is_base ()
 
boolean is_dead ()
 
boolean is_err ()
 
boolean is_free ()
 
boolean is_leaf ()
 
boolean is_nil ()
 
boolean is_tvar ()
 
boolean is_unified ()
 
boolean isa (String s)
 
String name ()
 
TV2 push_dep (CallEpiNode dep)
 
TV2 repl_rename (TV2[]vs, HashMap< Node, Node > map)
 
void reset (Node n)
 
void reset_at (Object o)
 
final String str (int d)
 
final SB str (SB sb, VBitSet bs, NonBlockingHashMapLong< String > dups, boolean debug, int d, int max)
 
final String toString ()
 
boolean unify (TV2 that, boolean test)
 
boolean unify_alias (BitsAlias aliases, TV2 mem, boolean test)
 
boolean unify_alias_fld (Node ldst, BitsAlias aliases, String fld, TV2 tv, boolean test, String alloc_site)
 
boolean unify_at (Comparable key, TV2 tv2, boolean test)
 
boolean union (TV2 that)
 

Static Public Member Functions

static TV2 get (TV2[] vs, int i)
 
static TV2 make (@NotNull String name, Node n, @NotNull String alloc_site)
 
static TV2 make (@NotNull String name, Node n, @NotNull String alloc_site, Node... ntvs)
 
static TV2 make (@NotNull String name, Node n, @NotNull String alloc_site, NonBlockingHashMap< Comparable, TV2 > args)
 
static TV2 make (@NotNull String name, UQNodes ns, @NotNull String alloc_site)
 
static TV2 make_base (Node n, Type type, @NotNull String alloc_site)
 
static TV2 make_err (Node n, String msg, @NotNull String alloc_site)
 
static TV2 make_leaf (Node n, @NotNull String alloc_site)
 
static TV2 make_leaf_ns (UQNodes ns, @NotNull String alloc_site)
 
static TV2 make_mem (Node n, @NotNull String alloc_site)
 
static void reset_to_init0 ()
 

Public Attributes

String _alloc_site
 
NonBlockingHashMap< Comparable, TV2_args
 
UQNodes _deps
 
UQNodes _ns
 
Type _type
 
final int _uid
 

Static Public Attributes

static TV2 DEAD = new TV2("Dead",null,null,null,"static")
 
static TV2 NIL = new TV2("Nil" ,null,null,null,"static")
 

Package Functions

boolean _cycle_equals (TV2 that)
 
boolean _occurs_in (TV2[] vs)
 
boolean _occurs_in_type (TV2 x)
 
boolean cycle_equals (TV2 that)
 
boolean is_prim ()
 
boolean occurs_in (TV2[] vs)
 

Static Package Attributes

static final VBitSet DEPS_VISIT = new VBitSet()
 

Private Member Functions

 TV2 (@NotNull String name, NonBlockingHashMap< Comparable, TV2 > args, Type type, UQNodes ns, @NotNull String alloc_site)
 
boolean _eq (TV2 that)
 
Type _find_tvar (Type t, TV2 tv, Type rez)
 
boolean _fresh_unify (TV2 that, TV2[] vs, boolean test)
 
void _push_update (CallEpiNode dep)
 
void _rename (TV2 tv, HashMap< Node, Node > map)
 
boolean _unify (TV2 that, boolean test)
 
TV2 _union (TV2 that)
 
boolean fresh_base (TV2 that, boolean test)
 
void merge_deps (TV2 that)
 
void merge_ns (TV2 that)
 
TV2 repl (TV2[] vs)
 
boolean unify_base (TV2 that)
 
boolean union_err (TV2 that, String msg)
 
TV2 vput (TV2 that)
 
boolean vput (TV2 that, boolean progress)
 

Private Attributes

String _name
 
TV2 _unified
 

Static Private Attributes

static final HashMap< String, ACntsALLOCS = new HashMap<>()
 
static final HashMap< TV2, TV2CDUPS = new HashMap<>()
 
static final NonBlockingHashMapLong< TV2DUPS = new NonBlockingHashMapLong<>()
 
static final VBitSet ODUPS = new VBitSet()
 
static int UID =1
 
static final HashMap< TV2, TV2VARS = new HashMap<>()
 

Detailed Description

Definition at line 23 of file TV2.java.

Constructor & Destructor Documentation

◆ TV2()

com.cliffc.aa.tvar.TV2.TV2 ( @NotNull String  name,
NonBlockingHashMap< Comparable, TV2 args,
Type  type,
UQNodes  ns,
@NotNull String  alloc_site 
)
private

Definition at line 63 of file TV2.java.

63  {
64  _uid = UID++;
65  _name = name;
66  _args = args;
67  _type = type;
68  _deps = null; // Lazy added
69  _ns = ns;
70  _alloc_site = alloc_site;
71  ACnts ac = ALLOCS.computeIfAbsent(alloc_site,e -> new ACnts());
72  ac._malloc++;
73  }

References com.cliffc.aa.tvar.TV2._alloc_site, com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.tvar.TV2.ACnts._malloc, com.cliffc.aa.tvar.TV2._name, com.cliffc.aa.tvar.TV2._ns, com.cliffc.aa.tvar.TV2._type, com.cliffc.aa.tvar.TV2._uid, com.cliffc.aa.tvar.TV2.ALLOCS, com.cliffc.aa.tvar.TV2.name(), and com.cliffc.aa.tvar.TV2.UID.

Referenced by com.cliffc.aa.tvar.TV2.make(), com.cliffc.aa.tvar.TV2.make_base(), com.cliffc.aa.tvar.TV2.make_err(), com.cliffc.aa.tvar.TV2.make_leaf_ns(), and com.cliffc.aa.tvar.TV2.repl().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ _cycle_equals()

boolean com.cliffc.aa.tvar.TV2._cycle_equals ( TV2  that)
package

Definition at line 646 of file TV2.java.

646  {
647  assert !is_unified() && !that.is_unified();
648  if( this==that ) return true;
649  if( is_base() && that.is_base() )
650  return _type==that._type; // Base-cases have to be completely identical
651  if( !Util.eq(_name,that._name) ) return false; // Wrong type-var names
652  if( is_leaf() || that.is_leaf() ) return false; // Unequal leaves are unequal
653  if( _args==that._args && !is_leaf() ) return true; // Both null is OK
654  if( _args.size() != that._args.size() ) return false; // Mismatched sizes
655  // Cycles stall the equal/unequal decision until we see a difference.
656  TV2 tc = CDUPS.get(this);
657  if( tc!=null )
658  return tc==that; // Cycle check; true if both cycling the same
659  CDUPS.put(this,that);
660  for( Comparable key : _args.keySet() ) {
661  TV2 lhs = get(key); assert lhs!=null;
662  TV2 rhs = that.get(key);
663  if( rhs==null || !lhs._cycle_equals(rhs) ) return false;
664  }
665  return true;
666  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._cycle_equals(), com.cliffc.aa.tvar.TV2._name, com.cliffc.aa.tvar.TV2._type, com.cliffc.aa.tvar.TV2.CDUPS, com.cliffc.aa.util.Util.eq(), com.cliffc.aa.tvar.TV2.get(), com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_leaf(), and com.cliffc.aa.tvar.TV2.is_unified().

Referenced by com.cliffc.aa.tvar.TV2._cycle_equals(), and com.cliffc.aa.tvar.TV2.cycle_equals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _eq()

boolean com.cliffc.aa.tvar.TV2._eq ( TV2  that)
private

Definition at line 207 of file TV2.java.

207  {
208  if( this==that ) return true;
209  assert !is_unified() && !that.is_unified();
210  if( !Util.eq(_name,that._name) ) return false;
211  if( is_base() ) return _type==that._type; // Base types are equal if base _types are equal
212  if( is_leaf() ) { // Leafs are equal if they always map the same
213  TV2 eq2 = VARS.computeIfAbsent(this,k -> that);
214  return that==eq2;
215  }
216 
217  if( _args.size() != that._args.size() ) return false;
218  // Cyclic check
219  long luid = ((long)_uid<<32)|that._uid; // Make a unique id for the pair
220  if( DUPS.get(luid)!=null ) return true; // Cyclic, wrapped. Something else determines eq/ne
221  DUPS.put(luid,this); // Mark for cycle
222 
223  // Structural recursion
224  for( Comparable key : _args.keySet() )
225  if( !get(key)._eq(that.get(key)) )
226  return false;
227  return true;
228  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._name, com.cliffc.aa.tvar.TV2._type, com.cliffc.aa.tvar.TV2._uid, com.cliffc.aa.tvar.TV2.DUPS, com.cliffc.aa.util.Util.eq(), com.cliffc.aa.tvar.TV2.get(), com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_leaf(), com.cliffc.aa.tvar.TV2.is_unified(), and com.cliffc.aa.tvar.TV2.VARS.

Referenced by com.cliffc.aa.tvar.TV2.eq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _find_tvar()

Type com.cliffc.aa.tvar.TV2._find_tvar ( Type  t,
TV2  tv,
Type  rez 
)
private

Definition at line 541 of file TV2.java.

541  {
542  if( tv.is_dead() ) return rez;
543  if( t==Type.ALL ) return rez; // Join against 'ALL' never changes anything
544  if( tv==this ) {
545  rez = rez.join(t);
546  return rez;
547  }
548  switch(_name) {
549  case "Mem":
550  if( t ==Type.ANY ) return rez; // No substructure in type
551  TypeMem tmem = (TypeMem)t;
552  for( Comparable key : _args.keySet() ) {
553  TypeObj to = tmem.at((Integer) key);
554  TV2 obj = get(key);
555  if( obj!=null )
556  rez = obj._find_tvar(to,tv,rez);
557  }
558  return rez;
559  case "Obj":
560  if( t==TypeObj.UNUSED || t==TypeObj.ISUSED )
561  return rez; // No substructure in type
562  if( t instanceof TypeStr || t instanceof TypeAry )
563  return rez; // TODO: Handle These
564  TypeStruct ts = (TypeStruct)t; //
565  for( Comparable key : _args.keySet() ) {
566  //int idx = ts.find((String)key);
567  //if( idx!= -1 ) // If field exists
568  // rez = get(key)._find_tvar(ts.at(idx),tv,rez);
569  throw unimpl();
570  }
571  return rez;
572  case "Fun":
573  if( t.is_forward_ref() ) return rez;
574  if( !(t instanceof TypeFunPtr) ) return rez;
575  // TypeFunPtrs carry only a set of FIDXS & a DISPLAY.
576  // Hence no other Type is available here for lifting.
577  return rez;
578  case "Ret":
579  TypeTuple tt = (TypeTuple)t;
580  for( int i=0; i<tt.len(); i++ )
581  rez = get(i)._find_tvar(tt.at(i),tv,rez);
582  return rez;
583  case "Ptr":
584  if( !(t instanceof TypeMemPtr) ) return rez;
585  return get(0)._find_tvar(((TypeMemPtr)t)._obj,tv,rez);
586  case "Base":
587  case "Dead":
588  case "Err":
589  case "Leaf":
590  case "Nil":
591  return rez; // No substructure in TV2 and not equal already
592 
593  default: throw com.cliffc.aa.AA.unimpl();
594  }
595  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._find_tvar(), com.cliffc.aa.tvar.TV2._name, com.cliffc.aa.type.Type< T extends Type< T >.ALL, com.cliffc.aa.type.Type< T extends Type< T >.ANY, com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.TypeTuple.at(), com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.type.Type< T extends Type< T >.is_forward_ref(), com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.ISUSED, com.cliffc.aa.type.Type< T extends Type< T >.join(), com.cliffc.aa.type.TypeTuple.len(), com.cliffc.aa.AA.unimpl(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED.

Referenced by com.cliffc.aa.tvar.TV2._find_tvar(), and com.cliffc.aa.tvar.TV2.find_tvar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _fresh_unify()

boolean com.cliffc.aa.tvar.TV2._fresh_unify ( TV2  that,
TV2[]  vs,
boolean  test 
)
private

Definition at line 384 of file TV2.java.

384  {
385  assert !is_unified() && !that.is_unified();
386 
387  // Several trivial cases that do not really do any work
388  if( this==that ) return false;
389  if( that.is_dead() ) return false;
390  if( this.is_dead() ) return that.union(this); // Kill 'that', same as LHS
391  if( this.is_nil() || that.is_nil() ) return false;
392 
393  // Check for closing cycles
394  TV2 prior = VARS.get(this);
395  if( prior!=null ) // Been there, done that? Return prior mapping
396  return prior.find()._unify(that, test);
397  if( cycle_equals(that) ) return vput(that,false);
398 
399  if( that.is_err() ) return vput(that,false); // That is an error, ignore 'this' and no progress
400  if( this.is_err() ) return vput(that,_unify(that,test));
401 
402  // Famous 'occurs-check', switch to normal unify
403  if( occurs_in( vs ) ) return vput(that,_unify(that,test));
404  // Either side is a Leaf, unify to the other (perhaps with a fresh copy)
405  if( this.is_leaf() ) return vput(that,false); // Lazy map LHS tvar to RHS
406  if( that.is_leaf() ) // RHS is a leaf tvar; union with a copy of LHS
407  return test || vput(that,that.union(repl(vs)));
408  // Bases MEET cons in RHS
409  if( is_base() && that.is_base() ) return vput(that,fresh_base(that,test));
410 
411  // Should be structurally equal now
412  if( !Util.eq(_name,that._name) )
413  throw com.cliffc.aa.AA.unimpl(); // unification error
414 
415  // Structural recursion unification, lazy on LHS
416  boolean progress = vput(that,false); // Early set, to stop cycles
417  for( Comparable key : _args.keySet() ) {
418  TV2 lhs = get(key); assert lhs!=null;
419  TV2 rhs = that.get(key);
420  if( rhs==null ) { // No RHS to unify against
421  if( !test ) { // RHS is a fresh copy of the LHS
422  that.args_put(key,lhs.repl(vs));
423  Env.GVN.add_flow(that._deps); // Re-CallEpi
424  }
425  progress = true;
426  } else {
427  progress |= lhs._fresh_unify(rhs,vs,test);
428  }
429  if( progress && test ) return true;
430  }
431  return progress;
432  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._name, com.cliffc.aa.tvar.TV2._unify(), com.cliffc.aa.GVNGCM.add_flow(), com.cliffc.aa.tvar.TV2.args_put(), com.cliffc.aa.tvar.TV2.cycle_equals(), com.cliffc.aa.util.Util.eq(), com.cliffc.aa.tvar.TV2.find(), com.cliffc.aa.tvar.TV2.fresh_base(), com.cliffc.aa.tvar.TV2.get(), com.cliffc.aa.Env.GVN, com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.tvar.TV2.is_err(), com.cliffc.aa.tvar.TV2.is_leaf(), com.cliffc.aa.tvar.TV2.is_nil(), com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.tvar.TV2.occurs_in(), com.cliffc.aa.tvar.TV2.repl(), com.cliffc.aa.AA.unimpl(), com.cliffc.aa.tvar.TV2.union(), com.cliffc.aa.tvar.TV2.VARS, and com.cliffc.aa.tvar.TV2.vput().

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _occurs_in()

boolean com.cliffc.aa.tvar.TV2._occurs_in ( TV2[]  vs)
package

Definition at line 611 of file TV2.java.

611  {
612  // Can NOT modify 'vs' for U-F, because blows FreshNode hash.
613  for( TV2 v : vs )
614  if( _occurs_in_type(v.find()) )
615  return true;
616  return false;
617  }

References com.cliffc.aa.tvar.TV2._occurs_in_type().

Referenced by com.cliffc.aa.tvar.TV2.occurs_in().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _occurs_in_type()

boolean com.cliffc.aa.tvar.TV2._occurs_in_type ( TV2  x)
package

Definition at line 619 of file TV2.java.

619  {
620  assert !is_unified() && !x.is_unified();
621  if( x==this ) return true;
622  if( ODUPS.tset(x._uid) ) return false; // Been there, done that
623  if( !x.is_leaf() && x._args!=null )
624  for( Comparable key : x._args.keySet() )
625  if( _occurs_in_type(x.get(key)) )
626  return true;
627  return false;
628  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._uid, com.cliffc.aa.tvar.TV2.get(), com.cliffc.aa.tvar.TV2.is_leaf(), com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.tvar.TV2.ODUPS, and com.cliffc.aa.util.VBitSet.tset().

Referenced by com.cliffc.aa.tvar.TV2._occurs_in().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _push_update()

void com.cliffc.aa.tvar.TV2._push_update ( CallEpiNode  dep)
private

Definition at line 680 of file TV2.java.

680  {
681  assert !is_unified();
682  if( DEPS_VISIT.tset(_uid) ) return;
683  if( _deps!=null && _deps.get(dep._uid)!=null ) return; // Already here and in all children
684  if( isa("Dead") ) return;
685  _deps = _deps==null ? UQNodes.make(dep) : _deps.add(dep);
686  if( _args!=null )
687  for( Comparable key : _args.keySet() ) // Structural recursion on a complex TV2
688  get(key)._push_update(dep);
689  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.tvar.TV2._uid, com.cliffc.aa.node.Node._uid, com.cliffc.aa.tvar.UQNodes.add(), com.cliffc.aa.tvar.TV2.DEPS_VISIT, com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.get(), com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.tvar.TV2.isa(), com.cliffc.aa.tvar.UQNodes.make(), and com.cliffc.aa.util.VBitSet.tset().

Referenced by com.cliffc.aa.tvar.TV2.push_dep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _rename()

void com.cliffc.aa.tvar.TV2._rename ( TV2  tv,
HashMap< Node, Node map 
)
private

Definition at line 468 of file TV2.java.

468  {
469  if( DUPS.get(_uid) != null ) return; // Been there, remapped this
470  DUPS.put(_uid,this); // Only remap once
471  if( this==tv ) return; // Using the same TVar
472  assert tv._ns==null && tv._deps==null;
473  tv._deps= _deps==null ? null : _deps.rename(map);
474  tv._ns = _ns ==null ? null : _ns .rename(map);
475  if( _args != null )
476  for( Comparable key : _args.keySet() )
477  _args.get(key)._rename(tv.get(key),map);
478  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.tvar.TV2._ns, com.cliffc.aa.tvar.TV2._uid, com.cliffc.aa.tvar.TV2.DUPS, com.cliffc.aa.tvar.TV2.get(), and com.cliffc.aa.tvar.UQNodes.rename().

Referenced by com.cliffc.aa.tvar.TV2.repl_rename().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _unify()

boolean com.cliffc.aa.tvar.TV2._unify ( TV2  that,
boolean  test 
)
private

Definition at line 300 of file TV2.java.

300  {
301  assert !is_unified() && !that.is_unified();
302  if( this==that ) return false;
303 
304  // Check for simple, non-recursive, unification.
305  // NIL always loses and makes no progress (no structure implications)
306  if( this.is_nil () ) return false;
307  if( that.is_nil () ) return false;
308  // All remaining paths make progress and return true.
309  if( test ) return true;
310  // Dead wins all
311  if( this.is_dead() ) return that.union(this);
312  if( that.is_dead() ) return this.union(that);
313  // two errs union in either order, so keep lower uid (actually should merge error strings)
314  if( is_err() && that.is_err() && _uid<that._uid ) return that.union(this);
315  if( is_err() ) return that.union(this);
316  if( that.is_err() ) return union(that);
317  // Two leafs union in either order, so keep lower uid
318  if( this.is_leaf() && that.is_leaf() && _uid < that._uid ) return that.union(this);
319  if( this.is_leaf() ) return this.union(that);
320  if( that.is_leaf() ) return that.union(this);
321  // Bases unify constants also
322  if( this.is_base() && that.is_base() ) return unify_base(that);
323 
324  // Cycle check.
325  long luid = ((long)_uid<<32)|that._uid; // Make a unique id for the pair
326  TV2 rez = DUPS.get(luid);
327  if( rez!=null ) return false; // Been there, done that
328  DUPS.put(luid,that); // Close cycles
329 
330  // Errors
331  if( !Util.eq(_name,that._name) )
332  return union_err(that,"Cannot unify "+this+" and "+that);
333  assert _args!=that._args; // Efficiency hack elsewhere if this is true here
334 
335 
336  // Structural recursion unification, this into that.
337  for( Comparable key : _args.keySet() ) {
338  TV2 vthis = get(key); assert vthis!=null;
339  TV2 vthat = that.get(key);
340  if( vthat==null ) that.args_put(key,vthis);
341  else { vthis._unify(vthat,test); that = that.find(); }
342  assert !that.is_unified();
343  }
344 
345  // TODO: Check for being equal, cyclic-ly, and return a prior if possible.
346  return find().union(that);
347  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._name, com.cliffc.aa.tvar.TV2._uid, com.cliffc.aa.tvar.TV2._unify(), com.cliffc.aa.tvar.TV2.args_put(), com.cliffc.aa.tvar.TV2.DUPS, com.cliffc.aa.util.Util.eq(), com.cliffc.aa.tvar.TV2.find(), com.cliffc.aa.tvar.TV2.get(), com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.tvar.TV2.is_err(), com.cliffc.aa.tvar.TV2.is_leaf(), com.cliffc.aa.tvar.TV2.is_nil(), com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.tvar.TV2.unify_base(), com.cliffc.aa.tvar.TV2.union(), and com.cliffc.aa.tvar.TV2.union_err().

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify(), and com.cliffc.aa.tvar.TV2._unify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _union()

TV2 com.cliffc.aa.tvar.TV2._union ( TV2  that)
private

Definition at line 270 of file TV2.java.

270  {
271  TV2 old = _unified;
272  _unified=that;
273  assert is_unified();
274  merge_deps(that); // Merge update lists, for future unions
275  merge_ns (that); // Merge Node list, for easier debugging
276  _deps = null;
277  _ns = null;
278  return old;
279  }

References com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.tvar.TV2._ns, com.cliffc.aa.tvar.TV2._unified, com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.tvar.TV2.merge_deps(), and com.cliffc.aa.tvar.TV2.merge_ns().

Referenced by com.cliffc.aa.tvar.TV2.find(), and com.cliffc.aa.tvar.TV2.union().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ args_put()

void com.cliffc.aa.tvar.TV2.args_put ( Comparable  key,
TV2  tv 
)

Definition at line 99 of file TV2.java.

99  {
100  _args.put(key,tv); // Pick up a key->tv mapping
101  merge_deps(tv); // tv gets all deps that 'this' has
102  }

References com.cliffc.aa.tvar.TV2._args, and com.cliffc.aa.tvar.TV2.merge_deps().

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._unify(), com.cliffc.aa.tvar.TV2.get(), com.cliffc.aa.tvar.TV2.repl(), com.cliffc.aa.node.LoadNode.unify(), com.cliffc.aa.tvar.TV2.unify_alias_fld(), and com.cliffc.aa.tvar.TV2.unify_at().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cycle_equals()

boolean com.cliffc.aa.tvar.TV2.cycle_equals ( TV2  that)
package

Definition at line 640 of file TV2.java.

640  {
641  assert CDUPS.isEmpty();
642  boolean rez = _cycle_equals(that);
643  CDUPS.clear();
644  return rez;
645  }

References com.cliffc.aa.tvar.TV2._cycle_equals(), and com.cliffc.aa.tvar.TV2.CDUPS.

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ eq() [1/2]

boolean com.cliffc.aa.tvar.TV2.eq ( Node[]  args)

Definition at line 231 of file TV2.java.

231  {
232  for( int i=0; i<args.length; i++ )
233  if( args[i]!=null && args[i].tvar()!=get(i) )
234  return false;
235  return true;
236  }

◆ eq() [2/2]

final boolean com.cliffc.aa.tvar.TV2.eq ( TV2  that)

Definition at line 200 of file TV2.java.

200  {
201  if( that==null ) return false;
202  assert VARS.isEmpty() && DUPS.isEmpty();
203  boolean eq = _eq(that);
204  VARS.clear(); DUPS.clear();
205  return eq;
206  }

References com.cliffc.aa.tvar.TV2._eq(), com.cliffc.aa.tvar.TV2.DUPS, and com.cliffc.aa.tvar.TV2.VARS.

Here is the call graph for this function:

◆ find()

TV2 com.cliffc.aa.tvar.TV2.find ( )

Definition at line 240 of file TV2.java.

240  {
241  if( !is_unified() ) return this;
242  TV2 top = get_unified();
243  if( !top.is_unified() ) return top;
244  // Find U-F top
245  int cnt=0;
246  while( top.is_unified() && cnt++<100 ) top = top.get_unified();
247  assert cnt<100; // Infinite roll-up loop
248  TV2 v = this; // Rerun, rolling up to top
249  while( v != top ) v = v._union(top);
250  return top;
251  }

References com.cliffc.aa.tvar.TV2._union(), com.cliffc.aa.tvar.TV2.get_unified(), and com.cliffc.aa.tvar.TV2.is_unified().

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._unify(), com.cliffc.aa.tvar.TV2.get(), com.cliffc.aa.node.Node.tvar(), com.cliffc.aa.node.LoadNode.unify(), and com.cliffc.aa.tvar.TV2.unify_alias_fld().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_dups()

final int com.cliffc.aa.tvar.TV2.find_dups ( VBitSet  bs,
NonBlockingHashMapLong< String >  dups,
int  scnt 
)

Definition at line 720 of file TV2.java.

720  {
721  if( bs.tset(_uid) ) {
722  if( is_dead() || is_nil() ) return scnt;
723  if( dups.containsKey(_uid) ) return scnt; // Already has a dup name
724  dups.put(_uid,new String(new char[]{(char)('A'+scnt)}));
725  return scnt+1;
726  }
727  if( is_unified() )
728  return get_unified().find_dups(bs,dups,scnt);
729  if( _args!=null )
730  for( TV2 tv : _args.values() )
731  if( !is_prim() )
732  scnt = tv.find_dups(bs,dups,scnt);
733  return scnt;
734  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._uid, com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.containsKey(), com.cliffc.aa.tvar.TV2.find_dups(), com.cliffc.aa.tvar.TV2.get_unified(), com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.tvar.TV2.is_nil(), com.cliffc.aa.tvar.TV2.is_prim(), com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.put(), and com.cliffc.aa.util.VBitSet.tset().

Referenced by com.cliffc.aa.tvar.TV2.find_dups(), com.cliffc.aa.tvar.TV2.str(), com.cliffc.aa.Env.VStack.toString(), and com.cliffc.aa.tvar.TV2.toString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_tvar()

Type com.cliffc.aa.tvar.TV2.find_tvar ( Type  t,
TV2  tv 
)

Definition at line 535 of file TV2.java.

535  {
536  assert DUPS.isEmpty();
537  Type rez = _find_tvar(t,tv,Type.ALL);
538  DUPS.clear();
539  return rez;
540  }

References com.cliffc.aa.tvar.TV2._find_tvar(), com.cliffc.aa.type.Type< T extends Type< T >.ALL, and com.cliffc.aa.tvar.TV2.DUPS.

Here is the call graph for this function:

◆ free()

void com.cliffc.aa.tvar.TV2.free ( )

Definition at line 189 of file TV2.java.

189  {
190  if( !is_unified() ) ALLOCS.get(_alloc_site)._free++;
191  _name = "Free";
192  _args = null;
193  _type = null;
194  _deps = null;
195  _ns = null;
196  }

References com.cliffc.aa.tvar.TV2._alloc_site, com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.tvar.TV2._name, com.cliffc.aa.tvar.TV2._ns, com.cliffc.aa.tvar.TV2._type, com.cliffc.aa.tvar.TV2.ALLOCS, and com.cliffc.aa.tvar.TV2.is_unified().

Here is the call graph for this function:

◆ fresh_base()

boolean com.cliffc.aa.tvar.TV2.fresh_base ( TV2  that,
boolean  test 
)
private

Definition at line 357 of file TV2.java.

357  {
358  Type con = _type.meet(that._type);
359  if( con==that._type ) return false; // No progress
360  if( !test ) that._type = con; // Yes progress, but no update if testing
361  return true;
362  }

References com.cliffc.aa.tvar.TV2._type, and com.cliffc.aa.type.Type< T extends Type< T >.meet().

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fresh_unify()

boolean com.cliffc.aa.tvar.TV2.fresh_unify ( TV2  that,
TV2[]  vs,
boolean  test 
)

Definition at line 374 of file TV2.java.

374  {
375  //assert VARS.isEmpty() && DUPS.isEmpty();
376  //boolean progress = _fresh_unify(that,vs,test);
377  //VARS.clear(); DUPS.clear();
378  //return progress;
379  throw unimpl();
380  }

Referenced by com.cliffc.aa.node.FreshNode.unify().

Here is the caller graph for this function:

◆ get() [1/2]

TV2 com.cliffc.aa.tvar.TV2.get ( Comparable  key)

Definition at line 89 of file TV2.java.

89  {
90  if( _args==null ) return null;
91  TV2 tv = _args.get(key);
92  if( tv==null ) return null;
93  TV2 tv2 = tv.find();
94  if( tv!=tv2 ) args_put(key,tv2);
95  return tv2;
96  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2.args_put(), and com.cliffc.aa.tvar.TV2.find().

Referenced by com.cliffc.aa.tvar.TV2._cycle_equals(), com.cliffc.aa.tvar.TV2._eq(), com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._occurs_in_type(), com.cliffc.aa.tvar.TV2._rename(), com.cliffc.aa.tvar.TV2._unify(), and com.cliffc.aa.tvar.TV2.unify_alias().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [2/2]

static TV2 com.cliffc.aa.tvar.TV2.get ( TV2[]  vs,
int  i 
)
static

Definition at line 631 of file TV2.java.

631  {
632  TV2 tv = vs[i].find();
633  return vs[i]==tv ? tv : (vs[i]=tv); // U-F rollup
634  }

References com.cliffc.aa.tvar.TV2.find().

Here is the call graph for this function:

◆ get_unified()

TV2 com.cliffc.aa.tvar.TV2.get_unified ( )

Definition at line 85 of file TV2.java.

85 { assert is_unified(); return _unified; }

References com.cliffc.aa.tvar.TV2._unified, and com.cliffc.aa.tvar.TV2.is_unified().

Referenced by com.cliffc.aa.tvar.TV2.find(), and com.cliffc.aa.tvar.TV2.find_dups().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_base()

boolean com.cliffc.aa.tvar.TV2.is_base ( )

Definition at line 79 of file TV2.java.

79 { return !is_unified() && isa("Base" ); }

References com.cliffc.aa.tvar.TV2.is_unified(), and com.cliffc.aa.tvar.TV2.isa().

Referenced by com.cliffc.aa.tvar.TV2._cycle_equals(), com.cliffc.aa.tvar.TV2._eq(), com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._unify(), com.cliffc.aa.tvar.TV2.make(), com.cliffc.aa.tvar.TV2.make_base(), com.cliffc.aa.tvar.TV2.make_err(), com.cliffc.aa.tvar.TV2.make_leaf_ns(), com.cliffc.aa.tvar.TV2.repl(), com.cliffc.aa.tvar.TV2.str(), and com.cliffc.aa.node.ProjNode.unify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_dead()

boolean com.cliffc.aa.tvar.TV2.is_dead ( )

Definition at line 81 of file TV2.java.

81 { return !is_unified() && isa("Dead" ); }

References com.cliffc.aa.tvar.TV2.is_unified(), and com.cliffc.aa.tvar.TV2.isa().

Referenced by com.cliffc.aa.tvar.TV2._find_tvar(), com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._unify(), com.cliffc.aa.tvar.TV2.find_dups(), com.cliffc.aa.tvar.TV2.repl(), com.cliffc.aa.tvar.TV2.reset_at(), com.cliffc.aa.tvar.TV2.str(), com.cliffc.aa.node.NewStrNode.unify(), com.cliffc.aa.tvar.TV2.unify_alias(), com.cliffc.aa.tvar.TV2.unify_alias_fld(), com.cliffc.aa.tvar.TV2.unify_at(), and com.cliffc.aa.tvar.TV2.union().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_err()

boolean com.cliffc.aa.tvar.TV2.is_err ( )

Definition at line 83 of file TV2.java.

83 { return !is_unified() && isa("Err" ); }

References com.cliffc.aa.tvar.TV2.is_unified(), and com.cliffc.aa.tvar.TV2.isa().

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._unify(), com.cliffc.aa.tvar.TV2.make_err(), and com.cliffc.aa.tvar.TV2.str().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_free()

boolean com.cliffc.aa.tvar.TV2.is_free ( )

Definition at line 82 of file TV2.java.

82 { return !is_unified() && isa("Free" ); }

References com.cliffc.aa.tvar.TV2.is_unified(), and com.cliffc.aa.tvar.TV2.isa().

Here is the call graph for this function:

◆ is_leaf()

boolean com.cliffc.aa.tvar.TV2.is_leaf ( )

Definition at line 78 of file TV2.java.

78 { return !is_unified() && isa("Leaf" ); }

References com.cliffc.aa.tvar.TV2.is_unified(), and com.cliffc.aa.tvar.TV2.isa().

Referenced by com.cliffc.aa.tvar.TV2._cycle_equals(), com.cliffc.aa.tvar.TV2._eq(), com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._occurs_in_type(), com.cliffc.aa.tvar.TV2._unify(), com.cliffc.aa.tvar.TV2.make(), com.cliffc.aa.tvar.TV2.make_base(), com.cliffc.aa.tvar.TV2.make_err(), com.cliffc.aa.tvar.TV2.make_leaf_ns(), and com.cliffc.aa.tvar.TV2.repl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_nil()

boolean com.cliffc.aa.tvar.TV2.is_nil ( )

Definition at line 80 of file TV2.java.

80 { return !is_unified() && isa("Nil" ); }

References com.cliffc.aa.tvar.TV2.is_unified(), and com.cliffc.aa.tvar.TV2.isa().

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._unify(), com.cliffc.aa.tvar.TV2.find_dups(), and com.cliffc.aa.tvar.TV2.str().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_prim()

boolean com.cliffc.aa.tvar.TV2.is_prim ( )
package

Definition at line 714 of file TV2.java.

714  {
715  return isa("Obj") && _args!=null && _args.containsKey("!");
716  }

References com.cliffc.aa.tvar.TV2._args, and com.cliffc.aa.tvar.TV2.isa().

Referenced by com.cliffc.aa.tvar.TV2.find_dups(), and com.cliffc.aa.tvar.TV2.str().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_tvar()

boolean com.cliffc.aa.tvar.TV2.is_tvar ( )

Definition at line 84 of file TV2.java.

84 { return !is_unified() && _args!=null; } // Excludes unified,base,dead,nil,free

References com.cliffc.aa.tvar.TV2._args, and com.cliffc.aa.tvar.TV2.is_unified().

Referenced by com.cliffc.aa.tvar.TV2.unify_at().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_unified()

◆ isa()

boolean com.cliffc.aa.tvar.TV2.isa ( String  s)

◆ make() [1/4]

static TV2 com.cliffc.aa.tvar.TV2.make ( @NotNull String  name,
Node  n,
@NotNull String  alloc_site 
)
static

Definition at line 154 of file TV2.java.

154 { return make(name,n,alloc_site,new NonBlockingHashMap<>()); }

References com.cliffc.aa.tvar.TV2.make(), and com.cliffc.aa.tvar.TV2.name().

Referenced by com.cliffc.aa.tvar.TV2.make(), com.cliffc.aa.tvar.TV2.make_base(), com.cliffc.aa.tvar.TV2.make_mem(), com.cliffc.aa.node.ProjNode.unify(), com.cliffc.aa.node.MemSplitNode.unify(), com.cliffc.aa.node.LoadNode.unify(), and com.cliffc.aa.tvar.TV2.unify_alias_fld().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make() [2/4]

static TV2 com.cliffc.aa.tvar.TV2.make ( @NotNull String  name,
Node  n,
@NotNull String  alloc_site,
Node...  ntvs 
)
static

Definition at line 163 of file TV2.java.

163  {
164  assert ntvs!=null; // Must have some structure
166  for( int i=0; i<ntvs.length; i++ )
167  if( ntvs[i]!=null )
168  args.put(i,ntvs[i].tvar());
169  return make(name,n,alloc_site,args);
170  }

References com.cliffc.aa.tvar.TV2.make(), com.cliffc.aa.tvar.TV2.name(), and com.cliffc.aa.util.NonBlockingHashMap< TypeK, TypeV >.put().

Here is the call graph for this function:

◆ make() [3/4]

static TV2 com.cliffc.aa.tvar.TV2.make ( @NotNull String  name,
Node  n,
@NotNull String  alloc_site,
NonBlockingHashMap< Comparable, TV2 args 
)
static

Definition at line 156 of file TV2.java.

156  {
157  assert args!=null; // Must have some structure
158  TV2 tv2 = new TV2(name,args,null,UQNodes.make(n),alloc_site);
159  assert !tv2.is_base() && !tv2.is_leaf();
160  return tv2;
161  }

References com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_leaf(), com.cliffc.aa.tvar.UQNodes.make(), com.cliffc.aa.tvar.TV2.name(), and com.cliffc.aa.tvar.TV2.TV2().

Here is the call graph for this function:

◆ make() [4/4]

static TV2 com.cliffc.aa.tvar.TV2.make ( @NotNull String  name,
UQNodes  ns,
@NotNull String  alloc_site 
)
static

Definition at line 171 of file TV2.java.

171  {
172  TV2 tv2 = new TV2(name, new NonBlockingHashMap<>(),null,ns,alloc_site);
173  assert !tv2.is_base() && !tv2.is_leaf();
174  return tv2;
175  }

References com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_leaf(), com.cliffc.aa.tvar.TV2.name(), and com.cliffc.aa.tvar.TV2.TV2().

Here is the call graph for this function:

◆ make_base()

static TV2 com.cliffc.aa.tvar.TV2.make_base ( Node  n,
Type  type,
@NotNull String  alloc_site 
)
static

Definition at line 136 of file TV2.java.

136  {
137  if( type instanceof TypeObj ) { // Constant object?
138  return make("Obj",n,alloc_site); // Empty object constant
139  }
140  UQNodes ns = n==null ? null : UQNodes.make(n);
141  type = type.widen();
142  TV2 tv2 = new TV2("Base",null,type,ns,alloc_site);
143  assert tv2.is_base() && !tv2.is_leaf();
144  return tv2;
145  }

References com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_leaf(), com.cliffc.aa.tvar.UQNodes.make(), com.cliffc.aa.tvar.TV2.make(), com.cliffc.aa.tvar.TV2.TV2(), and com.cliffc.aa.type.Type< T extends Type< T >.widen().

Referenced by com.cliffc.aa.tvar.TV2.repl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_err()

static TV2 com.cliffc.aa.tvar.TV2.make_err ( Node  n,
String  msg,
@NotNull String  alloc_site 
)
static

Definition at line 147 of file TV2.java.

147  {
148  UQNodes ns = n==null ? null : UQNodes.make(n);
149  TV2 tv2 = new TV2("Err",null,TypeStr.con(msg.intern()),ns,alloc_site);
150  assert tv2.is_err() && !tv2.is_leaf() && !tv2.is_base();
151  return tv2;
152  }

References com.cliffc.aa.type.TypeStr.con(), com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_err(), com.cliffc.aa.tvar.TV2.is_leaf(), com.cliffc.aa.tvar.UQNodes.make(), and com.cliffc.aa.tvar.TV2.TV2().

Referenced by com.cliffc.aa.tvar.TV2.union_err().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_leaf()

static TV2 com.cliffc.aa.tvar.TV2.make_leaf ( Node  n,
@NotNull String  alloc_site 
)
static

Definition at line 126 of file TV2.java.

126  {
127  UQNodes ns = n==null ? null : UQNodes.make(n);
128  return make_leaf_ns(ns,alloc_site);
129  }

References com.cliffc.aa.tvar.UQNodes.make(), and com.cliffc.aa.tvar.TV2.make_leaf_ns().

Referenced by com.cliffc.aa.node.Node.new_tvar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_leaf_ns()

static TV2 com.cliffc.aa.tvar.TV2.make_leaf_ns ( UQNodes  ns,
@NotNull String  alloc_site 
)
static

Definition at line 130 of file TV2.java.

130  {
131  TV2 tv2 = new TV2("Leaf",null,null,ns,alloc_site);
132  assert tv2.is_leaf() && !tv2.is_base();
133  return tv2;
134  }

References com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_leaf(), and com.cliffc.aa.tvar.TV2.TV2().

Referenced by com.cliffc.aa.tvar.TV2.make_leaf(), com.cliffc.aa.tvar.TV2.repl(), and com.cliffc.aa.Parse.stmt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_mem()

static TV2 com.cliffc.aa.tvar.TV2.make_mem ( Node  n,
@NotNull String  alloc_site 
)
static

Definition at line 178 of file TV2.java.

178 { return make("Mem",n,alloc_site,new NonBlockingHashMap<>()); }

References com.cliffc.aa.tvar.TV2.make().

Here is the call graph for this function:

◆ merge_deps()

void com.cliffc.aa.tvar.TV2.merge_deps ( TV2  that)
private

Definition at line 693 of file TV2.java.

693 { if( !that.isa("Dead") ) that._deps = that._deps==null ? _deps : that._deps.addAll(_deps); }

References com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.tvar.UQNodes.addAll(), and com.cliffc.aa.tvar.TV2.isa().

Referenced by com.cliffc.aa.tvar.TV2._union(), and com.cliffc.aa.tvar.TV2.args_put().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ merge_ns()

void com.cliffc.aa.tvar.TV2.merge_ns ( TV2  that)
private

Definition at line 696 of file TV2.java.

696 { if( !that.isa("Dead") ) that._ns = that._ns ==null ? _ns : that._ns .addAll(_ns ); }

References com.cliffc.aa.tvar.TV2._ns, com.cliffc.aa.tvar.UQNodes.addAll(), and com.cliffc.aa.tvar.TV2.isa().

Referenced by com.cliffc.aa.tvar.TV2._union().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

String com.cliffc.aa.tvar.TV2.name ( )

Definition at line 86 of file TV2.java.

86 { return _name; }

References com.cliffc.aa.tvar.TV2._name.

Referenced by com.cliffc.aa.tvar.TV2.make(), and com.cliffc.aa.tvar.TV2.TV2().

Here is the caller graph for this function:

◆ occurs_in()

boolean com.cliffc.aa.tvar.TV2.occurs_in ( TV2[]  vs)
package

Definition at line 599 of file TV2.java.

599  {
600  if( vs==null ) return false;
601  assert ODUPS.isEmpty();
602  boolean found = _occurs_in(vs);
603  ODUPS.clear();
604  return found;
605  }

References com.cliffc.aa.tvar.TV2._occurs_in(), and com.cliffc.aa.tvar.TV2.ODUPS.

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify(), and com.cliffc.aa.tvar.TV2.repl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_dep()

TV2 com.cliffc.aa.tvar.TV2.push_dep ( CallEpiNode  dep)

Definition at line 674 of file TV2.java.

674  {
675  assert DEPS_VISIT.isEmpty();
676  _push_update(dep);
677  DEPS_VISIT.clear();
678  return this;
679  }

References com.cliffc.aa.tvar.TV2._push_update(), and com.cliffc.aa.tvar.TV2.DEPS_VISIT.

Here is the call graph for this function:

◆ repl()

TV2 com.cliffc.aa.tvar.TV2.repl ( TV2[]  vs)
private

Definition at line 438 of file TV2.java.

438  {
439  assert !is_unified(); // Already chased these down
440  if( is_dead() ) return this; // Dead always unifies and wins
441  TV2 t = VARS.get(this); // Prior answer?
442  if( t!=null ) return t; // Been there, done that, return prior answer
443 
444  if( is_leaf() ) // If occurs_in lexical scope, keep same variable, else make a new leaf
445  return vput( occurs_in(vs) ? this : make_leaf_ns(null,"TV2_repl_leaf") );
446 
447  // Must replicate Base's, like a Mem or Obj.
448  if( is_base() ) return vput(make_base(null,_type,"TV2_repl_base"));
449  // A few no-arg variants (Nil, Fresh)
450  if( _args==null ) return vput(new TV2(_name,null,null,null,"TV2_repl_shallow"));
451 
452  // Structural recursion replicate
453  TV2 rez = new TV2(_name, new NonBlockingHashMap<>(),null,null,"TV2_repl_deep");
454  VARS.put(this,rez); // Insert in dups BEFORE structural recursion, to stop cycles
455  for( Comparable key : _args.keySet() )
456  rez.args_put(key,get(key).repl(vs));
457  return rez;
458  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._name, com.cliffc.aa.tvar.TV2._type, com.cliffc.aa.tvar.TV2.args_put(), com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.tvar.TV2.is_leaf(), com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.tvar.TV2.make_base(), com.cliffc.aa.tvar.TV2.make_leaf_ns(), com.cliffc.aa.tvar.TV2.occurs_in(), com.cliffc.aa.tvar.TV2.TV2(), com.cliffc.aa.tvar.TV2.VARS, and com.cliffc.aa.tvar.TV2.vput().

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify(), and com.cliffc.aa.tvar.TV2.repl_rename().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ repl_rename()

TV2 com.cliffc.aa.tvar.TV2.repl_rename ( TV2[]  vs,
HashMap< Node, Node map 
)

Definition at line 461 of file TV2.java.

461  {
462  assert VARS.isEmpty() && DUPS.isEmpty();
463  TV2 tv = repl(vs);
464  _rename(tv,map);
465  VARS.clear(); DUPS.clear();
466  return tv;
467  }

References com.cliffc.aa.tvar.TV2._rename(), com.cliffc.aa.tvar.TV2.DUPS, com.cliffc.aa.tvar.TV2.repl(), and com.cliffc.aa.tvar.TV2.VARS.

Here is the call graph for this function:

◆ reset()

void com.cliffc.aa.tvar.TV2.reset ( Node  n)

Definition at line 187 of file TV2.java.

187 { if( _ns!=null ) _ns.remove(n._uid); }

References com.cliffc.aa.tvar.TV2._ns, com.cliffc.aa.node.Node._uid, and com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.remove().

Here is the call graph for this function:

◆ reset_at()

void com.cliffc.aa.tvar.TV2.reset_at ( Object  o)

Definition at line 118 of file TV2.java.

118  {
119  if( !is_dead() )
120  _args.remove(o);
121  }

References com.cliffc.aa.tvar.TV2._args, and com.cliffc.aa.tvar.TV2.is_dead().

Here is the call graph for this function:

◆ reset_to_init0()

static void com.cliffc.aa.tvar.TV2.reset_to_init0 ( )
static

Definition at line 183 of file TV2.java.

183  {
184  NIL._deps = DEAD._deps = null;
185  NIL._ns = DEAD._ns = null;
186  }

References com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.tvar.TV2._ns, com.cliffc.aa.tvar.TV2.DEAD, and com.cliffc.aa.tvar.TV2.NIL.

Referenced by com.cliffc.aa.Env.top_reset().

Here is the caller graph for this function:

◆ str() [1/2]

final String com.cliffc.aa.tvar.TV2.str ( int  d)

Definition at line 707 of file TV2.java.

707  {
709  VBitSet bs = new VBitSet();
710  find_dups(bs,dups,0);
711  return str(new SB(),bs.clr(),dups,true,0,d).toString();
712  }

References com.cliffc.aa.util.VBitSet.clr(), and com.cliffc.aa.tvar.TV2.find_dups().

Referenced by com.cliffc.aa.tvar.TV2.str(), com.cliffc.aa.Env.VStack.toString(), and com.cliffc.aa.tvar.TV2.toString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ str() [2/2]

final SB com.cliffc.aa.tvar.TV2.str ( SB  sb,
VBitSet  bs,
NonBlockingHashMapLong< String >  dups,
boolean  debug,
int  d,
int  max 
)

Definition at line 738 of file TV2.java.

738  {
739  if( is_dead() ) return sb.p("Dead"); // Do not print NS
740  if( is_nil() ) return sb.p("Nil" ); // Do not print NS
741  if( is_err() ) return sb.p(_type.getstr());
742 
743  String stv = dups.get(_uid);
744  if( stv!=null ) {
745  sb.p('$').p(stv);
746  if( bs.tset(_uid) ) return sb;
747  sb.p(':');
748  }
749  // Explicit U-F chain
750  if( is_unified() ) {
751  if( debug ) sb.p("V").p(_uid).p(">>");
752  return _unified.str(sb,bs,dups,debug,d,max);
753  }
754 
755  (is_base() ? sb.p(_type) : sb.p(_name)).p(':');
756  // Print all unioned nodes
757  if( _ns!=null && _ns.size() != 0 ) { // Have any
758  for( Node tn : _ns.values() ) // For all unioned
759  if( !tn.is_dead() ) { // Dead lazily cleared out, do not bother to print
760  sb.p('N').p(tn._uid).p(':');
761  if( !debug ) break; // Debug, see them all; non-debug just the first
762  }
763  } else // No unioned nodes
764  sb.p("V").p(_uid); // So just the _uid
765  if( is_prim() ) return sb.p(":PRIMS");
766 
767  // Structural contents
768  if( _args != null ) {
769  final int min = Math.min(d+1,max);
770  switch(_name) {
771  case "Fun":
772  sb.p(":{ ");
773  if( d < max ) sb.nl().i(min);
774  TV2 args = _args.get("Args");
775  if( args==null ) sb.p("Args");
776  else args.str(sb,bs,dups,debug,d+1,max);
777  if( d < max ) sb.nl().i(min);
778  sb.p(" -> ");
779  if( d < max ) sb.nl().i(min);
780  TV2 ret = _args.get("Ret");
781  if( ret ==null ) sb.p("Ret" );
782  else ret .str(sb,bs,dups,debug,d+1,max);
783  if( d < max ) sb.nl().i(d);
784  sb.p(" }");
785  break;
786  default:
787  sb.p(":[ ");
788  Ary<Comparable> keys = new Ary<>(_args.keySet().toArray(new Comparable[_args.size()]));
789  keys.sort_update((x,y)-> {
790  if( x==y ) return 0;
791  if( x=="^" ) return -1;
792  if( y=="^" ) return -1;
793  return x.compareTo(y);
794  });
795  for( Comparable key : keys ) {
796  if( d < max ) sb.nl().i(min);
797  sb.p(key.toString()).p(':');
798  _args.get(key).str(sb,bs,dups,debug,d+1,max);
799  sb.p(' ');
800  }
801  if( d < max ) sb.nl().i(d);
802  sb.p("]");
803  }
804  }
805  return sb;
806  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._name, com.cliffc.aa.tvar.TV2._ns, com.cliffc.aa.tvar.TV2._type, com.cliffc.aa.tvar.TV2._uid, com.cliffc.aa.tvar.TV2._unified, com.cliffc.aa.type.Type< T extends Type< T >.getstr(), com.cliffc.aa.tvar.TV2.is_base(), com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.tvar.TV2.is_err(), com.cliffc.aa.tvar.TV2.is_nil(), com.cliffc.aa.tvar.TV2.is_prim(), com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.size(), com.cliffc.aa.util.Ary< E >.sort_update(), com.cliffc.aa.tvar.TV2.str(), and com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.values().

Here is the call graph for this function:

◆ toString()

final String com.cliffc.aa.tvar.TV2.toString ( )

Definition at line 701 of file TV2.java.

701  {
703  VBitSet bs = new VBitSet();
704  find_dups(bs,dups,0);
705  return str(new SB(),bs.clr(),dups,true,0,0).toString();
706  }

References com.cliffc.aa.util.VBitSet.clr(), com.cliffc.aa.tvar.TV2.find_dups(), and com.cliffc.aa.tvar.TV2.str().

Here is the call graph for this function:

◆ unify()

boolean com.cliffc.aa.tvar.TV2.unify ( TV2  that,
boolean  test 
)

Definition at line 288 of file TV2.java.

288  {
289  //assert !this.is_unified() && !that.is_unified();
290  //if( this==that ) return false;
291  //assert DUPS.isEmpty();
292  //boolean progress = _unify(that,test);
293  //DUPS.clear();
294  //return progress;
295  throw unimpl();
296  }

Referenced by com.cliffc.aa.node.ProjNode.unify(), com.cliffc.aa.node.MemSplitNode.unify(), com.cliffc.aa.node.CastNode.unify(), com.cliffc.aa.node.MemJoinNode.unify(), com.cliffc.aa.node.StoreNode.unify(), com.cliffc.aa.node.LoadNode.unify(), com.cliffc.aa.tvar.TV2.unify_alias_fld(), and com.cliffc.aa.tvar.TV2.unify_at().

Here is the caller graph for this function:

◆ unify_alias()

boolean com.cliffc.aa.tvar.TV2.unify_alias ( BitsAlias  aliases,
TV2  mem,
boolean  test 
)

Definition at line 515 of file TV2.java.

515  {
516  if( this==mem ) return false; // Already unified, no progress
517  assert (isa("Mem") || is_dead()) && mem.isa("Mem");
518  boolean progress = false;
519  TV2 tobj=null; // For asserts
520  for( int alias : aliases ) {
521  TV2 tv = mem.get(alias); // Get prior mem idea of this alias
522  if( tv==null ) continue; // No idea (yet) from prior mem, nothing to unify
523  if( tobj==null ) tobj=tv; // All objects in this set of aliases are already unified
524  else assert tobj==tv;
525  progress |= unify_at(alias,tv,test); // Overwrite the default for alias
526  if( progress && test ) return true;
527  }
528  return progress;
529  }

References com.cliffc.aa.tvar.TV2.get(), com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.tvar.TV2.isa(), and com.cliffc.aa.tvar.TV2.unify_at().

Referenced by com.cliffc.aa.node.MemJoinNode.unify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unify_alias_fld()

boolean com.cliffc.aa.tvar.TV2.unify_alias_fld ( Node  ldst,
BitsAlias  aliases,
String  fld,
TV2  tv,
boolean  test,
String  alloc_site 
)

Definition at line 488 of file TV2.java.

488  {
489  assert isa("Mem");
490  assert !tv.is_unified();
491  boolean progress=false;
492  for( int alias : aliases ) {
493  // TODO: Probably wrong, as no reason to believe that as soon as alias
494  // sharpens above AARY that it has hit its best sane value.
495  if( alias <= BitsAlias.AARY ) return false; // No unify on parser-specific values
496  TV2 tobj = get(alias);
497  if( tobj == null ) { // Missing, act as a fresh TV2 and lazily manifest
498  if( test ) return true; // Definitely will be progress
499  progress = true;
500  TV2 tvo = make("Obj",ldst,alloc_site);
501  args_put(alias,tvo);
502  tvo.args_put(fld,tv);
503  } else if( tobj.isa("Obj") ) {
504  progress = tobj.unify_at(fld,tv.find(),test);
505  } else if( tobj.is_dead() || tobj.isa("Err") ) {
506  tobj.unify(tv.find(),test);
507  } else
508  throw com.cliffc.aa.AA.unimpl();
509  if( progress && test ) return progress; // Shortcut
510  }
511  return progress;
512  }

References com.cliffc.aa.type.BitsAlias.AARY, com.cliffc.aa.tvar.TV2.args_put(), com.cliffc.aa.tvar.TV2.find(), com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.tvar.TV2.isa(), com.cliffc.aa.tvar.TV2.make(), com.cliffc.aa.tvar.TV2.unify(), com.cliffc.aa.tvar.TV2.unify_at(), and com.cliffc.aa.AA.unimpl().

Referenced by com.cliffc.aa.node.StoreNode.unify(), and com.cliffc.aa.node.LoadNode.unify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unify_at()

boolean com.cliffc.aa.tvar.TV2.unify_at ( Comparable  key,
TV2  tv2,
boolean  test 
)

Definition at line 105 of file TV2.java.

105  {
106  if( is_dead() ) return unify(tv2,test);
107  assert is_tvar() && _args!=null && !tv2.is_unified();
108  TV2 old = get(key);
109  if( old!=null )
110  return old.unify(tv2,test);
111  if( test ) return true;
112  args_put(key,tv2);
113  Env.GVN.add_flow(_deps); // Re-CallEpi
114  return true;
115  }

References com.cliffc.aa.tvar.TV2._args, com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.GVNGCM.add_flow(), com.cliffc.aa.tvar.TV2.args_put(), com.cliffc.aa.Env.GVN, com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.tvar.TV2.is_tvar(), com.cliffc.aa.tvar.TV2.is_unified(), and com.cliffc.aa.tvar.TV2.unify().

Referenced by com.cliffc.aa.node.ProjNode.unify(), com.cliffc.aa.node.LoadNode.unify(), com.cliffc.aa.tvar.TV2.unify_alias(), and com.cliffc.aa.tvar.TV2.unify_alias_fld().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unify_base()

boolean com.cliffc.aa.tvar.TV2.unify_base ( TV2  that)
private

Definition at line 353 of file TV2.java.

353  {
354  that._type = _type.meet(that._type);
355  return union(that);
356  }

References com.cliffc.aa.tvar.TV2._type, and com.cliffc.aa.type.Type< T extends Type< T >.meet().

Referenced by com.cliffc.aa.tvar.TV2._unify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ union()

boolean com.cliffc.aa.tvar.TV2.union ( TV2  that)

Definition at line 255 of file TV2.java.

255  {
256  if( this==that ) return true;
257  assert !is_unified() && !is_dead();
258  // Worklist: put updates on the worklist for revisiting
259  Env.GVN.add_flow(_deps); // Re-CallEpi
260  // TODO: REMOVE THIS BACKDOORS HACK
261  if( _ns!=null && that._ns!=null && _ns.size()==1 ) {
262  Node val=null; for( Node xval : _ns.values() ) { val=xval; break; }
263  if( val instanceof FreshNode && that._ns.containsKey(((FreshNode)val).in(1)._uid) )
264  Env.GVN.add_reduce(val);
265  }
266  _union(that);
267  ALLOCS.get(_alloc_site)._free++;
268  return true;
269  }

References com.cliffc.aa.tvar.TV2._alloc_site, com.cliffc.aa.tvar.TV2._deps, com.cliffc.aa.tvar.TV2._ns, com.cliffc.aa.tvar.TV2._union(), com.cliffc.aa.GVNGCM.add_flow(), com.cliffc.aa.GVNGCM.add_reduce(), com.cliffc.aa.tvar.TV2.ALLOCS, com.cliffc.aa.Env.GVN, com.cliffc.aa.tvar.TV2.is_dead(), com.cliffc.aa.tvar.TV2.is_unified(), com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.size(), and com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.values().

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify(), com.cliffc.aa.tvar.TV2._unify(), and com.cliffc.aa.tvar.TV2.union_err().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ union_err()

boolean com.cliffc.aa.tvar.TV2.union_err ( TV2  that,
String  msg 
)
private

Definition at line 348 of file TV2.java.

348  {
349  union(that);
350  return that.union(make_err(null,msg,"TV2.unify_err"));
351  }

References com.cliffc.aa.tvar.TV2.make_err(), and com.cliffc.aa.tvar.TV2.union().

Referenced by com.cliffc.aa.tvar.TV2._unify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vput() [1/2]

TV2 com.cliffc.aa.tvar.TV2.vput ( TV2  that)
private

Definition at line 435 of file TV2.java.

435 { VARS.put(this,that); return that; }

References com.cliffc.aa.tvar.TV2.VARS.

◆ vput() [2/2]

boolean com.cliffc.aa.tvar.TV2.vput ( TV2  that,
boolean  progress 
)
private

Definition at line 434 of file TV2.java.

434 { VARS.put(this,that); return progress; }

References com.cliffc.aa.tvar.TV2.VARS.

Referenced by com.cliffc.aa.tvar.TV2._fresh_unify(), and com.cliffc.aa.tvar.TV2.repl().

Here is the caller graph for this function:

Member Data Documentation

◆ _alloc_site

String com.cliffc.aa.tvar.TV2._alloc_site

◆ _args

◆ _deps

◆ _name

◆ _ns

◆ _type

◆ _uid

◆ _unified

TV2 com.cliffc.aa.tvar.TV2._unified
private

◆ ALLOCS

final HashMap<String,ACnts> com.cliffc.aa.tvar.TV2.ALLOCS = new HashMap<>()
staticprivate

◆ CDUPS

final HashMap<TV2,TV2> com.cliffc.aa.tvar.TV2.CDUPS = new HashMap<>()
staticprivate

◆ DEAD

TV2 com.cliffc.aa.tvar.TV2.DEAD = new TV2("Dead",null,null,null,"static")
static

Definition at line 180 of file TV2.java.

Referenced by com.cliffc.aa.tvar.TV2.reset_to_init0().

◆ DEPS_VISIT

final VBitSet com.cliffc.aa.tvar.TV2.DEPS_VISIT = new VBitSet()
staticpackage

◆ DUPS

◆ NIL

TV2 com.cliffc.aa.tvar.TV2.NIL = new TV2("Nil" ,null,null,null,"static")
static

Definition at line 181 of file TV2.java.

Referenced by com.cliffc.aa.tvar.TV2.reset_to_init0().

◆ ODUPS

final VBitSet com.cliffc.aa.tvar.TV2.ODUPS = new VBitSet()
staticprivate

◆ UID

int com.cliffc.aa.tvar.TV2.UID =1
staticprivate

Definition at line 25 of file TV2.java.

Referenced by com.cliffc.aa.tvar.TV2.TV2().

◆ VARS

final HashMap<TV2,TV2> com.cliffc.aa.tvar.TV2.VARS = new HashMap<>()
staticprivate

The documentation for this class was generated from the following file:
com.cliffc.aa.tvar.TV2._args
NonBlockingHashMap< Comparable, TV2 > _args
Definition: TV2.java:42
com.cliffc.aa.tvar.TV2.name
String name()
Definition: TV2.java:86
com.cliffc.aa.tvar.TV2.get_unified
TV2 get_unified()
Definition: TV2.java:85
com.cliffc.aa.tvar.TV2.is_err
boolean is_err()
Definition: TV2.java:83
com.cliffc.aa.tvar.TV2.unify_at
boolean unify_at(Comparable key, TV2 tv2, boolean test)
Definition: TV2.java:105
com.cliffc.aa.tvar.TV2.DEPS_VISIT
static final VBitSet DEPS_VISIT
Definition: TV2.java:673
com.cliffc.aa.tvar.TV2.unify
boolean unify(TV2 that, boolean test)
Definition: TV2.java:288
com.cliffc.aa.type.TypeFunPtr
Definition: TypeFunPtr.java:23
com.cliffc.aa.tvar.TV2._unify
boolean _unify(TV2 that, boolean test)
Definition: TV2.java:300
com.cliffc.aa.tvar.TV2.make_base
static TV2 make_base(Node n, Type type, @NotNull String alloc_site)
Definition: TV2.java:136
com.cliffc.aa.tvar.TV2._cycle_equals
boolean _cycle_equals(TV2 that)
Definition: TV2.java:646
com.cliffc.aa.util.NonBlockingHashMap
A lock-free alternate implementation of java.util.concurrent.ConcurrentHashMap with better scaling pr...
Definition: NonBlockingHashMap.java:75
com.cliffc.aa.tvar.TV2.ALLOCS
static final HashMap< String, ACnts > ALLOCS
Definition: TV2.java:60
com.cliffc.aa.type.TypeMem
Memory type; the state of all of memory; memory edges order memory ops.
Definition: TypeMem.java:53
com.cliffc.aa.util.Util.eq
static boolean eq(String s0, String s1)
Definition: Util.java:16
com.cliffc.aa.type.Type.join
Type join(Type t)
Definition: Type.java:619
com.cliffc
com.cliffc.aa.type.BitsAlias.AARY
static final int AARY
Definition: BitsAlias.java:25
com.cliffc.aa.type.Type.widen
Type widen()
Definition: Type.java:828
com.cliffc.aa.tvar.TV2._union
TV2 _union(TV2 that)
Definition: TV2.java:270
com.cliffc.aa.tvar.TV2.is_tvar
boolean is_tvar()
Definition: TV2.java:84
com.cliffc.aa.tvar.TV2.ODUPS
static final VBitSet ODUPS
Definition: TV2.java:598
com.cliffc.aa.tvar.TV2._name
String _name
Definition: TV2.java:38
com.cliffc.aa.tvar.TV2.args_put
void args_put(Comparable key, TV2 tv)
Definition: TV2.java:99
com.cliffc.aa.type.Type
an implementation of language AA
Definition: Type.java:94
com.cliffc.aa.util.Ary
Definition: Ary.java:11
com.cliffc.aa.tvar.TV2._alloc_site
String _alloc_site
Definition: TV2.java:56
com.cliffc.aa.type.BitsAlias
Definition: BitsAlias.java:8
com.cliffc.aa.type.TypeTuple
Definition: TypeTuple.java:11
com.cliffc.aa.type.Type._type
byte _type
Definition: Type.java:98
com.cliffc.aa.tvar.TV2._deps
UQNodes _deps
Definition: TV2.java:52
com.cliffc.aa.tvar.TV2.vput
boolean vput(TV2 that, boolean progress)
Definition: TV2.java:434
com.cliffc.aa.tvar.UQNodes.addAll
UQNodes addAll(UQNodes uq)
Definition: UQNodes.java:47
com.cliffc.aa.tvar.TV2._ns
UQNodes _ns
Definition: TV2.java:55
com.cliffc.aa.tvar.TV2.union_err
boolean union_err(TV2 that, String msg)
Definition: TV2.java:348
com.cliffc.aa.util.VBitSet.clr
VBitSet clr()
Definition: VBitSet.java:9
com.cliffc.aa.type.Type.ANY
static final Type ANY
Definition: Type.java:325
com.cliffc.aa.util.NonBlockingHashMapLong.size
int size()
Returns the number of key-value mappings in this map.
Definition: NonBlockingHashMapLong.java:255
com.cliffc.aa.tvar.TV2.DUPS
static final NonBlockingHashMapLong< TV2 > DUPS
Definition: TV2.java:284
com.cliffc.aa.tvar.TV2._eq
boolean _eq(TV2 that)
Definition: TV2.java:207
com.cliffc.aa.type.Type.meet
final Type meet(Type t)
Definition: Type.java:412
com.cliffc.aa.type.TypeAry
Definition: TypeAry.java:7
com.cliffc.aa.type.TypeStruct
A memory-based collection of optionally named fields.
Definition: TypeStruct.java:50
com.cliffc.aa.AA.unimpl
static RuntimeException unimpl()
Definition: AA.java:10
com.cliffc.aa.tvar.TV2.make_leaf_ns
static TV2 make_leaf_ns(UQNodes ns, @NotNull String alloc_site)
Definition: TV2.java:130
com.cliffc.aa.tvar.TV2.is_unified
boolean is_unified()
Definition: TV2.java:76
com.cliffc.aa.tvar.TV2._type
Type _type
Definition: TV2.java:49
com.cliffc.aa.tvar.TV2.DEAD
static TV2 DEAD
Definition: TV2.java:180
com.cliffc.aa.tvar.TV2._occurs_in_type
boolean _occurs_in_type(TV2 x)
Definition: TV2.java:619
com.cliffc.aa.tvar.TV2._unified
TV2 _unified
Definition: TV2.java:46
com.cliffc.aa.type.Type.ALL
static final Type ALL
Definition: Type.java:324
com.cliffc.aa.tvar.TV2.make
static TV2 make(@NotNull String name, Node n, @NotNull String alloc_site)
Definition: TV2.java:154
com.cliffc.aa.util.VBitSet.tset
boolean tset(int idx)
Definition: VBitSet.java:7
com.cliffc.aa.tvar.TV2._rename
void _rename(TV2 tv, HashMap< Node, Node > map)
Definition: TV2.java:468
com.cliffc.aa.Env.GVN
static final GVNGCM GVN
Definition: Env.java:13
com.cliffc.aa.tvar.TV2.TV2
TV2(@NotNull String name, NonBlockingHashMap< Comparable, TV2 > args, Type type, UQNodes ns, @NotNull String alloc_site)
Definition: TV2.java:63
com.cliffc.aa.type.TypeObj
Definition: TypeObj.java:15
com.cliffc.aa.tvar.TV2.is_dead
boolean is_dead()
Definition: TV2.java:81
com.cliffc.aa.tvar.TV2.CDUPS
static final HashMap< TV2, TV2 > CDUPS
Definition: TV2.java:639
com.cliffc.aa.tvar.TV2.occurs_in
boolean occurs_in(TV2[] vs)
Definition: TV2.java:599
com.cliffc.aa.util.NonBlockingHashMapLong.get
final TypeV get(long key)
Returns the value to which the specified key is mapped, or.
Definition: NonBlockingHashMapLong.java:368
com.cliffc.aa.tvar.TV2.UID
static int UID
Definition: TV2.java:25
com.cliffc.aa.tvar.TV2.eq
final boolean eq(TV2 that)
Definition: TV2.java:200
com.cliffc.aa.util.Util
Definition: Util.java:5
com.cliffc.aa.type.TypeObj.UNUSED
static final TypeObj UNUSED
Definition: TypeObj.java:46
com.cliffc.aa.type.TypeTuple.len
int len()
Definition: TypeTuple.java:183
com.cliffc.aa.tvar.TV2.cycle_equals
boolean cycle_equals(TV2 that)
Definition: TV2.java:640
com.cliffc.aa.tvar.TV2.merge_deps
void merge_deps(TV2 that)
Definition: TV2.java:693
com.cliffc.aa.tvar.TV2.is_prim
boolean is_prim()
Definition: TV2.java:714
com.cliffc.aa.type.TypeObj.ISUSED
static final TypeObj ISUSED
Definition: TypeObj.java:45
com.cliffc.aa.tvar.TV2.is_nil
boolean is_nil()
Definition: TV2.java:80
com.cliffc.aa.util.NonBlockingHashMap.put
TypeV put(TypeK key, TypeV val)
Maps the specified key to the specified value in the table.
Definition: NonBlockingHashMap.java:310
com.cliffc.aa.type.TypeStr.con
static TypeStr con(String con)
Definition: TypeStr.java:42
com.cliffc.aa.tvar.TV2.is_base
boolean is_base()
Definition: TV2.java:79
com.cliffc.aa.tvar.TV2.find_dups
final int find_dups(VBitSet bs, NonBlockingHashMapLong< String > dups, int scnt)
Definition: TV2.java:720
com.cliffc.aa.tvar.UQNodes.make
static UQNodes make(Node tn)
Definition: UQNodes.java:28
com.cliffc.aa.tvar.UQNodes.rename
UQNodes rename(HashMap< Node, Node > map)
Definition: UQNodes.java:70
com.cliffc.aa.type.TypeStr
Definition: TypeStr.java:14
com.cliffc.aa.tvar.TV2._occurs_in
boolean _occurs_in(TV2[] vs)
Definition: TV2.java:611
com.cliffc.aa.util.VBitSet
Definition: VBitSet.java:5
Comparable
com.cliffc.aa.tvar.TV2.unify_base
boolean unify_base(TV2 that)
Definition: TV2.java:353
com.cliffc.aa.util.SB
Tight/tiny StringBuilder wrapper.
Definition: SB.java:8
com.cliffc.aa.tvar.UQNodes.add
UQNodes add(Node tn)
Definition: UQNodes.java:36
com.cliffc.aa.tvar.TV2.isa
boolean isa(String s)
Definition: TV2.java:77
com.cliffc.aa.tvar.TV2.str
final String str(int d)
Definition: TV2.java:707
com.cliffc.aa.AA
an implementation of language AA
Definition: AA.java:9
com.cliffc.aa.tvar.TV2.NIL
static TV2 NIL
Definition: TV2.java:181
com.cliffc.aa
Definition: AA.java:1
com.cliffc.aa.tvar.TV2._push_update
void _push_update(CallEpiNode dep)
Definition: TV2.java:680
com.cliffc.aa.util.NonBlockingHashMapLong.containsKey
boolean containsKey(long key)
Tests if the key in the table.
Definition: NonBlockingHashMapLong.java:258
com.cliffc.aa.util.SB.nl
SB nl()
Definition: SB.java:48
com.cliffc.aa.tvar.TV2.make_err
static TV2 make_err(Node n, String msg, @NotNull String alloc_site)
Definition: TV2.java:147
com.cliffc.aa.util.SB.p
SB p(String s)
Definition: SB.java:13
com.cliffc.aa.util.Ary.sort_update
void sort_update(Comparator<? super E > c)
Sorts in-place.
Definition: Ary.java:187
com.cliffc.aa.type.TypeTuple.at
Type at(int idx)
Definition: TypeTuple.java:182
com.cliffc.aa.GVNGCM.add_reduce
public< N extends Node > N add_reduce(N n)
Definition: GVNGCM.java:49
com.cliffc.aa.util.NonBlockingHashMapLong< String >
com.cliffc.aa.tvar.TV2.fresh_base
boolean fresh_base(TV2 that, boolean test)
Definition: TV2.java:357
com.cliffc.aa.tvar.TV2.union
boolean union(TV2 that)
Definition: TV2.java:255
com.cliffc.aa.util.NonBlockingHashMapLong.put
TypeV put(long key, TypeV val)
Maps the specified key to the specified value in the table.
Definition: NonBlockingHashMapLong.java:278
com.cliffc.aa.GVNGCM.add_flow
public< N extends Node > N add_flow(N n)
Definition: GVNGCM.java:50
com.cliffc.aa.util.SB.i
SB i(int d)
Definition: SB.java:38
com.cliffc.aa.tvar.TV2.merge_ns
void merge_ns(TV2 that)
Definition: TV2.java:696
com
com.cliffc.aa.tvar.TV2._find_tvar
Type _find_tvar(Type t, TV2 tv, Type rez)
Definition: TV2.java:541
com.cliffc.aa.type.TypeMem.at
TypeObj at(int alias)
Definition: TypeMem.java:135
com.cliffc.aa.Env
Definition: Env.java:12
com.cliffc.aa.util.NonBlockingHashMapLong.values
Collection< TypeV > values()
Returns a Collection view of the values contained in this map.
Definition: NonBlockingHashMapLong.java:1118
com.cliffc.aa.type.Type.getstr
String getstr()
Definition: Type.java:806
com.cliffc.aa.tvar.TV2.is_leaf
boolean is_leaf()
Definition: TV2.java:78
com.cliffc.aa.tvar.TV2._uid
final int _uid
Definition: TV2.java:26
com.cliffc.aa.tvar.TV2.find
TV2 find()
Definition: TV2.java:240
com.cliffc.aa.tvar.TV2.repl
TV2 repl(TV2[] vs)
Definition: TV2.java:438
com.cliffc.aa.type.TypeMemPtr
Definition: TypeMemPtr.java:14
com.cliffc.aa.util.NonBlockingHashMapLong.remove
TypeV remove(long key)
Removes the key (and its corresponding value) from this map.
Definition: NonBlockingHashMapLong.java:292
com.cliffc.aa.tvar.TV2.VARS
static final HashMap< TV2, TV2 > VARS
Definition: TV2.java:366
com.cliffc.aa.type.Type.is_forward_ref
boolean is_forward_ref()
Definition: Type.java:799