aa
com.cliffc.aa.HM.HM9.T2 Class Reference
Inheritance diagram for com.cliffc.aa.HM.HM9.T2:
[legend]
Collaboration diagram for com.cliffc.aa.HM.HM9.T2:
[legend]

Public Member Functions

String p ()
 
String toString ()
 

Package Functions

Type _as_flow ()
 
boolean _cycle_equals (T2 t)
 
VBitSet _get_dups (VBitSet visit, VBitSet dups)
 
boolean _occurs_in_type (T2 x)
 
void add_deps_work (Worklist work)
 
T2 args (int i)
 
Type as_flow ()
 
T2 copy ()
 
boolean cycle_equals (T2 t)
 
T2 debug_find ()
 
T2 find ()
 
T2 fresh ()
 
boolean fresh_unify (T2 that, VStack nongen, Worklist work)
 
VBitSet get_dups (VBitSet dups)
 
boolean is_base ()
 
boolean is_err ()
 
boolean is_fun ()
 
boolean is_leaf ()
 
boolean is_struct ()
 
boolean is_tuple ()
 
boolean isa (String name)
 
T2 miss_field (String id)
 
boolean no_uf ()
 
boolean nongen_in (VStack vs)
 
boolean occurs_in_type (T2 x)
 
String p (VBitSet dups)
 
T2 push_update (Ary< Syntax > as)
 
T2 push_update (Syntax a)
 
SB str (SB sb, VBitSet visit, VBitSet dups)
 
boolean unify (T2 that, Worklist work)
 
boolean union (T2 that, Worklist work)
 
Type walk_types_in (Type t)
 
Type walk_types_out (Type t)
 

Static Package Functions

static T2 make_base (Type flow)
 
static T2 make_err (String s)
 
static T2 make_fun (BitsFun fidxs, T2... args)
 
static T2 make_leaf ()
 
static T2 make_struct (BitsAlias aliases, String[] ids, T2[] flds)
 
static T2 make_struct (BitsAlias aliases, String[] ids, T2[] flds, boolean open)
 
static void reset ()
 

Package Attributes

BitsAlias _alias
 
T2[] _args
 
Ary< Syntax_deps
 
String _err
 
BitsFun _fidxs
 
Type _flow
 
String[] _ids
 
String _name
 
boolean _open
 
final int _uid
 

Static Package Attributes

static final NonBlockingHashMapLong< TypeStructADUPS = new NonBlockingHashMapLong<>()
 
static final VBitSet UPDATE_VISIT = new VBitSet()
 

Private Member Functions

 T2 (@NotNull String name)
 
 T2 (@NotNull String name, T2 @NotNull ... args)
 
boolean _can_be_HM_base (T2 that, Type that_flow)
 
boolean _cycle_equals_struct (T2 t)
 
T2 _fresh (VStack nongen)
 
boolean _fresh_unify (T2 that, VStack nongen, Worklist work)
 
boolean _fresh_unify_struct (T2 that, VStack nongen, Worklist work)
 
SB _p (SB sb, VBitSet visit, VBitSet dups)
 
boolean _unify (T2 that, Worklist work)
 
void _unify_struct (T2 that, Worklist work)
 
void add_deps_work_impl (Worklist work)
 
boolean add_fld (String id, T2 fld, Worklist work)
 
int base_states ()
 
long dbl_uid (long uid)
 
long dbl_uid (T2 t)
 
Type fput (final Type t)
 
boolean fresh_base (T2 that, Worklist work)
 
BitsAlias meet_alias (T2 that)
 
String meet_err (T2 that)
 
BitsFun meet_fidxs (T2 that)
 
Type meet_flow (T2 that)
 
String[] meet_ids (T2 that)
 
boolean meet_opens (T2 that)
 
void push_update_impl (Syntax a)
 
boolean union_err (T2 that, Worklist work, String msg)
 
boolean vput (T2 that, boolean progress)
 

Static Private Member Functions

static SB str (SB sb, VBitSet visit, T2 t, VBitSet dups)
 

Static Private Attributes

static final HashMap< T2, T2CDUPS = new HashMap<>()
 
static int CNT =0
 
static final HashMap< Long, T2DUPS = new HashMap<>()
 
static final VBitSet ODUPS = new VBitSet()
 
static final HashMap< T2, T2VARS = new HashMap<>()
 
static int VCNT
 
static final HashMap< T2, Integer > VNAMES = new HashMap<>()
 

Detailed Description

Definition at line 1273 of file HM9.java.

Constructor & Destructor Documentation

◆ T2() [1/2]

com.cliffc.aa.HM.HM9.T2.T2 ( @NotNull String  name)
private

Definition at line 1329 of file HM9.java.

1329 { _uid = CNT++; _name= name; }

References com.cliffc.aa.HM.HM9.T2._name, com.cliffc.aa.HM.HM9.T2._uid, and com.cliffc.aa.HM.HM9.T2.CNT.

Referenced by com.cliffc.aa.HM.HM9.T2.copy(), com.cliffc.aa.HM.HM9.T2.make_base(), com.cliffc.aa.HM.HM9.T2.make_err(), com.cliffc.aa.HM.HM9.T2.make_fun(), com.cliffc.aa.HM.HM9.T2.make_leaf(), and com.cliffc.aa.HM.HM9.T2.make_struct().

Here is the caller graph for this function:

◆ T2() [2/2]

com.cliffc.aa.HM.HM9.T2.T2 ( @NotNull String  name,
T2 @NotNull ...  args 
)
private

Definition at line 1330 of file HM9.java.

1330  {
1331  this(name);
1332  _args= args;
1333  }

References com.cliffc.aa.HM.HM9.T2._args, and com.cliffc.aa.HM.HM9.T2.args().

Here is the call graph for this function:

Member Function Documentation

◆ _as_flow()

Type com.cliffc.aa.HM.HM9.T2._as_flow ( )
package

Definition at line 1382 of file HM9.java.

1382  {
1383  assert no_uf();
1384  if( is_base() ) return _flow;
1385  if( is_leaf() ) return Type.SCALAR;
1387  if( is_fun() ) return TypeFunPtr.make(_fidxs,_args.length-1,Type.ANY);
1388  if( is_struct() ) {
1389  TypeStruct tstr = ADUPS.get(_uid);
1390  if( tstr==null ) {
1391  Type.RECURSIVE_MEET++;
1392  TypeFld[] ts = TypeFlds.get(_ids.length+1);
1393  ts[0] = TypeFld.NO_DISP;
1394  for( int i=0; i<_ids.length; i++ )
1395  ts[i+1] = TypeFld.malloc(_ids[i],null,Access.Final,i);
1396  tstr = TypeStruct.malloc("",false,ts,true);
1397  tstr._hash = tstr.compute_hash();
1398  ADUPS.put(_uid,tstr); // Stop cycles
1399  for( int i=0; i<_ids.length; i++ )
1400  ts[i+1].setX(args(i)._as_flow()); // Recursive
1401  if( --Type.RECURSIVE_MEET == 0 ) {
1402  // Shrink / remove cycle dups. Might make new (smaller)
1403  // TypeStructs, so keep RECURSIVE_MEET enabled.
1404  Type.RECURSIVE_MEET++;
1405  tstr = TypeStruct.shrink(tstr.reachable(),tstr);
1406  TypeStruct.UF.clear();
1407  Type.RECURSIVE_MEET--;
1408  // Walk the final cyclic structure and intern everything.
1409  tstr.install_cyclic(tstr.reachable());
1410  }
1411  } else {
1412  tstr._cyclic=true; // Been there, done that, just mark it cyclic
1413  }
1414  return TypeMemPtr.make(_alias,tstr);
1415  }
1416 
1417  throw unimpl();
1418  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.type.TypeStruct._cyclic, com.cliffc.aa.HM.HM9.T2._err, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2._uid, com.cliffc.aa.HM.HM9.T2.ADUPS, com.cliffc.aa.type.Type< T extends Type< T >.ANY, com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.type.TypeStruct.compute_hash(), com.cliffc.aa.type.TypeStr.con(), com.cliffc.aa.type.TypeFld.Access.Final, com.cliffc.aa.type.TypeFlds.get(), com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.get(), com.cliffc.aa.type.TypeStruct.install_cyclic(), com.cliffc.aa.HM.HM9.T2.is_base(), com.cliffc.aa.HM.HM9.T2.is_err(), com.cliffc.aa.HM.HM9.T2.is_fun(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.is_struct(), com.cliffc.aa.type.TypeMemPtr.make(), com.cliffc.aa.type.TypeFunPtr.make(), com.cliffc.aa.type.TypeFld.malloc(), com.cliffc.aa.type.TypeStruct.malloc(), com.cliffc.aa.type.TypeFld.NO_DISP, com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.put(), com.cliffc.aa.type.TypeStruct.reachable(), com.cliffc.aa.type.Type< T extends Type< T >.RECURSIVE_MEET, com.cliffc.aa.type.Type< T extends Type< T >.SCALAR, com.cliffc.aa.type.TypeStruct.shrink(), com.cliffc.aa.type.BitsAlias.STRBITS, and com.cliffc.aa.type.TypeStruct.UF.

Referenced by com.cliffc.aa.HM.HM9.T2.as_flow().

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

◆ _can_be_HM_base()

boolean com.cliffc.aa.HM.HM9.T2._can_be_HM_base ( T2  that,
Type  that_flow 
)
private

Definition at line 1672 of file HM9.java.

1672  {
1673  if( that.base_states() > 1 ) return false;
1674  if( _flow==null || that_flow==null ) return true;
1675  Type wthisflow = _flow.widen();
1676  Type wthatflow = that_flow.widen();
1677  if( wthisflow==wthatflow ) return true;
1678  return wthisflow.isa(wthatflow);
1679  }

References com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2.base_states(), com.cliffc.aa.type.Type< T extends Type< T >.isa(), and com.cliffc.aa.type.Type< T extends Type< T >.widen().

Referenced by com.cliffc.aa.HM.HM9.T2.fresh_base().

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

◆ _cycle_equals()

boolean com.cliffc.aa.HM.HM9.T2._cycle_equals ( T2  t)
package

Definition at line 1866 of file HM9.java.

1866  {
1867  assert no_uf() && t.no_uf();
1868  if( this==t ) return true;
1869  if( _flow !=t._flow || // Base-cases have to be completely identical
1870  _fidxs!=t._fidxs ||
1871  _alias!=t._alias ||
1872  !Util.eq(_err,t._err) )
1873  return false;
1874  if( !Util.eq(_name,t._name) ) return false; // Wrong type-var names
1875  if( _args==t._args ) return true; // Same arrays (generally both null)
1876  if( _args.length != t._args.length ) // Mismatched sizes
1877  return false;
1878  // Cycles stall the equal/unequal decision until we see a difference.
1879  T2 tc = CDUPS.get(this);
1880  if( tc!=null ) return tc==t; // Cycle check; true if both cycling the same
1881  CDUPS.put(this,t);
1882  if( is_struct() ) // Struct equality honors field names without regard to order
1883  return _cycle_equals_struct(t);
1884  for( int i=0; i<_args.length; i++ )
1885  if( !args(i)._cycle_equals(t.args(i)) )
1886  return false;
1887  return true;
1888  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._cycle_equals_struct(), com.cliffc.aa.HM.HM9.T2._err, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._name, com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.HM.HM9.T2.CDUPS, com.cliffc.aa.util.Util.eq(), com.cliffc.aa.HM.HM9.T2.is_struct(), and com.cliffc.aa.HM.HM9.T2.no_uf().

Referenced by com.cliffc.aa.HM.HM9.T2._cycle_equals_struct(), and com.cliffc.aa.HM.HM9.T2.cycle_equals().

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

◆ _cycle_equals_struct()

boolean com.cliffc.aa.HM.HM9.T2._cycle_equals_struct ( T2  t)
private

Definition at line 1890 of file HM9.java.

1890  {
1891  assert is_struct() && t.is_struct();
1892  for( int i=0; i<_args.length; i++ ) {
1893  int idx = Util.find(t._ids,_ids[i]);
1894  if( idx==-1 || !args(i)._cycle_equals(t.args(idx)) )
1895  return false;
1896  }
1897  return true;
1898  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._cycle_equals(), com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.util.Util.find(), and com.cliffc.aa.HM.HM9.T2.is_struct().

Referenced by com.cliffc.aa.HM.HM9.T2._cycle_equals().

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

◆ _fresh()

T2 com.cliffc.aa.HM.HM9.T2._fresh ( VStack  nongen)
private

Definition at line 1810 of file HM9.java.

1810  {
1811  assert no_uf();
1812  T2 rez = VARS.get(this);
1813  if( rez!=null ) return rez; // Been there, done that
1814 
1815  if( is_leaf() ) {
1816  // If occurs_in lexical scope, keep same variable, else make a new leaf
1817  T2 t = nongen_in(nongen) ? this : T2.make_leaf();
1818  VARS.put(this,t);
1819  return t;
1820  } else { // Structure is deep-replicated
1821  T2 t = copy();
1822  VARS.put(this,t); // Stop cyclic structure looping
1823  if( _args!=null )
1824  for( int i=0; i<_args.length; i++ )
1825  t._args[i] = args(i)._fresh(nongen);
1826  return t;
1827  }
1828  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._fresh(), com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.HM.HM9.T2.copy(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.make_leaf(), com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.HM.HM9.T2.nongen_in(), and com.cliffc.aa.HM.HM9.T2.VARS.

Referenced by com.cliffc.aa.HM.HM9.T2._fresh(), com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._fresh_unify_struct(), and com.cliffc.aa.HM.HM9.T2.fresh().

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

◆ _fresh_unify()

boolean com.cliffc.aa.HM.HM9.T2._fresh_unify ( T2  that,
VStack  nongen,
Worklist  work 
)
private

Definition at line 1703 of file HM9.java.

1703  {
1704  assert no_uf() && that.no_uf();
1705  T2 prior = VARS.get(this);
1706  if( prior!=null ) // Been there, done that
1707  return prior.find()._unify(that,work); // Also 'prior' needs unification with 'that'
1708  if( cycle_equals(that) ) return vput(that,false);
1709 
1710  if( that.is_err() ) return vput(that,false); // That is an error, ignore 'this' and no progress
1711  if( this.is_err() ) return vput(that,_unify(that,work));
1712 
1713  // In the non-generative set, so do a hard unify, not a fresh-unify.
1714  if( nongen_in(nongen) ) return vput(that,_unify(that,work)); // Famous 'occurs-check', switch to normal unify
1715 
1716  // LHS is a nil, RHS is a struct; add nil to RHS
1717  if( is_base() && _flow==Type.XNIL && that.is_struct() ) {
1718  if( that._alias.test(0) ) return false; // Already nil
1719  if( work != null )
1720  that._alias = that._alias.set(0); // Add nil
1721  return true;
1722  }
1723  // If RHS is a nil, LHS is a struct; fresh-clone to RHS and add nil
1724  if( that.is_base() && that._flow==Type.XNIL && this.is_struct() ) {
1725  if( work==null ) return true;
1726  T2 t2 = _fresh(nongen);
1727  t2._alias = BitsAlias.NIL;
1728  return t2._unify(that, work);
1729  }
1730 
1731 
1732  // LHS is a leaf, base, or error
1733  if( this._args==null ) return vput(that,fresh_base(that,work));
1734  if( that.is_leaf() ) // RHS is a tvar; union with a deep copy of LHS
1735  return work==null || vput(that,that.union(_fresh(nongen),work));
1736 
1737  if( !Util.eq(_name,that._name) ||
1738  (!is_struct() && _args.length != that._args.length) )
1739  return work == null || vput(that,that._unify(make_err("Cannot unify "+this.p()+" and "+that.p()),work));
1740 
1741  // Structural recursion unification, lazy on LHS
1742  vput(that,false); // Early set, to stop cycles
1743  boolean progress = false;
1744  if( is_struct() )
1745  progress = _fresh_unify_struct(that,nongen,work);
1746  else {
1747  assert is_fun() && that.is_fun() && _flow==null && that._flow==null;
1748  for( int i=0; i<_args.length; i++ ) {
1749  progress |= args(i)._fresh_unify(that.args(i),nongen,work);
1750  if( progress && work==null ) return true;
1751  if( (that=that.find()).is_err() ) return true;
1752  }
1753  BitsFun fidxs = meet_fidxs(that);
1754  if( fidxs!=that._fidxs ) progress=true;
1755  if( progress && work==null ) return true;
1756  that._fidxs = fidxs;
1757  }
1758  return progress;
1759  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._fresh(), com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM9.T2._name, com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.HM.HM9.T2.cycle_equals(), com.cliffc.aa.util.Util.eq(), com.cliffc.aa.HM.HM9.T2.find(), com.cliffc.aa.HM.HM9.T2.fresh_base(), com.cliffc.aa.HM.HM9.T2.is_base(), com.cliffc.aa.HM.HM9.T2.is_err(), com.cliffc.aa.HM.HM9.T2.is_fun(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.is_struct(), com.cliffc.aa.HM.HM9.T2.make_err(), com.cliffc.aa.HM.HM9.T2.meet_fidxs(), com.cliffc.aa.type.BitsAlias.NIL, com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.HM.HM9.T2.nongen_in(), com.cliffc.aa.HM.HM9.T2.p(), com.cliffc.aa.type.Bits< B extends Bits< B >.set(), com.cliffc.aa.type.Bits< B extends Bits< B >.test(), com.cliffc.aa.HM.HM9.T2.union(), com.cliffc.aa.HM.HM9.T2.VARS, com.cliffc.aa.HM.HM9.T2.vput(), and com.cliffc.aa.type.Type< T extends Type< T >.XNIL.

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._fresh_unify_struct(), and com.cliffc.aa.HM.HM9.T2.fresh_unify().

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

◆ _fresh_unify_struct()

boolean com.cliffc.aa.HM.HM9.T2._fresh_unify_struct ( T2  that,
VStack  nongen,
Worklist  work 
)
private

Definition at line 1762 of file HM9.java.

1762  {
1763  assert is_struct() && that.is_struct();
1764  boolean progress = false;
1765  // Unification for structs is more complicated; args are aligned via
1766  // field names and not by position. Conceptually, fields in one struct
1767  // and not the other are put in both before unifying the structs. Open
1768  // structs copy from the other side; closed structs insert a missing
1769  // field error.
1770  for( int i=0; i<_ids.length; i++ ) {
1771  int idx = Util.find(that._ids,_ids[i]);
1772  if( idx == -1 ) { // Missing field on RHS
1773  if( work==null ) return true; // Will definitely make progress
1774  progress = true;
1775  // if both are closed, error on RHS
1776  that.add_fld(_ids[i], that._open ? args(i)._fresh(nongen) : that.miss_field(_ids[i]), work);
1777  } else
1778  progress |= args(i)._fresh_unify(that.args(idx),nongen,work);
1779  if( progress && work==null ) return true;
1780  }
1781  // Fields in RHS and not the LHS are also merged; if the LHS is open we'd
1782  // just copy the missing fields into it, then unify the structs
1783  // (shortcut: just skip the copy). If the LHS is closed, then the extra
1784  // RHS fields are an error.
1785  if( !_open )
1786  for( int i=0; i<that._ids.length; i++ ) // For all fields in RHS
1787  if( Util.find(_ids,that._ids[i]) == -1 &&// Missing in LHS
1788  !that.args(i).is_err() ) { // And not yet an error
1789  if( work == null ) return true; // Will definitely make progress
1790  progress |= that.args(i).unify(miss_field(that._ids[i]), work);
1791  }
1792 
1793  // Unify aliases
1794  BitsAlias alias = meet_alias(that);
1795  if( alias!=that._alias ) progress=true;
1796  if( progress && work==null ) return true;
1797  that._alias = alias;
1798  return progress;
1799  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._fresh(), com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2._open, com.cliffc.aa.HM.HM9.T2.add_fld(), com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.util.Util.find(), com.cliffc.aa.HM.HM9.T2.is_err(), com.cliffc.aa.HM.HM9.T2.is_struct(), com.cliffc.aa.HM.HM9.T2.meet_alias(), com.cliffc.aa.HM.HM9.T2.miss_field(), and com.cliffc.aa.HM.HM9.T2.unify().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify().

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

◆ _get_dups()

VBitSet com.cliffc.aa.HM.HM9.T2._get_dups ( VBitSet  visit,
VBitSet  dups 
)
package

Definition at line 2026 of file HM9.java.

2026  {
2027  if( visit.tset(_uid) ) {
2028  dups.set(debug_find()._uid);
2029  } else
2030  if( _args!=null )
2031  for( T2 t : _args )
2032  if( t!=null )
2033  t._get_dups(visit,dups);
2034  return dups;
2035  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._uid, com.cliffc.aa.HM.HM9.T2.debug_find(), and com.cliffc.aa.util.VBitSet.tset().

Referenced by com.cliffc.aa.HM.HM9.T2.get_dups().

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

◆ _occurs_in_type()

boolean com.cliffc.aa.HM.HM9.T2._occurs_in_type ( T2  x)
package

Definition at line 1832 of file HM9.java.

1832  {
1833  assert no_uf() && x.no_uf();
1834  if( x==this ) return true;
1835  if( ODUPS.tset(x._uid) ) return false; // Been there, done that
1836  if( !x.is_leaf() && x._args!=null )
1837  for( int i=0; i<x._args.length; i++ )
1838  if( _occurs_in_type(x.args(i)) )
1839  return true;
1840  return false;
1841  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._uid, com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.HM.HM9.T2.ODUPS, and com.cliffc.aa.util.VBitSet.tset().

Referenced by com.cliffc.aa.HM.HM9.T2.nongen_in(), and com.cliffc.aa.HM.HM9.T2.occurs_in_type().

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

◆ _p()

SB com.cliffc.aa.HM.HM9.T2._p ( SB  sb,
VBitSet  visit,
VBitSet  dups 
)
private

Definition at line 2081 of file HM9.java.

2081  {
2082  assert no_uf();
2083  if( is_base() ) return sb.p(_flow); // One-shot bases just do type
2084  if( is_leaf() || dups.get(_uid) ) { // Leafs or Duplicates? Take some effort to pretty-print cycles
2085  Integer ii = VNAMES.get(this);
2086  if( ii==null ) VNAMES.put(this,ii=VCNT++); // Type-var name
2087  // 2nd and later visits use the short form
2088  boolean later = visit.tset(_uid);
2089  if( later ) sb.p('$');
2090  char c = (char)('A'+ii);
2091  if( c<'V' ) sb.p(c); else sb.p("V"+ii);
2092  if( later ) return sb;
2093  if( is_leaf() ) return sb;
2094  sb.p(':'); // Dups now print their structure
2095  }
2096  if( is_err () ) return sb.p(_err);
2097 
2098  // Special printing for functions: { arg -> body }
2099  if( is_fun() ) {
2100  sb.p("{ ");
2101  for( int i=0; i<_args.length-1; i++ )
2102  args(i)._p(sb,visit,dups).p(" ");
2103  return args(_args.length-1)._p(sb.p("-> "),visit,dups).p(" }");
2104  }
2105 
2106  // Special printing for structures: @{ fld0 = body, fld1 = body, ... }
2107  if( is_struct() ) {
2108  if( is_tuple() ) {
2109  sb.p('(');
2110  for( int i=0; i<_ids.length; i++ ) {
2111  int idx = Util.find(_ids,new String(new char[]{(char)('0'+i)}).intern());
2112  args(idx)._p(sb.p(' '),visit,dups).p(',');
2113  }
2114  sb.unchar().p(')');
2115 
2116  } else {
2117  sb.p("@{");
2118  TreeMap<String,Integer> map = new TreeMap<String,Integer>();
2119  for( int i=0; i<_ids.length; i++ )
2120  map.put( _ids[i], i );
2121  for( int i : map.values() )
2122  args(i)._p(sb.p(' ').p(_ids[i]).p(" = "),visit,dups).p(',');
2123  sb.unchar().p("}");
2124  }
2125  return _alias.str(sb);
2126  }
2127 
2128  // Generic structural T2: (fun arg0 arg1...)
2129  sb.p("(").p(_name).p(" ");
2130  for( int i=0; i<_args.length; i++ ) args(i)._p(sb,visit,dups).p(" ");
2131  return sb.unchar().p(")");
2132  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._err, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2._name, com.cliffc.aa.HM.HM9.T2._p(), com.cliffc.aa.HM.HM9.T2._uid, com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.util.Util.find(), com.cliffc.aa.HM.HM9.T2.is_base(), com.cliffc.aa.HM.HM9.T2.is_err(), com.cliffc.aa.HM.HM9.T2.is_fun(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.is_struct(), com.cliffc.aa.HM.HM9.T2.is_tuple(), com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.util.SB.p(), com.cliffc.aa.type.Bits< B extends Bits< B >.str(), com.cliffc.aa.util.VBitSet.tset(), com.cliffc.aa.util.SB.unchar(), com.cliffc.aa.HM.HM9.T2.VCNT, and com.cliffc.aa.HM.HM9.T2.VNAMES.

Referenced by com.cliffc.aa.HM.HM9.T2._p(), and com.cliffc.aa.HM.HM9.T2.p().

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

◆ _unify()

boolean com.cliffc.aa.HM.HM9.T2._unify ( T2  that,
Worklist  work 
)
private

Definition at line 1539 of file HM9.java.

1539  {
1540  assert no_uf() && that.no_uf();
1541  if( this==that ) return false;
1542 
1543  // All leaf types immediately unify.
1544  if( this._args==null && that._args==null ) {
1545  T2 lhs=this, rhs=that;
1546  if( is_err() || // Errors beat all others
1547  (!that.is_err() && is_base()) )
1548  { rhs=this; lhs=that; } // Base beats plain leaf
1549  // If tied, keep lower uid
1550  if( Util.eq(lhs._name,rhs._name) && _uid<that._uid ) { rhs=this; lhs=that; }
1551  return lhs.union(rhs,work);
1552  }
1553  // Any leaf immediately unifies with any non-leaf
1554  if( this.is_leaf() || that.is_err() ) return this.union(that,work);
1555  if( that.is_leaf() || this.is_err() ) return that.union(this,work);
1556  // Special case for nil and struct
1557  if( this.is_struct() && that.is_base() && that._flow==Type.XNIL )
1558  return that.union(this,work);
1559  if( that.is_struct() && this.is_base() && this._flow==Type.XNIL )
1560  return this.union(that,work);
1561 
1562  // Cycle check
1563  long luid = dbl_uid(that); // long-unique-id formed from this and that
1564  T2 rez = DUPS.get(luid);
1565  assert rez==null || rez==that;
1566  if( rez!=null ) return false; // Been there, done that
1567  DUPS.put(luid,that); // Close cycles
1568 
1569  if( work==null ) return true; // Here we definitely make progress; bail out early if just testing
1570 
1571  if( !Util.eq(_name,that._name) )
1572  return union_err(that,work,"Cannot unify "+this.p()+" and "+that.p());
1573  assert _args!=that._args; // Not expecting to share _args and not 'this'
1574 
1575  // Structural recursion unification.
1576 
1577  // Structs unify only on matching fields, and add missing fields.
1578  if( is_struct() ) {
1579  _unify_struct(that,work);
1580  } else { // Normal structural unification
1581  for( int i=0; i<_args.length; i++ ) { // For all fields in LHS
1582  args(i)._unify(that.args(i),work);
1583  if( (that=that.find()).is_err() ) break;
1584  }
1585  }
1586  if( find().is_err() && !that.find().is_err() )
1587  // TODO: Find a more elegant way to preserve errors
1588  return that.find().union(find(),work); // Preserve errors
1589  return find().union(that,work);
1590  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._name, com.cliffc.aa.HM.HM9.T2._uid, com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.T2._unify_struct(), com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.HM.HM9.T2.dbl_uid(), com.cliffc.aa.HM.HM9.T2.DUPS, com.cliffc.aa.util.Util.eq(), com.cliffc.aa.HM.HM9.T2.find(), com.cliffc.aa.HM.HM9.T2.is_base(), com.cliffc.aa.HM.HM9.T2.is_err(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.is_struct(), com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.HM.HM9.T2.p(), com.cliffc.aa.HM.HM9.T2.union(), com.cliffc.aa.HM.HM9.T2.union_err(), and com.cliffc.aa.type.Type< T extends Type< T >.XNIL.

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.T2._unify_struct(), and com.cliffc.aa.HM.HM9.T2.unify().

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

◆ _unify_struct()

void com.cliffc.aa.HM.HM9.T2._unify_struct ( T2  that,
Worklist  work 
)
private

Definition at line 1592 of file HM9.java.

1592  {
1593  assert this.is_struct() && that.is_struct();
1594  // Unification for structs is more complicated; args are aligned via
1595  // field names and not by position. Conceptually, fields in one struct
1596  // and not the other are put in both before unifying the structs. Open
1597  // structs copy from the other side; closed structs insert a missing
1598  // field error.
1599  for( int i=0; i<_ids.length; i++ ) { // For all fields in LHS
1600  int idx = Util.find(that._ids,_ids[i]);
1601  if( idx==-1 ) // Missing that field? Copy from left if open, error if closed.
1602  that.add_fld(_ids[i], that._open ? args(i) : that.miss_field(_ids[i]), work);
1603  else args(i)._unify(that.args(idx),work); // Unify matching field
1604  if( (that=that.find()).is_err() ) return; // Recursively, might have already rolled this up
1605  }
1606  // Fields in RHS and not the LHS are also merged; if the LHS is open we'd
1607  // just copy the missing fields into it, then unify the structs
1608  // (shortcut: just skip the copy). If the LHS is closed, then the extra
1609  // RHS fields are an error.
1610  if( !_open ) // LHS is closed, so extras in RHS are errors
1611  for( int i=0; i<that._ids.length; i++ ) // For all fields in RHS
1612  if( Util.find(_ids,that._ids[i]) == -1 ) // Missing in LHS
1613  that.args(i)._unify(miss_field(that._ids[i]),work); // If closed, extra field is an error
1614  // Shortcut (for asserts): LHS gets same ids as RHS, since its about to be top-level unified
1615  _ids = that._ids;
1616  _open= that._open;
1617  }

References com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2._open, com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.T2.add_fld(), com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.util.Util.find(), com.cliffc.aa.HM.HM9.T2.find(), com.cliffc.aa.HM.HM9.T2.is_struct(), and com.cliffc.aa.HM.HM9.T2.miss_field().

Referenced by com.cliffc.aa.HM.HM9.T2._unify().

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

◆ add_deps_work()

void com.cliffc.aa.HM.HM9.T2.add_deps_work ( Worklist  work)
package

Definition at line 2009 of file HM9.java.

2009 { assert UPDATE_VISIT.isEmpty(); add_deps_work_impl(work); UPDATE_VISIT.clear(); }

References com.cliffc.aa.HM.HM9.T2.add_deps_work_impl(), and com.cliffc.aa.HM.HM9.T2.UPDATE_VISIT.

Referenced by com.cliffc.aa.HM.HM9.Ident.add_hm_work(), and com.cliffc.aa.HM.HM9.T2.fresh_base().

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

◆ add_deps_work_impl()

void com.cliffc.aa.HM.HM9.T2.add_deps_work_impl ( Worklist  work)
private

Definition at line 2010 of file HM9.java.

2010  {
2011  if( is_leaf() ) {
2012  work.addAll(_deps);
2013  } else {
2014  if( UPDATE_VISIT.tset(_uid) ) return;
2015  if( _args != null )
2016  for( int i=0; i<_args.length; i++ )
2017  args(i).add_deps_work_impl(work);
2018  }
2019  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._deps, com.cliffc.aa.HM.HM9.T2._uid, com.cliffc.aa.HM.HM9.T2.add_deps_work_impl(), com.cliffc.aa.HM.HM9.Worklist.addAll(), com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.util.VBitSet.tset(), and com.cliffc.aa.HM.HM9.T2.UPDATE_VISIT.

Referenced by com.cliffc.aa.HM.HM9.T2.add_deps_work(), and com.cliffc.aa.HM.HM9.T2.add_deps_work_impl().

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

◆ add_fld()

boolean com.cliffc.aa.HM.HM9.T2.add_fld ( String  id,
T2  fld,
Worklist  work 
)
private

Definition at line 1620 of file HM9.java.

1620  {
1621  assert is_struct();
1622  int len = _ids.length;
1623  // Find insertion point
1624  int idx = Arrays.binarySearch(_ids,id);
1625  assert idx<0; // Never found
1626  idx = -idx-1; // Insertion point
1627  // Insert in sorted order
1628  _ids = Arrays.copyOf( _ids,len+1);
1629  _args = Arrays.copyOf(_args,len+1);
1630  System.arraycopy( _ids,idx, _ids,idx+1,len-idx);
1631  System.arraycopy(_args,idx,_args,idx+1,len-idx);
1632  _ids [idx] = id ;
1633  _args[idx] = fld;
1634  fld.push_update(_deps); // If field changes, all deps change
1635  work.addAll(_deps); //
1636  return true; // Always progress
1637  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._deps, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.Worklist.addAll(), com.cliffc.aa.HM.HM9.id(), com.cliffc.aa.HM.HM9.T2.is_struct(), and com.cliffc.aa.HM.HM9.T2.push_update().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM9.T2._unify_struct(), com.cliffc.aa.HM.HM9.Field.hm(), and com.cliffc.aa.HM.HM9.NotNil.hm().

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

◆ args()

T2 com.cliffc.aa.HM.HM9.T2.args ( int  i)
package

◆ as_flow()

Type com.cliffc.aa.HM.HM9.T2.as_flow ( )
package

Definition at line 1375 of file HM9.java.

1375  {
1376  assert ADUPS.isEmpty();
1377  Type t = _as_flow();
1378  ADUPS.clear();
1379  assert Type.intern_check();
1380  return t;
1381  }

References com.cliffc.aa.HM.HM9.T2._as_flow(), com.cliffc.aa.HM.HM9.T2.ADUPS, com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.clear(), and com.cliffc.aa.type.Type< T extends Type< T >.intern_check().

Referenced by com.cliffc.aa.HM.HM9.T2.walk_types_in(), and com.cliffc.aa.HM.HM9.Root.widen().

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

◆ base_states()

int com.cliffc.aa.HM.HM9.T2.base_states ( )
private

Definition at line 1462 of file HM9.java.

1462  {
1463  int cnt=0;
1464  if( _flow !=null ) cnt++;
1465  if( _fidxs!=null ) cnt++;
1466  if( _err !=null ) cnt++;
1467  if( _alias!=null ) { cnt++; assert _ids!=null; }
1468  else assert _ids==null;
1469  return cnt;
1470  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._err, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2._flow, and com.cliffc.aa.HM.HM9.T2._ids.

Referenced by com.cliffc.aa.HM.HM9.T2._can_be_HM_base(), com.cliffc.aa.HM.HM9.T2.fresh_base(), and com.cliffc.aa.HM.HM9.T2.union().

Here is the caller graph for this function:

◆ copy()

T2 com.cliffc.aa.HM.HM9.T2.copy ( )
package

Definition at line 1316 of file HM9.java.

1316  {
1317  T2 t = new T2(_name);
1318  if( _args!=null ) t._args = new T2[_args.length];
1319  t._flow = _flow;
1320  t._fidxs = _fidxs;
1321  t._alias = _alias;
1322  t._ids = _ids;
1323  t._err = _err;
1324  t._deps = _deps;
1325  t._open = _open;
1326  return t;
1327  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._deps, com.cliffc.aa.HM.HM9.T2._err, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2._name, com.cliffc.aa.HM.HM9.T2._open, and com.cliffc.aa.HM.HM9.T2.T2().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh().

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

◆ cycle_equals()

boolean com.cliffc.aa.HM.HM9.T2.cycle_equals ( T2  t)
package

Definition at line 1860 of file HM9.java.

1860  {
1861  assert CDUPS.isEmpty();
1862  boolean rez = _cycle_equals(t);
1863  CDUPS.clear();
1864  return rez;
1865  }

References com.cliffc.aa.HM.HM9.T2._cycle_equals(), and com.cliffc.aa.HM.HM9.T2.CDUPS.

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify().

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

◆ dbl_uid() [1/2]

long com.cliffc.aa.HM.HM9.T2.dbl_uid ( long  uid)
private

Definition at line 1640 of file HM9.java.

1640 { return ((long)_uid<<32)|uid; }

References com.cliffc.aa.HM.HM9.T2._uid.

◆ dbl_uid() [2/2]

long com.cliffc.aa.HM.HM9.T2.dbl_uid ( T2  t)
private

Definition at line 1639 of file HM9.java.

1639 { return dbl_uid(t._uid); }

References com.cliffc.aa.HM.HM9.T2._uid, and com.cliffc.aa.HM.HM9.T2.dbl_uid().

Referenced by com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.T2.dbl_uid(), and com.cliffc.aa.HM.HM9.T2.walk_types_in().

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

◆ debug_find()

T2 com.cliffc.aa.HM.HM9.T2.debug_find ( )
package

Definition at line 1344 of file HM9.java.

1344  {// Find, without the roll-up
1345  if( !is_leaf() ) return this; // Shortcut
1346  if( _args==null ) return this;
1347  T2 u = _args[0];
1348  if( u.no_uf() ) return u; // Shortcut
1349  // U-F fixup
1350  while( u.is_leaf() && !u.no_uf() ) u = u._args[0];
1351  return u;
1352  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2.is_leaf(), and com.cliffc.aa.HM.HM9.T2.no_uf().

Referenced by com.cliffc.aa.HM.HM9.T2._get_dups(), com.cliffc.aa.HM.HM9.Syntax.debug_find(), and com.cliffc.aa.HM.HM9.T2.find().

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

◆ find()

T2 com.cliffc.aa.HM.HM9.T2.find ( )
package

Definition at line 1355 of file HM9.java.

1355  {
1356  T2 u = debug_find();
1357  if( u==this || u==_args[0] ) return u;
1358  T2 v = this, v2;
1359  while( v.is_leaf() && (v2=v._args[0])!=u ) { v._args[0]=u; v = v2; }
1360  return u;
1361  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2.debug_find(), and com.cliffc.aa.HM.HM9.T2.is_leaf().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.T2._unify_struct(), com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.HM.HM9.Syntax.find(), com.cliffc.aa.HM.HM9.hm(), com.cliffc.aa.HM.HM9.Apply.hm(), com.cliffc.aa.HM.HM9.If.hm(), com.cliffc.aa.HM.HM9.NotNil.hm(), com.cliffc.aa.HM.HM9.Ident.idt(), com.cliffc.aa.HM.HM9.VStack.nongen(), com.cliffc.aa.HM.HM9.T2.p(), and com.cliffc.aa.HM.HM9.Lambda.targ().

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

◆ fput()

Type com.cliffc.aa.HM.HM9.T2.fput ( final Type  t)
private

Definition at line 1948 of file HM9.java.

1948  {
1949  Apply.T2MAP.merge(this, t, Type::meet);
1950  return t;
1951  }

References com.cliffc.aa.type.Type< T extends Type< T >.meet(), and com.cliffc.aa.HM.HM9.Apply.T2MAP.

Referenced by com.cliffc.aa.HM.HM9.T2.walk_types_in().

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

◆ fresh()

T2 com.cliffc.aa.HM.HM9.T2.fresh ( )
package

Definition at line 1804 of file HM9.java.

1804  {
1805  assert VARS.isEmpty();
1806  T2 rez = _fresh(null);
1807  VARS.clear();
1808  return rez;
1809  }

References com.cliffc.aa.HM.HM9.T2._fresh(), and com.cliffc.aa.HM.HM9.T2.VARS.

Referenced by com.cliffc.aa.HM.HM9.PrimSyn.PrimSyn().

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

◆ fresh_base()

boolean com.cliffc.aa.HM.HM9.T2.fresh_base ( T2  that,
Worklist  work 
)
private

Definition at line 1642 of file HM9.java.

1642  {
1643  assert base_states()<=1 && that.base_states()<=1;
1644  boolean progress=false;
1645  Type flow = meet_flow (that); progress |= flow != that._flow ;
1646  BitsFun fidxs = meet_fidxs(that); progress |= fidxs != that._fidxs;
1647  BitsAlias alias = meet_alias(that); progress |= alias != that._alias;
1648  String[] ids = meet_ids (that); progress |= ids != that._ids;
1649  boolean open = meet_opens(that); progress |= open != that._open;
1650  String err = meet_err (that); progress |= !Util.eq(err,that._err);
1651  if( !progress ) return false;
1652  if( work==null ) return true;
1653  // Progress
1654  Type that_flow = that._flow;
1655  that._flow = flow ;
1656  that._fidxs = fidxs;
1657  that._alias = alias;
1658  that._ids = ids;
1659  that._open = open;
1660  that._err = err;
1661  if( !_can_be_HM_base(that,that_flow) ) {
1662  that._flow = that_flow; // Unwind for error message
1663  String msg = "Cannot unify "+this.p()+" and "+that.p();
1664  that._flow=null; that._fidxs=null; that._alias=null; that._ids=null; // Now kill the base types, since in-error
1665  return that.union(make_err(msg),work);
1666  }
1667  assert that.base_states()<=1;
1668  that.add_deps_work(work);
1669  if( that.is_leaf() ) that._name = _name; // That is a base/err now
1670  return true;
1671  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._can_be_HM_base(), com.cliffc.aa.HM.HM9.T2._err, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2._name, com.cliffc.aa.HM.HM9.T2._open, com.cliffc.aa.HM.HM9.T2.add_deps_work(), com.cliffc.aa.HM.HM9.T2.base_states(), com.cliffc.aa.util.Util.eq(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.make_err(), com.cliffc.aa.HM.HM9.T2.meet_alias(), com.cliffc.aa.HM.HM9.T2.meet_err(), com.cliffc.aa.HM.HM9.T2.meet_fidxs(), com.cliffc.aa.HM.HM9.T2.meet_flow(), com.cliffc.aa.HM.HM9.T2.meet_ids(), com.cliffc.aa.HM.HM9.T2.meet_opens(), com.cliffc.aa.HM.HM9.T2.p(), and com.cliffc.aa.HM.HM9.T2.union().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify().

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

◆ fresh_unify()

boolean com.cliffc.aa.HM.HM9.T2.fresh_unify ( T2  that,
VStack  nongen,
Worklist  work 
)
package

Definition at line 1692 of file HM9.java.

1692  {
1693  assert VARS.isEmpty() && DUPS.isEmpty();
1694  int old = CNT;
1695  boolean progress = _fresh_unify(that,nongen,work);
1696  VARS.clear(); DUPS.clear();
1697  if( work==null && old!=CNT && DEBUG_LEAKS )
1698  throw unimpl("busted, made T2s but just testing");
1699  return progress;
1700  }

References com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2.CNT, com.cliffc.aa.HM.HM9.DEBUG_LEAKS, com.cliffc.aa.HM.HM9.T2.DUPS, and com.cliffc.aa.HM.HM9.T2.VARS.

Referenced by com.cliffc.aa.HM.HM9.Ident.hm().

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

◆ get_dups()

VBitSet com.cliffc.aa.HM.HM9.T2.get_dups ( VBitSet  dups)
package

Definition at line 2025 of file HM9.java.

2025 { return _get_dups(new VBitSet(),dups); }

References com.cliffc.aa.HM.HM9.T2._get_dups().

Referenced by com.cliffc.aa.HM.HM9.T2.p(), com.cliffc.aa.HM.HM9.Syntax.p0(), and com.cliffc.aa.HM.HM9.T2.toString().

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

◆ is_base()

boolean com.cliffc.aa.HM.HM9.T2.is_base ( )
package

Definition at line 1339 of file HM9.java.

1339 { return isa("Base"); }

References com.cliffc.aa.HM.HM9.T2.isa().

Referenced by com.cliffc.aa.HM.HM9.T2._as_flow(), com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._p(), com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.Pair1.Pair1X.apply(), com.cliffc.aa.HM.HM9.NotNil.hm(), com.cliffc.aa.HM.HM9.T2.str(), com.cliffc.aa.HM.HM9.T2.walk_types_in(), and com.cliffc.aa.HM.HM9.T2.walk_types_out().

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

◆ is_err()

boolean com.cliffc.aa.HM.HM9.T2.is_err ( )
package

Definition at line 1342 of file HM9.java.

1342 { return isa("Err"); }

References com.cliffc.aa.HM.HM9.T2.isa().

Referenced by com.cliffc.aa.HM.HM9.T2._as_flow(), com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM9.T2._p(), com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.Lambda.hm(), com.cliffc.aa.HM.HM9.Apply.hm(), com.cliffc.aa.HM.HM9.Struct.hm(), com.cliffc.aa.HM.HM9.Field.hm(), com.cliffc.aa.HM.HM9.PrimSyn.hm(), com.cliffc.aa.HM.HM9.NotNil.hm(), com.cliffc.aa.HM.HM9.T2.str(), com.cliffc.aa.HM.HM9.T2.walk_types_in(), and com.cliffc.aa.HM.HM9.T2.walk_types_out().

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

◆ is_fun()

boolean com.cliffc.aa.HM.HM9.T2.is_fun ( )
package

Definition at line 1340 of file HM9.java.

1340 { return isa("->"); }

References com.cliffc.aa.HM.HM9.T2.isa().

Referenced by com.cliffc.aa.HM.HM9.T2._as_flow(), com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._p(), com.cliffc.aa.HM.HM9.Lambda.hm(), com.cliffc.aa.HM.HM9.Apply.hm(), com.cliffc.aa.HM.HM9.PrimSyn.hm(), com.cliffc.aa.HM.HM9.NotNil.hm(), com.cliffc.aa.HM.HM9.T2.str(), com.cliffc.aa.HM.HM9.T2.walk_types_in(), and com.cliffc.aa.HM.HM9.T2.walk_types_out().

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

◆ is_leaf()

◆ is_struct()

boolean com.cliffc.aa.HM.HM9.T2.is_struct ( )
package

Definition at line 1341 of file HM9.java.

1341 { return isa("@{}"); }

References com.cliffc.aa.HM.HM9.T2.isa().

Referenced by com.cliffc.aa.HM.HM9.T2._as_flow(), com.cliffc.aa.HM.HM9.T2._cycle_equals(), com.cliffc.aa.HM.HM9.T2._cycle_equals_struct(), com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM9.T2._p(), com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.T2._unify_struct(), com.cliffc.aa.HM.HM9.T2.add_fld(), com.cliffc.aa.HM.HM9.Field.hm(), com.cliffc.aa.HM.HM9.NotNil.hm(), com.cliffc.aa.HM.HM9.T2.meet_opens(), com.cliffc.aa.HM.HM9.T2.str(), com.cliffc.aa.HM.HM9.T2.walk_types_in(), and com.cliffc.aa.HM.HM9.T2.walk_types_out().

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

◆ is_tuple()

boolean com.cliffc.aa.HM.HM9.T2.is_tuple ( )
package

Definition at line 2134 of file HM9.java.

2134  {
2135  if( _ids==null ) return false;
2136  for( String id : _ids )
2137  if( !isDigit((byte) id.charAt(0)) )
2138  return false;
2139  return true;
2140  }

References com.cliffc.aa.HM.HM9.T2._ids, and com.cliffc.aa.HM.HM9.isDigit().

Referenced by com.cliffc.aa.HM.HM9.T2._p().

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

◆ isa()

boolean com.cliffc.aa.HM.HM9.T2.isa ( String  name)
package

Definition at line 1338 of file HM9.java.

1338 { return Util.eq(_name,name); }

References com.cliffc.aa.HM.HM9.T2._name, and com.cliffc.aa.util.Util.eq().

Referenced by com.cliffc.aa.HM.HM9.T2.is_base(), com.cliffc.aa.HM.HM9.T2.is_err(), com.cliffc.aa.HM.HM9.T2.is_fun(), and com.cliffc.aa.HM.HM9.T2.is_struct().

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

◆ make_base()

static T2 com.cliffc.aa.HM.HM9.T2.make_base ( Type  flow)
staticpackage

Definition at line 1304 of file HM9.java.

1304 { T2 base = new T2("Base"); base._flow = flow; return base; }

References com.cliffc.aa.HM.HM9.T2._flow, and com.cliffc.aa.HM.HM9.T2.T2().

Referenced by com.cliffc.aa.HM.HM9.NotNil.hm(), com.cliffc.aa.HM.HM9.Con.prep_tree(), and com.cliffc.aa.HM.HM9.PrimSyn.reset().

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

◆ make_err()

static T2 com.cliffc.aa.HM.HM9.T2.make_err ( String  s)
staticpackage

Definition at line 1314 of file HM9.java.

1314 { T2 terr = new T2("Err"); terr._err = s.intern(); return terr; }

References com.cliffc.aa.HM.HM9.T2._err, and com.cliffc.aa.HM.HM9.T2.T2().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2.fresh_base(), com.cliffc.aa.HM.HM9.Apply.hm(), com.cliffc.aa.HM.HM9.Field.hm(), com.cliffc.aa.HM.HM9.T2.miss_field(), and com.cliffc.aa.HM.HM9.T2.union_err().

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

◆ make_fun()

static T2 com.cliffc.aa.HM.HM9.T2.make_fun ( BitsFun  fidxs,
T2...  args 
)
staticpackage

Definition at line 1305 of file HM9.java.

1305 { T2 tfun = new T2("->",args); tfun._fidxs = fidxs; return tfun; }

References com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2.args(), and com.cliffc.aa.HM.HM9.T2.T2().

Referenced by com.cliffc.aa.HM.HM9.Lambda.hm(), com.cliffc.aa.HM.HM9.Apply.hm(), com.cliffc.aa.HM.HM9.Pair1.Pair1(), and com.cliffc.aa.HM.HM9.PrimSyn.PrimSyn().

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

◆ make_leaf()

static T2 com.cliffc.aa.HM.HM9.T2.make_leaf ( )
staticpackage

Definition at line 1303 of file HM9.java.

1303 { return new T2("V"+CNT); }

References com.cliffc.aa.HM.HM9.T2.CNT, and com.cliffc.aa.HM.HM9.T2.T2().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh(), com.cliffc.aa.HM.HM9.EQ.EQ(), com.cliffc.aa.HM.HM9.If.If(), com.cliffc.aa.HM.HM9.Lambda.Lambda(), com.cliffc.aa.HM.HM9.Let.Let(), com.cliffc.aa.HM.HM9.NotNil.NotNil(), com.cliffc.aa.HM.HM9.Pair.Pair(), com.cliffc.aa.HM.HM9.Pair1.Pair1(), com.cliffc.aa.HM.HM9.Pair1.Pair1X.Pair1X(), com.cliffc.aa.HM.HM9.Ident.prep_tree(), com.cliffc.aa.HM.HM9.Lambda.prep_tree(), com.cliffc.aa.HM.HM9.Apply.prep_tree(), com.cliffc.aa.HM.HM9.Field.prep_tree(), and com.cliffc.aa.HM.HM9.Triple.Triple().

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

◆ make_struct() [1/2]

static T2 com.cliffc.aa.HM.HM9.T2.make_struct ( BitsAlias  aliases,
String[]  ids,
T2[]  flds 
)
staticpackage

Definition at line 1306 of file HM9.java.

1306 { return make_struct(aliases,ids,flds,false); }

References com.cliffc.aa.HM.HM9.T2.make_struct().

Referenced by com.cliffc.aa.HM.HM9.Struct.hm(), com.cliffc.aa.HM.HM9.Field.hm(), com.cliffc.aa.HM.HM9.NotNil.hm(), com.cliffc.aa.HM.HM9.T2.make_struct(), com.cliffc.aa.HM.HM9.Pair.Pair(), com.cliffc.aa.HM.HM9.Pair1.Pair1(), com.cliffc.aa.HM.HM9.Pair1.Pair1X.Pair1X(), com.cliffc.aa.HM.HM9.Struct.prep_tree(), and com.cliffc.aa.HM.HM9.Triple.Triple().

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

◆ make_struct() [2/2]

static T2 com.cliffc.aa.HM.HM9.T2.make_struct ( BitsAlias  aliases,
String[]  ids,
T2[]  flds,
boolean  open 
)
staticpackage

Definition at line 1307 of file HM9.java.

1307  {
1308  T2 tstr = new T2("@{}",flds);
1309  tstr._alias=aliases;
1310  tstr._ids = ids;
1311  tstr._open= open;
1312  return tstr;
1313  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2._open, and com.cliffc.aa.HM.HM9.T2.T2().

Here is the call graph for this function:

◆ meet_alias()

BitsAlias com.cliffc.aa.HM.HM9.T2.meet_alias ( T2  that)
private

Definition at line 1434 of file HM9.java.

1434  {
1435  if( this._alias==null ) return that._alias;
1436  if( that._alias==null ) return this._alias;
1437  return _alias.meet(that._alias);
1438  }

References com.cliffc.aa.HM.HM9.T2._alias, and com.cliffc.aa.type.Bits< B extends Bits< B >.meet().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM9.T2.fresh_base(), and com.cliffc.aa.HM.HM9.T2.union().

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

◆ meet_err()

String com.cliffc.aa.HM.HM9.T2.meet_err ( T2  that)
private

Definition at line 1456 of file HM9.java.

1456  {
1457  if( this._err==null ) return that._err;
1458  if( that._err==null ) return this._err;
1459  // TODO: Probably gather unrelated strings in a set
1460  return _uid < that._uid ? _err : that._err;
1461  }

References com.cliffc.aa.HM.HM9.T2._err, and com.cliffc.aa.HM.HM9.T2._uid.

Referenced by com.cliffc.aa.HM.HM9.T2.fresh_base(), and com.cliffc.aa.HM.HM9.T2.union().

Here is the caller graph for this function:

◆ meet_fidxs()

BitsFun com.cliffc.aa.HM.HM9.T2.meet_fidxs ( T2  that)
private

Definition at line 1429 of file HM9.java.

1429  {
1430  if( this._fidxs==null ) return that._fidxs;
1431  if( that._fidxs==null ) return this._fidxs;
1432  return _fidxs.meet(that._fidxs);
1433  }

References com.cliffc.aa.HM.HM9.T2._fidxs, and com.cliffc.aa.type.Bits< B extends Bits< B >.meet().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2.fresh_base(), and com.cliffc.aa.HM.HM9.T2.union().

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

◆ meet_flow()

Type com.cliffc.aa.HM.HM9.T2.meet_flow ( T2  that)
private

Definition at line 1424 of file HM9.java.

1424  {
1425  if( this._flow==null ) return that._flow;
1426  if( that._flow==null ) return this._flow;
1427  return _flow.meet(that._flow);
1428  }

References com.cliffc.aa.HM.HM9.T2._flow, and com.cliffc.aa.type.Type< T extends Type< T >.meet().

Referenced by com.cliffc.aa.HM.HM9.T2.fresh_base(), and com.cliffc.aa.HM.HM9.T2.union().

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

◆ meet_ids()

String [] com.cliffc.aa.HM.HM9.T2.meet_ids ( T2  that)
private

Definition at line 1439 of file HM9.java.

1439  {
1440  String[] ids = that._ids;
1441  if( _ids==ids ) return ids;
1442  if( _ids==null ) return ids;
1443  if( ids==null ) return _ids;
1444  if( _ids.length!=ids.length ) throw unimpl(); // Handled at a higher level
1445  for( String id : ids )
1446  if( Util.find(_ids, id) == -1 )
1447  throw unimpl();
1448  return ids; // Return RHS
1449  }

References com.cliffc.aa.HM.HM9.T2._ids, and com.cliffc.aa.util.Util.find().

Referenced by com.cliffc.aa.HM.HM9.T2.fresh_base(), and com.cliffc.aa.HM.HM9.T2.union().

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

◆ meet_opens()

boolean com.cliffc.aa.HM.HM9.T2.meet_opens ( T2  that)
private

Definition at line 1450 of file HM9.java.

1450  {
1451  if( _open==that._open ) return that._open;
1452  if( !is_struct() ) return that._open;
1453  if( !that.is_struct() ) return _open;
1454  throw unimpl();
1455  }

References com.cliffc.aa.HM.HM9.T2._open, and com.cliffc.aa.HM.HM9.T2.is_struct().

Referenced by com.cliffc.aa.HM.HM9.T2.fresh_base(), and com.cliffc.aa.HM.HM9.T2.union().

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

◆ miss_field()

T2 com.cliffc.aa.HM.HM9.T2.miss_field ( String  id)
package

Definition at line 1315 of file HM9.java.

1315 { return make_err("Missing field "+id+" in "+p()); }

References com.cliffc.aa.HM.HM9.T2.make_err(), and com.cliffc.aa.HM.HM9.T2.p().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM9.T2._unify_struct(), and com.cliffc.aa.HM.HM9.Field.hm().

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

◆ no_uf()

◆ nongen_in()

boolean com.cliffc.aa.HM.HM9.T2.nongen_in ( VStack  vs)
package

Definition at line 1848 of file HM9.java.

1848  {
1849  if( vs==null ) return false;
1850  ODUPS.clear();
1851  for( T2 t2 : vs )
1852  if( _occurs_in_type(t2.find()) )
1853  return true;
1854  return false;
1855  }

References com.cliffc.aa.HM.HM9.T2._occurs_in_type(), and com.cliffc.aa.HM.HM9.T2.ODUPS.

Referenced by com.cliffc.aa.HM.HM9.T2._fresh(), com.cliffc.aa.HM.HM9.T2._fresh_unify(), and com.cliffc.aa.HM.HM9.Ident.add_hm_work().

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

◆ occurs_in_type()

boolean com.cliffc.aa.HM.HM9.T2.occurs_in_type ( T2  x)
package

Definition at line 1843 of file HM9.java.

1843  {
1844  ODUPS.clear();
1845  return _occurs_in_type(x);
1846  }

References com.cliffc.aa.HM.HM9.T2._occurs_in_type(), and com.cliffc.aa.HM.HM9.T2.ODUPS.

Here is the call graph for this function:

◆ p() [1/2]

String com.cliffc.aa.HM.HM9.T2.p ( )

Definition at line 2077 of file HM9.java.

2077 { return p(get_dups(new VBitSet())); }

References com.cliffc.aa.HM.HM9.T2.get_dups(), and com.cliffc.aa.HM.HM9.T2.p().

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.T2.fresh_base(), com.cliffc.aa.HM.HM9.T2.miss_field(), com.cliffc.aa.HM.HM9.T2.p(), and com.cliffc.aa.HM.HM9.T2.union().

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

◆ p() [2/2]

String com.cliffc.aa.HM.HM9.T2.p ( VBitSet  dups)
package

Definition at line 2080 of file HM9.java.

2080 { VCNT=0; VNAMES.clear(); return find()._p(new SB(), new VBitSet(), dups).toString(); }

References com.cliffc.aa.HM.HM9.T2._p(), com.cliffc.aa.HM.HM9.T2.find(), com.cliffc.aa.util.SB.toString(), com.cliffc.aa.HM.HM9.T2.VCNT, and com.cliffc.aa.HM.HM9.T2.VNAMES.

Here is the call graph for this function:

◆ push_update() [1/2]

T2 com.cliffc.aa.HM.HM9.T2.push_update ( Ary< Syntax as)
package

Definition at line 1995 of file HM9.java.

1995 { if( as != null ) for( Syntax a : as ) push_update(a); return this; }

References com.cliffc.aa.HM.HM9.T2.push_update().

Referenced by com.cliffc.aa.HM.HM9.T2.add_fld(), com.cliffc.aa.HM.HM9.Apply.add_val_work(), com.cliffc.aa.HM.HM9.Struct.hm(), com.cliffc.aa.HM.HM9.Field.hm(), com.cliffc.aa.HM.HM9.Lambda.prep_lookup_deps(), com.cliffc.aa.HM.HM9.Let.prep_lookup_deps(), com.cliffc.aa.HM.HM9.NotNil.prep_tree(), com.cliffc.aa.HM.HM9.PrimSyn.PrimSyn(), and com.cliffc.aa.HM.HM9.T2.push_update().

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

◆ push_update() [2/2]

T2 com.cliffc.aa.HM.HM9.T2.push_update ( Syntax  a)
package

Definition at line 1996 of file HM9.java.

1996 { assert UPDATE_VISIT.isEmpty(); push_update_impl(a); UPDATE_VISIT.clear(); return this; }

References com.cliffc.aa.HM.HM9.T2.push_update_impl(), and com.cliffc.aa.HM.HM9.T2.UPDATE_VISIT.

Here is the call graph for this function:

◆ push_update_impl()

void com.cliffc.aa.HM.HM9.T2.push_update_impl ( Syntax  a)
private

Definition at line 1997 of file HM9.java.

1997  {
1998  assert no_uf();
1999  if( UPDATE_VISIT.tset(_uid) ) return;
2000  if( _deps==null ) _deps = new Ary<>(Syntax.class);
2001  if( _deps.find(a)==-1 ) _deps.push(a);
2002  if( _args!=null )
2003  for( int i=0; i<_args.length; i++ )
2004  if( _args[i]!=null )
2005  args(i).push_update_impl(a);
2006  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._deps, com.cliffc.aa.HM.HM9.T2._uid, com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.HM.HM9.T2.push_update_impl(), com.cliffc.aa.util.VBitSet.tset(), and com.cliffc.aa.HM.HM9.T2.UPDATE_VISIT.

Referenced by com.cliffc.aa.HM.HM9.T2.push_update(), and com.cliffc.aa.HM.HM9.T2.push_update_impl().

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

◆ reset()

static void com.cliffc.aa.HM.HM9.T2.reset ( )
staticpackage

Definition at line 2142 of file HM9.java.

2142 { CNT=0; DUPS.clear(); VARS.clear(); ODUPS.clear(); CDUPS.clear(); UPDATE_VISIT.clear(); }

References com.cliffc.aa.HM.HM9.T2.CDUPS, com.cliffc.aa.HM.HM9.T2.CNT, com.cliffc.aa.HM.HM9.T2.DUPS, com.cliffc.aa.HM.HM9.T2.ODUPS, com.cliffc.aa.HM.HM9.T2.UPDATE_VISIT, and com.cliffc.aa.HM.HM9.T2.VARS.

Referenced by com.cliffc.aa.HM.HM9.reset().

Here is the caller graph for this function:

◆ str() [1/2]

static SB com.cliffc.aa.HM.HM9.T2.str ( SB  sb,
VBitSet  visit,
T2  t,
VBitSet  dups 
)
staticprivate

Definition at line 2074 of file HM9.java.

2074 { return t==null ? sb.p("_") : t.str(sb,visit,dups); }

References com.cliffc.aa.util.SB.p(), and com.cliffc.aa.HM.HM9.T2.str().

Here is the call graph for this function:

◆ str() [2/2]

SB com.cliffc.aa.HM.HM9.T2.str ( SB  sb,
VBitSet  visit,
VBitSet  dups 
)
package

Definition at line 2040 of file HM9.java.

2040  {
2041 
2042  if( is_err () ) return sb.p(_err);
2043  if( is_base() ) return sb.p(_flow);
2044  boolean dup = dups.get(_uid);
2045  if( is_leaf() ) {
2046  sb.p(_name);
2047  return no_uf() ? sb : _args[0].str(sb.p(">>"), visit, dups);
2048  }
2049  if( dup ) sb.p("$V").p(_uid);
2050  if( visit.tset(_uid) && dup ) return sb;
2051  if( dup ) sb.p(':');
2052 
2053  // Special printing for functions
2054  if( is_fun() ) {
2055  _fidxs.str(sb.p("{")).p(' ');
2056  for( int i=0; i<_args.length-1; i++ )
2057  str(sb,visit,_args[i],dups).p(" ");
2058  return str(sb.p("-> "),visit,_args[_args.length-1],dups).p(" }");
2059  }
2060 
2061  // Special printing for structures
2062  if( is_struct() ) {
2063  _alias.str(sb.p("@{")).p(' ');
2064  for( int i=0; i<_ids.length; i++ )
2065  str(sb.p(' ').p(_ids[i]).p(" = "),visit,_args[i],dups).p(',');
2066  return sb.unchar().p("}");
2067  }
2068 
2069  // Generic structural T2
2070  sb.p("(").p(_name).p(" ");
2071  for( T2 t : _args ) str(sb,visit,t,dups).p(" ");
2072  return sb.unchar().p(")");
2073  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._err, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2._name, com.cliffc.aa.HM.HM9.T2._uid, com.cliffc.aa.HM.HM9.T2.is_base(), com.cliffc.aa.HM.HM9.T2.is_err(), com.cliffc.aa.HM.HM9.T2.is_fun(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.is_struct(), com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.util.SB.p(), com.cliffc.aa.type.Bits< B extends Bits< B >.str(), com.cliffc.aa.HM.HM9.T2.str(), com.cliffc.aa.util.VBitSet.tset(), and com.cliffc.aa.util.SB.unchar().

Referenced by com.cliffc.aa.HM.HM9.Syntax.p0(), com.cliffc.aa.HM.HM9.VStack.str(), com.cliffc.aa.HM.HM9.T2.str(), and com.cliffc.aa.HM.HM9.T2.toString().

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

◆ toString()

String com.cliffc.aa.HM.HM9.T2.toString ( )

Definition at line 2039 of file HM9.java.

2039 { return str(new SB(), new VBitSet(), get_dups(new VBitSet()) ).toString(); }

References com.cliffc.aa.HM.HM9.T2.get_dups(), com.cliffc.aa.HM.HM9.T2.str(), and com.cliffc.aa.util.SB.toString().

Here is the call graph for this function:

◆ unify()

boolean com.cliffc.aa.HM.HM9.T2.unify ( T2  that,
Worklist  work 
)
package

Definition at line 1528 of file HM9.java.

1528  {
1529  if( this==that ) return false;
1530  assert DUPS.isEmpty();
1531  boolean progress = _unify(that,work);
1532  DUPS.clear();
1533  return progress;
1534  }

References com.cliffc.aa.HM.HM9.T2._unify(), and com.cliffc.aa.HM.HM9.T2.DUPS.

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM9.hm(), com.cliffc.aa.HM.HM9.Lambda.hm(), com.cliffc.aa.HM.HM9.Apply.hm(), com.cliffc.aa.HM.HM9.Root.hm(), com.cliffc.aa.HM.HM9.Struct.hm(), com.cliffc.aa.HM.HM9.Field.hm(), com.cliffc.aa.HM.HM9.PrimSyn.hm(), com.cliffc.aa.HM.HM9.If.hm(), com.cliffc.aa.HM.HM9.NotNil.hm(), and com.cliffc.aa.HM.HM9.Let.prep_tree().

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

◆ union()

boolean com.cliffc.aa.HM.HM9.T2.union ( T2  that,
Worklist  work 
)
package

Definition at line 1474 of file HM9.java.

1474  {
1475  assert no_uf(); // Cannot union twice
1476  assert base_states()<=1 && that.base_states()<=1;
1477  if( this==that ) return false;
1478  if( work==null ) return true; // Report progress without changing
1479  // Keep the merge of all base types, revisiting deps if any changes
1480  if( _flow !=that._flow ||
1481  _fidxs!=that._fidxs ||
1482  _alias!=that._alias ||
1483  _ids !=that._ids ||
1484  _open !=that._open ||
1485  !Util.eq(_err,that._err) )
1486  work.addAll(that._deps); // Any progress, revisit deps
1487  // If flow types are not compatible, return an error now
1488  if( _flow!=null & that._flow!=null && (_flow.widen() != that._flow.widen() && !_flow.isa(that._flow.widen())) )
1489  return union_err(that,work,"Cannot unify "+this.p()+" and "+that.p());
1490  that._flow = meet_flow (that);
1491  that._fidxs = meet_fidxs(that);
1492  that._alias = meet_alias(that);
1493  that._ids = meet_ids (that);
1494  that._open = meet_opens(that);
1495  that._err = meet_err (that);
1496  if( this._flow==Type.XNIL && that.is_struct() ) {
1497  that._alias = that._alias.meet_nil();
1498  that._flow = null;
1499  }
1500  if( that._err!=null ) { // Kill the base types in an error
1501  that._flow=null; that._fidxs=null; that._alias=null; that._ids=null;
1502  }
1503  _flow=null; _fidxs=null; _alias=null; _ids=null; _err=null; // Kill the base types in a unified type
1504 
1505  // Worklist: put updates on the worklist for revisiting
1506  if( _deps != null ) {
1507  work.addAll(_deps); // Re-Apply
1508  // Merge update lists, for future unions
1509  if( that._deps==null && that._args==null ) that._deps = _deps;
1510  else for( Syntax dep : _deps ) that.push_update(dep);
1511  _deps = null;
1512  }
1513  if( _args==null || _args.length!=1 ) _args = new T2[1];
1514  // Unify the two base types, preserving errors
1515  _args[0] = that; // U-F update
1516  _name = "X"+_uid; // Flag as a leaf & unified
1517  assert !no_uf();
1518  return true;
1519  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._deps, com.cliffc.aa.HM.HM9.T2._err, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2._name, com.cliffc.aa.HM.HM9.T2._open, com.cliffc.aa.HM.HM9.T2._uid, com.cliffc.aa.HM.HM9.T2.base_states(), com.cliffc.aa.util.Util.eq(), com.cliffc.aa.type.Type< T extends Type< T >.isa(), com.cliffc.aa.HM.HM9.T2.meet_alias(), com.cliffc.aa.HM.HM9.T2.meet_err(), com.cliffc.aa.HM.HM9.T2.meet_fidxs(), com.cliffc.aa.HM.HM9.T2.meet_flow(), com.cliffc.aa.HM.HM9.T2.meet_ids(), com.cliffc.aa.HM.HM9.T2.meet_opens(), com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.HM.HM9.T2.p(), com.cliffc.aa.HM.HM9.T2.union_err(), com.cliffc.aa.type.Type< T extends Type< T >.widen(), and com.cliffc.aa.type.Type< T extends Type< T >.XNIL.

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify(), com.cliffc.aa.HM.HM9.T2._unify(), com.cliffc.aa.HM.HM9.T2.fresh_base(), and com.cliffc.aa.HM.HM9.T2.union_err().

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

◆ union_err()

boolean com.cliffc.aa.HM.HM9.T2.union_err ( T2  that,
Worklist  work,
String  msg 
)
private

Definition at line 1680 of file HM9.java.

1680  {
1681  that._flow=null; that._fidxs=null; that._alias=null; that._ids=null; // Now kill the base types, since in-error
1682  union(that,work);
1683  return that.union(make_err(msg),work);
1684  }

References com.cliffc.aa.HM.HM9.T2._alias, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.HM.HM9.T2.make_err(), and com.cliffc.aa.HM.HM9.T2.union().

Referenced by com.cliffc.aa.HM.HM9.T2._unify(), and com.cliffc.aa.HM.HM9.T2.union().

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

◆ vput()

boolean com.cliffc.aa.HM.HM9.T2.vput ( T2  that,
boolean  progress 
)
private

Definition at line 1801 of file HM9.java.

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

References com.cliffc.aa.HM.HM9.T2.VARS.

Referenced by com.cliffc.aa.HM.HM9.T2._fresh_unify().

Here is the caller graph for this function:

◆ walk_types_in()

Type com.cliffc.aa.HM.HM9.T2.walk_types_in ( Type  t)
package

Definition at line 1903 of file HM9.java.

1903  {
1904  long duid = dbl_uid(t._uid);
1905  if( Apply.WDUPS.putIfAbsent(duid,"")!=null ) return t;
1906  assert no_uf();
1907  if( t==Type.SCALAR ) return fput(t); // Will be scalar for all the breakdown types
1908  if( is_err() ) return fput(t); //
1909  // Base variables (when widened to an HM type) might force a lift.
1910  if( is_base() ) return fput(_flow.widen().join(t));
1911  // Free variables keep the input flow type.
1912  if( is_leaf() ) return fput(t);
1913  if( is_fun() ) {
1914  if( !(t instanceof TypeFunPtr) ) return t; // Typically some kind of error situation
1915  // TODO: PAIR1 should report better
1916  TypeFunPtr tfp = (TypeFunPtr)t;
1917  T2 ret = args(_args.length-1);
1918  if( tfp._fidxs==BitsFun.FULL ) return ret.walk_types_in(Type. SCALAR);
1919  if( tfp._fidxs==BitsFun.FULL.dual() ) return ret.walk_types_in(Type.XSCALAR);
1920  for( int fidx : ((TypeFunPtr)t)._fidxs ) {
1921  Lambda lambda = Lambda.FUNS.get(fidx);
1922  Type body = lambda.find().is_err()
1923  ? Type.SCALAR // Error, no lift
1924  : (lambda._body == null // Null only for primitives
1925  ? lambda.find().args(lambda._targs.length).as_flow() // Get primitive return type
1926  : lambda._body._flow); // Else use body type
1927  ret.walk_types_in(body);
1928  }
1929  return t;
1930  }
1931 
1932  if( is_struct() ) {
1933  fput(t); // Recursive types need to put themselves first
1934  if( !(t instanceof TypeMemPtr) ) return t;
1935  TypeMemPtr tmp = (TypeMemPtr)t;
1936  if( !(tmp._obj instanceof TypeStruct) ) return t;
1937  TypeStruct ts = (TypeStruct)tmp._obj;
1938  for( int i=0; i<_args.length; i++ ) {
1939  int idx = ts.fld_find(_ids[i]);
1940  // Missing fields are walked as SCALAR
1941  args(i).walk_types_in(idx==-1 ? Type.SCALAR : ts.at(idx));
1942  }
1943  return ts;
1944  }
1945 
1946  throw unimpl();
1947  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.Lambda._body, com.cliffc.aa.type.TypeFunPtr._fidxs, com.cliffc.aa.HM.HM9.T2._fidxs, com.cliffc.aa.HM.HM9.Syntax._flow, com.cliffc.aa.HM.HM9.T2._flow, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.type.TypeMemPtr._obj, com.cliffc.aa.HM.HM9.Lambda._targs, com.cliffc.aa.type.Type< T extends Type< T >._uid, com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.HM.HM9.T2.as_flow(), com.cliffc.aa.type.TypeStruct.at(), com.cliffc.aa.HM.HM9.T2.dbl_uid(), com.cliffc.aa.type.Bits< B extends Bits< B >.dual(), com.cliffc.aa.HM.HM9.Syntax.find(), com.cliffc.aa.type.TypeStruct.fld_find(), com.cliffc.aa.HM.HM9.T2.fput(), com.cliffc.aa.type.BitsFun.FULL, com.cliffc.aa.HM.HM9.Lambda.FUNS, com.cliffc.aa.HM.HM9.T2.is_base(), com.cliffc.aa.HM.HM9.T2.is_err(), com.cliffc.aa.HM.HM9.T2.is_fun(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.is_struct(), com.cliffc.aa.type.Type< T extends Type< T >.join(), com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.putIfAbsent(), com.cliffc.aa.type.Type< T extends Type< T >.SCALAR, com.cliffc.aa.HM.HM9.T2.walk_types_in(), com.cliffc.aa.HM.HM9.Apply.WDUPS, com.cliffc.aa.type.Type< T extends Type< T >.widen(), and com.cliffc.aa.type.Type< T extends Type< T >.XSCALAR.

Referenced by com.cliffc.aa.HM.HM9.Apply.val(), and com.cliffc.aa.HM.HM9.T2.walk_types_in().

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

◆ walk_types_out()

Type com.cliffc.aa.HM.HM9.T2.walk_types_out ( Type  t)
package

Definition at line 1953 of file HM9.java.

1953  {
1954  assert no_uf();
1955  if( t == Type.XSCALAR ) return t; // No lift possible
1956  Type tmap = Apply.T2MAP.get(this);
1957  if( tmap != null ) return tmap;
1958  if( is_err() ) throw unimpl();
1959  assert !is_leaf() && !is_base(); // All output leafs found as inputs already
1960  if( is_fun() ) return t; // No change, already known as a function (and no TFS in the flow types)
1961  if( is_struct() ) {
1962  if( !(t instanceof TypeMemPtr) ) throw unimpl();
1963  TypeMemPtr tmp = (TypeMemPtr)t;
1964  if( !(tmp._obj instanceof TypeStruct) ) throw unimpl();
1965  TypeStruct ts = (TypeStruct)tmp._obj;
1966  boolean progress=false;
1967  for( int i=0; i<_args.length; i++ ) {
1968  int idx = ts.fld_find(_ids[i]);
1969  if( idx==-1 ) continue;
1970  Type targ = ts.at(idx);
1971  Type rez = args(i).walk_types_out(targ);
1972  progress |= targ != rez;
1973  }
1974  if( !progress ) return t;
1975  // Make a new result
1976  TypeFld[] flds = TypeFlds.get(ts.len());
1977  for( int i=0; i<_args.length; i++ ) {
1978  int idx = ts.fld_find(_ids[i]);
1979  if( idx==-1 ) continue;
1980  Type targ = ts.at(idx);
1981  Type rez = args(i).walk_types_out(targ);
1982  flds[i] = ts.fld(i).make_from(rez);
1983  }
1984  return tmp.make_from(ts.make_from(flds));
1985  }
1986  throw unimpl(); // Handled all cases
1987  }

References com.cliffc.aa.HM.HM9.T2._args, com.cliffc.aa.HM.HM9.T2._ids, com.cliffc.aa.type.TypeMemPtr._obj, com.cliffc.aa.HM.HM9.T2.args(), com.cliffc.aa.type.TypeStruct.at(), com.cliffc.aa.type.TypeStruct.fld(), com.cliffc.aa.type.TypeStruct.fld_find(), com.cliffc.aa.type.TypeFlds.get(), com.cliffc.aa.HM.HM9.T2.is_base(), com.cliffc.aa.HM.HM9.T2.is_err(), com.cliffc.aa.HM.HM9.T2.is_fun(), com.cliffc.aa.HM.HM9.T2.is_leaf(), com.cliffc.aa.HM.HM9.T2.is_struct(), com.cliffc.aa.type.TypeStruct.len(), com.cliffc.aa.type.TypeFld.make_from(), com.cliffc.aa.type.TypeMemPtr.make_from(), com.cliffc.aa.type.TypeStruct.make_from(), com.cliffc.aa.HM.HM9.T2.no_uf(), com.cliffc.aa.HM.HM9.Apply.T2MAP, com.cliffc.aa.HM.HM9.T2.walk_types_out(), and com.cliffc.aa.type.Type< T extends Type< T >.XSCALAR.

Referenced by com.cliffc.aa.HM.HM9.Apply.val(), and com.cliffc.aa.HM.HM9.T2.walk_types_out().

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

Member Data Documentation

◆ _alias

◆ _args

◆ _deps

◆ _err

◆ _fidxs

◆ _flow

◆ _ids

◆ _name

◆ _open

◆ _uid

◆ ADUPS

final NonBlockingHashMapLong<TypeStruct> com.cliffc.aa.HM.HM9.T2.ADUPS = new NonBlockingHashMapLong<>()
staticpackage

Definition at line 1374 of file HM9.java.

Referenced by com.cliffc.aa.HM.HM9.T2._as_flow(), and com.cliffc.aa.HM.HM9.T2.as_flow().

◆ CDUPS

final HashMap<T2,T2> com.cliffc.aa.HM.HM9.T2.CDUPS = new HashMap<>()
staticprivate

◆ CNT

◆ DUPS

final HashMap<Long,T2> com.cliffc.aa.HM.HM9.T2.DUPS = new HashMap<>()
staticprivate

◆ ODUPS

final VBitSet com.cliffc.aa.HM.HM9.T2.ODUPS = new VBitSet()
staticprivate

◆ UPDATE_VISIT

◆ VARS

◆ VCNT

int com.cliffc.aa.HM.HM9.T2.VCNT
staticprivate

Definition at line 2078 of file HM9.java.

Referenced by com.cliffc.aa.HM.HM9.T2._p(), and com.cliffc.aa.HM.HM9.T2.p().

◆ VNAMES

final HashMap<T2,Integer> com.cliffc.aa.HM.HM9.T2.VNAMES = new HashMap<>()
staticprivate

Definition at line 2079 of file HM9.java.

Referenced by com.cliffc.aa.HM.HM9.T2._p(), and com.cliffc.aa.HM.HM9.T2.p().


The documentation for this class was generated from the following file:
com.cliffc.aa.type.Bits.dual
B dual()
Definition: Bits.java:368
com.cliffc.aa.HM.HM9.T2.walk_types_out
Type walk_types_out(Type t)
Definition: HM9.java:1953
com.cliffc.aa.HM.HM9.T2.no_uf
boolean no_uf()
Definition: HM9.java:1337
com.cliffc.aa.type.TypeFld.Access.Final
Final
Definition: TypeFld.java:112
com.cliffc.aa.HM.HM9.T2.isa
boolean isa(String name)
Definition: HM9.java:1338
com.cliffc.aa.HM.HM9.T2._ids
String[] _ids
Definition: HM9.java:1295
com.cliffc.aa.HM.HM9.T2.CNT
static int CNT
Definition: HM9.java:1274
com.cliffc.aa.type.TypeFlds.get
TypeFld[] get()
Definition: TypeFlds.java:59
com.cliffc.aa.HM.HM9.T2.make_struct
static T2 make_struct(BitsAlias aliases, String[] ids, T2[] flds)
Definition: HM9.java:1306
com.cliffc.aa.type.Bits.str
SB str(SB sb)
Definition: Bits.java:134
com.cliffc.aa.type.TypeFunPtr
Definition: TypeFunPtr.java:23
com.cliffc.aa.HM.HM9.T2.make_err
static T2 make_err(String s)
Definition: HM9.java:1314
com.cliffc.aa.HM.HM9.T2.meet_flow
Type meet_flow(T2 that)
Definition: HM9.java:1424
com.cliffc.aa.HM.HM9.T2.push_update_impl
void push_update_impl(Syntax a)
Definition: HM9.java:1997
com.cliffc.aa.type.Type.isa
boolean isa(Type t)
Definition: Type.java:623
com.cliffc.aa.HM.HM9.T2.meet_ids
String[] meet_ids(T2 that)
Definition: HM9.java:1439
com.cliffc.aa.util.Util.find
static int find(int[] es, int e)
Definition: Util.java:6
com.cliffc.aa.HM.HM9.T2.DUPS
static final HashMap< Long, T2 > DUPS
Definition: HM9.java:1527
com.cliffc.aa.HM.HM9.T2.T2
T2(@NotNull String name)
Definition: HM9.java:1329
com.cliffc.aa.util.Util.eq
static boolean eq(String s0, String s1)
Definition: Util.java:16
com.cliffc.aa.type.TypeStruct.compute_hash
int compute_hash()
Definition: TypeStruct.java:66
com.cliffc.aa.HM.HM9.T2.is_fun
boolean is_fun()
Definition: HM9.java:1340
com.cliffc.aa.type.Type.join
Type join(Type t)
Definition: Type.java:619
com.cliffc.aa.HM.HM9.T2.cycle_equals
boolean cycle_equals(T2 t)
Definition: HM9.java:1860
com.cliffc.aa.HM.HM9.DEBUG_LEAKS
static final boolean DEBUG_LEAKS
Definition: HM9.java:75
com.cliffc.aa.type.Type.SCALAR
static final Type SCALAR
Definition: Type.java:328
com.cliffc.aa.HM.HM9.T2._uid
final int _uid
Definition: HM9.java:1275
com.cliffc.aa.type.Type.widen
Type widen()
Definition: Type.java:828
com.cliffc.aa.type.TypeStruct.UF
static final NonBlockingHashMapLong< Type > UF
Definition: TypeStruct.java:475
com.cliffc.aa.type.TypeFld
Definition: TypeFld.java:12
com.cliffc.aa.type.Type.XSCALAR
static final Type XSCALAR
Definition: Type.java:329
com.cliffc.aa.HM.HM9.T2.union
boolean union(T2 that, Worklist work)
Definition: HM9.java:1474
com.cliffc.aa.type.Type
an implementation of language AA
Definition: Type.java:94
com.cliffc.aa.util.NonBlockingHashMapLong.clear
void clear()
Removes all of the mappings from this map.
Definition: NonBlockingHashMapLong.java:332
com.cliffc.aa.util.Ary
Definition: Ary.java:11
com.cliffc.aa.type.BitsFun.FULL
static final BitsFun FULL
Definition: BitsFun.java:33
com.cliffc.aa.type.BitsAlias
Definition: BitsAlias.java:8
com.cliffc.aa.HM.HM9.T2._args
T2[] _args
Definition: HM9.java:1283
com.cliffc.aa.type.TypeFld.NO_DISP
static final TypeFld NO_DISP
Definition: TypeFld.java:170
com.cliffc.aa.HM.HM9.T2.base_states
int base_states()
Definition: HM9.java:1462
com.cliffc.aa.type.TypeFunPtr._fidxs
BitsFun _fidxs
Definition: TypeFunPtr.java:26
com.cliffc.aa.type.TypeFlds
Definition: TypeFlds.java:8
com.cliffc.aa.type.Type.ANY
static final Type ANY
Definition: Type.java:325
com.cliffc.aa.type.TypeStruct.install_cyclic
TypeStruct install_cyclic(Ary< Type > reachs)
Definition: TypeStruct.java:422
com.cliffc.aa.HM.HM9.isDigit
static boolean isDigit(byte c)
Definition: HM9.java:254
com.cliffc.aa.type.Type.meet
final Type meet(Type t)
Definition: Type.java:412
com.cliffc.aa.HM.HM9.T2._deps
Ary< Syntax > _deps
Definition: HM9.java:1300
com.cliffc.aa.type.TypeStruct
A memory-based collection of optionally named fields.
Definition: TypeStruct.java:50
com.cliffc.aa.type.TypeMemPtr._obj
TypeObj _obj
Definition: TypeMemPtr.java:26
com.cliffc.aa.type.Type.intern_check
static boolean intern_check()
Definition: Type.java:212
com.cliffc.aa.type.TypeStruct.at
Type at(int idx)
Definition: TypeStruct.java:1013
com.cliffc.aa.HM.HM9.T2.UPDATE_VISIT
static final VBitSet UPDATE_VISIT
Definition: HM9.java:1994
com.cliffc.aa.util.SB.unchar
SB unchar()
Definition: SB.java:58
com.cliffc.aa.HM.HM9.T2._unify_struct
void _unify_struct(T2 that, Worklist work)
Definition: HM9.java:1592
com.cliffc.aa.HM.HM9.T2.fput
Type fput(final Type t)
Definition: HM9.java:1948
com.cliffc.aa.util.VBitSet.tset
boolean tset(int idx)
Definition: VBitSet.java:7
com.cliffc.aa.HM.HM9.T2._as_flow
Type _as_flow()
Definition: HM9.java:1382
com.cliffc.aa.HM.HM9.T2.find
T2 find()
Definition: HM9.java:1355
com.cliffc.aa.HM.HM9.T2._fresh_unify
boolean _fresh_unify(T2 that, VStack nongen, Worklist work)
Definition: HM9.java:1703
com.cliffc.aa.HM.HM9.T2.is_base
boolean is_base()
Definition: HM9.java:1339
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.HM.HM9.T2._err
String _err
Definition: HM9.java:1297
com.cliffc.aa.HM.HM9.T2.is_struct
boolean is_struct()
Definition: HM9.java:1341
com.cliffc.aa.HM.HM9.T2._fidxs
BitsFun _fidxs
Definition: HM9.java:1292
com.cliffc.aa.type.BitsAlias.NIL
static BitsAlias NIL
Definition: BitsAlias.java:27
com.cliffc.aa.type.Type.RECURSIVE_MEET
static int RECURSIVE_MEET
Definition: Type.java:163
com.cliffc.aa.HM.HM9.T2._get_dups
VBitSet _get_dups(VBitSet visit, VBitSet dups)
Definition: HM9.java:2026
com.cliffc.aa.HM.HM9.T2.push_update
T2 push_update(Ary< Syntax > as)
Definition: HM9.java:1995
com.cliffc.aa.HM.HM9.T2.meet_opens
boolean meet_opens(T2 that)
Definition: HM9.java:1450
com.cliffc.aa.util.Util
Definition: Util.java:5
com.cliffc.aa.HM.HM9.T2.is_leaf
boolean is_leaf()
Definition: HM9.java:1336
com.cliffc.aa.HM.HM9.T2.meet_alias
BitsAlias meet_alias(T2 that)
Definition: HM9.java:1434
com.cliffc.aa.HM.HM9.T2.union_err
boolean union_err(T2 that, Worklist work, String msg)
Definition: HM9.java:1680
com.cliffc.aa.HM.HM9.T2.fresh_base
boolean fresh_base(T2 that, Worklist work)
Definition: HM9.java:1642
com.cliffc.aa.HM.HM9.T2.nongen_in
boolean nongen_in(VStack vs)
Definition: HM9.java:1848
com.cliffc.aa.type.TypeStruct.reachable
Ary< Type > reachable()
Definition: TypeStruct.java:779
com.cliffc.aa.HM.HM9.T2.p
String p()
Definition: HM9.java:2077
com.cliffc.aa.HM.HM9.T2.debug_find
T2 debug_find()
Definition: HM9.java:1344
com.cliffc.aa.type.TypeStr.con
static TypeStr con(String con)
Definition: TypeStr.java:42
com.cliffc.aa.type.TypeFunPtr.make
static TypeFunPtr make(BitsFun fidxs, int nargs, Type disp)
Definition: TypeFunPtr.java:67
com.cliffc.aa.HM.HM9.T2.CDUPS
static final HashMap< T2, T2 > CDUPS
Definition: HM9.java:1859
com.cliffc.aa.HM.HM9.T2._occurs_in_type
boolean _occurs_in_type(T2 x)
Definition: HM9.java:1832
com.cliffc.aa.HM.HM9.T2.args
T2 args(int i)
Definition: HM9.java:1363
com.cliffc.aa.HM.HM9.T2.str
SB str(SB sb, VBitSet visit, VBitSet dups)
Definition: HM9.java:2040
com.cliffc.aa.type.TypeStr
Definition: TypeStr.java:14
com.cliffc.aa.HM.HM9.T2.meet_fidxs
BitsFun meet_fidxs(T2 that)
Definition: HM9.java:1429
com.cliffc.aa.util.VBitSet
Definition: VBitSet.java:5
com.cliffc.aa.HM.HM9.id
static String id()
Definition: HM9.java:224
com.cliffc.aa.HM.HM9.T2.miss_field
T2 miss_field(String id)
Definition: HM9.java:1315
com.cliffc.aa.type.BitsFun
Definition: BitsFun.java:7
com.cliffc.aa.util.SB
Tight/tiny StringBuilder wrapper.
Definition: SB.java:8
com.cliffc.aa.type.TypeFld.malloc
static TypeFld malloc(String fld, Type t, Access access, int order)
Definition: TypeFld.java:53
com.cliffc.aa.HM.HM9.T2.add_deps_work_impl
void add_deps_work_impl(Worklist work)
Definition: HM9.java:2010
com.cliffc.aa.HM.HM9.T2.is_tuple
boolean is_tuple()
Definition: HM9.java:2134
com.cliffc.aa.type.TypeStruct.len
int len(TypeStruct tt)
Definition: TypeStruct.java:865
com.cliffc.aa.type.TypeStruct.fld_find
int fld_find(String fld)
Definition: TypeStruct.java:1038
com.cliffc.aa.HM.HM9.T2.meet_err
String meet_err(T2 that)
Definition: HM9.java:1456
com.cliffc.aa.HM.HM9.T2._unify
boolean _unify(T2 that, Worklist work)
Definition: HM9.java:1539
com.cliffc.aa.HM.HM9.T2.vput
boolean vput(T2 that, boolean progress)
Definition: HM9.java:1801
com.cliffc.aa.type.TypeStruct.fld
TypeFld fld(int idx)
Definition: TypeStruct.java:1012
com.cliffc.aa.type.Type._uid
int _uid
Definition: Type.java:96
com.cliffc.aa.HM.HM9.T2._can_be_HM_base
boolean _can_be_HM_base(T2 that, Type that_flow)
Definition: HM9.java:1672
com.cliffc.aa.type.TypeStruct.make_from
TypeStruct make_from(String name)
Definition: TypeStruct.java:215
com.cliffc.aa.type.BitsAlias.STRBITS
static BitsAlias STRBITS
Definition: BitsAlias.java:27
com.cliffc.aa.util.SB.p
SB p(String s)
Definition: SB.java:13
com.cliffc.aa.HM.HM9.T2.VNAMES
static final HashMap< T2, Integer > VNAMES
Definition: HM9.java:2079
com.cliffc.aa.HM.HM9.T2.dbl_uid
long dbl_uid(T2 t)
Definition: HM9.java:1639
com.cliffc.aa.HM.HM9.T2._flow
Type _flow
Definition: HM9.java:1291
com.cliffc.aa.HM.HM9.T2._p
SB _p(SB sb, VBitSet visit, VBitSet dups)
Definition: HM9.java:2081
com.cliffc.aa.HM.HM9.T2.walk_types_in
Type walk_types_in(Type t)
Definition: HM9.java:1903
com.cliffc.aa.HM.HM9.T2.ADUPS
static final NonBlockingHashMapLong< TypeStruct > ADUPS
Definition: HM9.java:1374
com.cliffc.aa.type.TypeStruct.shrink
static TypeStruct shrink(Ary< Type > reaches, TypeStruct tstart)
Definition: TypeStruct.java:657
com.cliffc.aa.HM.HM9.T2._cycle_equals_struct
boolean _cycle_equals_struct(T2 t)
Definition: HM9.java:1890
com.cliffc.aa.type.Type.XNIL
static final Type XNIL
Definition: Type.java:333
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.HM.HM9.T2._alias
BitsAlias _alias
Definition: HM9.java:1294
com.cliffc.aa.HM.HM9.T2.copy
T2 copy()
Definition: HM9.java:1316
com.cliffc.aa.type.TypeStruct.malloc
static TypeStruct malloc(String name, boolean any, TypeFld[] flds, boolean open)
Definition: TypeStruct.java:175
com.cliffc.aa.type.TypeFld.Access
Definition: TypeFld.java:109
com.cliffc.aa.type.Bits.meet
B meet(final B bs)
Definition: Bits.java:298
com.cliffc.aa.HM.HM9.T2._name
String _name
Definition: HM9.java:1280
com.cliffc.aa.type.TypeStruct._cyclic
boolean _cyclic
Definition: TypeStruct.java:54
com.cliffc.aa.HM.HM9.T2._open
boolean _open
Definition: HM9.java:1296
com.cliffc.aa.type.TypeFld.make_from
TypeFld make_from(Type t)
Definition: TypeFld.java:66
com.cliffc.aa.type.TypeMemPtr.make_from
TypeMemPtr make_from(TypeObj obj)
Definition: TypeMemPtr.java:73
com.cliffc.aa.util.SB.toString
String toString()
Definition: SB.java:62
com.cliffc.aa.HM.HM9.T2.ODUPS
static final VBitSet ODUPS
Definition: HM9.java:1831
com.cliffc.aa.HM.HM9.T2._cycle_equals
boolean _cycle_equals(T2 t)
Definition: HM9.java:1866
com.cliffc.aa.type.TypeMemPtr
Definition: TypeMemPtr.java:14
com.cliffc.aa.HM.HM9.T2.get_dups
VBitSet get_dups(VBitSet dups)
Definition: HM9.java:2025
com.cliffc.aa.HM.HM9.T2._fresh_unify_struct
boolean _fresh_unify_struct(T2 that, VStack nongen, Worklist work)
Definition: HM9.java:1762
com.cliffc.aa.HM.HM9.T2.is_err
boolean is_err()
Definition: HM9.java:1342
com.cliffc.aa.HM.HM9.T2.VARS
static final HashMap< T2, T2 > VARS
Definition: HM9.java:1691
com.cliffc.aa.HM.HM9.T2._fresh
T2 _fresh(VStack nongen)
Definition: HM9.java:1810
com.cliffc.aa.HM.HM9.T2.VCNT
static int VCNT
Definition: HM9.java:2078
com.cliffc.aa.type.TypeMemPtr.make
static TypeMemPtr make(BitsAlias aliases, TypeObj obj)
Definition: TypeMemPtr.java:66