aa
com.cliffc.aa.HM.HM.T2 Class Reference
Inheritance diagram for com.cliffc.aa.HM.HM.T2:
[legend]
Collaboration diagram for com.cliffc.aa.HM.HM.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 find (int uid)
 
BitsFun find_fidxs ()
 
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_nilable ()
 
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 unify_nil (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_nil (T2 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 _find (int uid, VBitSet visit)
 
T2 _find0 ()
 
void _find_fidxs ()
 
T2 _find_nil ()
 
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)
 
boolean _union (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 FIDX_VISIT = new VBitSet()
 
static BitsFun FIDXS = null
 
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 1291 of file HM.java.

Constructor & Destructor Documentation

◆ T2() [1/2]

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

Definition at line 1348 of file HM.java.

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

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

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

Here is the caller graph for this function:

◆ T2() [2/2]

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

Definition at line 1349 of file HM.java.

1349  {
1350  this(name);
1351  _args= args;
1352  }

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

Here is the call graph for this function:

Member Function Documentation

◆ _as_flow()

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

Definition at line 1434 of file HM.java.

1434  {
1435  assert no_uf();
1436  if( is_base() ) return _flow;
1437  if( is_leaf() ) return Type.SCALAR;
1439  if( is_fun() ) return TypeFunPtr.make(_fidxs,_args.length-1,Type.ANY);
1440  if( is_nilable() ) return Type.SCALAR;
1441  if( is_struct() ) {
1442  TypeStruct tstr = ADUPS.get(_uid);
1443  if( tstr==null ) {
1444  Type.RECURSIVE_MEET++;
1445  TypeFld[] ts = TypeFlds.get(_ids.length+1);
1446  ts[0] = TypeFld.NO_DISP;
1447  for( int i=0; i<_ids.length; i++ )
1448  ts[i+1] = TypeFld.malloc(_ids[i],null,Access.Final,i+1);
1449  tstr = TypeStruct.malloc("",false,ts,true);
1450  tstr._hash = tstr.compute_hash();
1451  ADUPS.put(_uid,tstr); // Stop cycles
1452  for( int i=0; i<_ids.length; i++ )
1453  ts[i+1].setX(args(i)._as_flow()); // Recursive
1454  if( --Type.RECURSIVE_MEET == 0 ) {
1455  // Shrink / remove cycle dups. Might make new (smaller)
1456  // TypeStructs, so keep RECURSIVE_MEET enabled.
1457  Type.RECURSIVE_MEET++;
1458  tstr = TypeStruct.shrink(tstr.reachable(),tstr);
1459  TypeStruct.UF.clear();
1460  Type.RECURSIVE_MEET--;
1461  // Walk the final cyclic structure and intern everything.
1462  tstr.install_cyclic(tstr.reachable());
1463  }
1464  } else {
1465  tstr._cyclic=true; // Been there, done that, just mark it cyclic
1466  }
1467  return TypeMemPtr.make(_alias,tstr);
1468  }
1469 
1470  throw unimpl();
1471  }

References com.cliffc.aa.HM.HM.T2._alias, com.cliffc.aa.HM.HM.T2._args, com.cliffc.aa.type.TypeStruct._cyclic, com.cliffc.aa.HM.HM.T2._err, com.cliffc.aa.HM.HM.T2._fidxs, com.cliffc.aa.HM.HM.T2._flow, com.cliffc.aa.HM.HM.T2._ids, com.cliffc.aa.HM.HM.T2._uid, com.cliffc.aa.HM.HM.T2.ADUPS, com.cliffc.aa.type.Type< T extends Type< T >.ANY, com.cliffc.aa.HM.HM.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.HM.T2.is_base(), com.cliffc.aa.HM.HM.T2.is_err(), com.cliffc.aa.HM.HM.T2.is_fun(), com.cliffc.aa.HM.HM.T2.is_leaf(), com.cliffc.aa.HM.HM.T2.is_nilable(), com.cliffc.aa.HM.HM.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.HM.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.HM.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.HM.T2._can_be_HM_base ( T2  that,
Type  that_flow 
)
private

Definition at line 1749 of file HM.java.

1749  {
1750  if( that.base_states() > 1 ) return false;
1751  if( _flow==null || that_flow==null ) return true;
1752  Type wthisflow = _flow.widen();
1753  Type wthatflow = that_flow.widen();
1754  if( wthisflow==wthatflow ) return true;
1755  return wthisflow.isa(wthatflow);
1756  }

References com.cliffc.aa.HM.HM.T2._flow, com.cliffc.aa.HM.HM.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.HM.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.HM.T2._cycle_equals ( T2  t)
package

Definition at line 1968 of file HM.java.

1968  {
1969  assert no_uf() && t.no_uf();
1970  if( this==t ) return true;
1971  if( _flow !=t._flow || // Base-cases have to be completely identical
1972  _fidxs!=t._fidxs ||
1973  _alias!=t._alias ||
1974  !Util.eq(_err,t._err) )
1975  return false;
1976  if( !Util.eq(_name,t._name) ) return false; // Wrong type-var names
1977  if( _args==t._args ) return true; // Same arrays (generally both null)
1978  if( _args.length != t._args.length ) // Mismatched sizes
1979  return false;
1980  // Cycles stall the equal/unequal decision until we see a difference.
1981  T2 tc = CDUPS.get(this);
1982  if( tc!=null ) return tc==t; // Cycle check; true if both cycling the same
1983  CDUPS.put(this,t);
1984  if( is_struct() ) // Struct equality honors field names without regard to order
1985  return _cycle_equals_struct(t);
1986  for( int i=0; i<_args.length; i++ )
1987  if( !args(i)._cycle_equals(t.args(i)) )
1988  return false;
1989  return true;
1990  }

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

Referenced by com.cliffc.aa.HM.HM.T2._cycle_equals_struct(), and com.cliffc.aa.HM.HM.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.HM.T2._cycle_equals_struct ( T2  t)
private

Definition at line 1992 of file HM.java.

1992  {
1993  assert is_struct() && t.is_struct();
1994  for( int i=0; i<_args.length; i++ ) {
1995  int idx = Util.find(t._ids,_ids[i]);
1996  if( idx==-1 || !args(i)._cycle_equals(t.args(idx)) )
1997  return false;
1998  }
1999  return true;
2000  }

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

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

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

◆ _find()

T2 com.cliffc.aa.HM.HM.T2._find ( int  uid,
VBitSet  visit 
)
private

Definition at line 2279 of file HM.java.

2279  {
2280  if( visit.tset(_uid) ) return null;
2281  if( _uid==uid ) return this;
2282  if( _args==null ) return null;
2283  for( T2 arg : _args )
2284  if( (arg=arg._find(uid,visit)) != null )
2285  return arg;
2286  return null;
2287  }

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

Referenced by com.cliffc.aa.HM.HM.T2.find().

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

◆ _find0()

T2 com.cliffc.aa.HM.HM.T2._find0 ( )
private

Definition at line 1379 of file HM.java.

1379  {
1380  T2 u = debug_find();
1381  if( u==this || u==_args[0] ) return u;
1382  T2 v = this, v2;
1383  // UF fixup
1384  while( v.is_leaf() && (v2=v._args[0])!=u ) { v._args[0]=u; v = v2; }
1385  return u;
1386  }

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

Referenced by com.cliffc.aa.HM.HM.T2.find().

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

◆ _find_fidxs()

void com.cliffc.aa.HM.HM.T2._find_fidxs ( )
private

Definition at line 2101 of file HM.java.

2101  {
2102  if( FIDX_VISIT.tset(_uid) ) return;
2103  if( is_struct() )
2104  for( T2 arg : _args )
2105  arg._find_fidxs();
2106  if( is_fun() ) {
2107  FIDXS = FIDXS.meet(_fidxs);
2108  args(_args.length-1)._find_fidxs();
2109  }
2110  }

References com.cliffc.aa.HM.HM.T2._args, com.cliffc.aa.HM.HM.T2._fidxs, com.cliffc.aa.HM.HM.T2._find_fidxs(), com.cliffc.aa.HM.HM.T2._uid, com.cliffc.aa.HM.HM.T2.args(), com.cliffc.aa.HM.HM.T2.FIDX_VISIT, com.cliffc.aa.HM.HM.T2.FIDXS, com.cliffc.aa.HM.HM.T2.is_fun(), com.cliffc.aa.HM.HM.T2.is_struct(), com.cliffc.aa.type.Bits< B extends Bits< B >.meet(), and com.cliffc.aa.util.VBitSet.tset().

Referenced by com.cliffc.aa.HM.HM.T2._find_fidxs(), and com.cliffc.aa.HM.HM.T2.find_fidxs().

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

◆ _find_nil()

T2 com.cliffc.aa.HM.HM.T2._find_nil ( )
private

Definition at line 1389 of file HM.java.

1389  {
1390  T2 n = args(0);
1391  if( n.is_leaf() ) return this;
1392  // Nested nilable-and-not-leaf, need to fixup the nilable
1393  if( n.is_base() ) {
1394  _flow = n._flow .meet_nil(Type.XNIL);
1395  _args = null;
1396  _name = n._name;
1397  } else if( n.is_struct() ) {
1398  _alias= n._alias.meet_nil();
1399  _args = n._args.clone();
1400  _ids = n._ids.clone();
1401  _open = n._open;
1402  _name = n._name;
1403  } else if( n.is_nilable() ) {
1404  _args[0] = n.args(0);
1405  } else
1406  throw unimpl();
1407 
1408  if( n._deps!=null ) {
1409  if( _deps == null ) _deps = n._deps;
1410  else _deps.addAll(n._deps);
1411  }
1412  return this;
1413  }

References com.cliffc.aa.HM.HM.T2._alias, com.cliffc.aa.HM.HM.T2._args, com.cliffc.aa.HM.HM.T2._deps, com.cliffc.aa.HM.HM.T2._flow, com.cliffc.aa.HM.HM.T2._ids, com.cliffc.aa.HM.HM.T2._name, com.cliffc.aa.HM.HM.T2._open, com.cliffc.aa.HM.HM.T2.args(), com.cliffc.aa.HM.HM.T2.is_base(), com.cliffc.aa.HM.HM.T2.is_leaf(), com.cliffc.aa.HM.HM.T2.is_nilable(), com.cliffc.aa.HM.HM.T2.is_struct(), com.cliffc.aa.type.Bits< B extends Bits< B >.meet_nil(), com.cliffc.aa.type.Type< T extends Type< T >.meet_nil(), and com.cliffc.aa.type.Type< T extends Type< T >.XNIL.

Referenced by com.cliffc.aa.HM.HM.T2.find().

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

◆ _fresh()

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

Definition at line 1904 of file HM.java.

1904  {
1905  assert no_uf();
1906  T2 rez = VARS.get(this);
1907  if( rez!=null ) return rez; // Been there, done that
1908  // Unlike the original algorithm, to handle cycles here we stop making a
1909  // copy if it appears at this level in the nongen set. Otherwise we'd
1910  // clone it down to the leaves - and keep all the nongen leaves.
1911  // Stopping here preserves the cyclic structure instead of unrolling it.
1912  if( nongen_in(nongen) ) {
1913  VARS.put(this,this);
1914  return this;
1915  }
1916 
1917  if( is_leaf() ) {
1918  // If occurs_in lexical scope, keep same variable, else make a new leaf
1919  T2 t = T2.make_leaf();
1920  VARS.put(this,t);
1921  return t;
1922  } else { // Structure is deep-replicated
1923  T2 t = copy();
1924  VARS.put(this,t); // Stop cyclic structure looping
1925  if( _args!=null )
1926  for( int i=0; i<_args.length; i++ )
1927  t._args[i] = args(i)._fresh(nongen);
1928  return t;
1929  }
1930  }

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

Referenced by com.cliffc.aa.HM.HM.T2._fresh(), com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._fresh_unify_struct(), and com.cliffc.aa.HM.HM.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.HM.T2._fresh_unify ( T2  that,
VStack  nongen,
Worklist  work 
)
private

Definition at line 1780 of file HM.java.

1780  {
1781  assert no_uf() && that.no_uf();
1782  T2 prior = VARS.get(this);
1783  if( prior!=null ) // Been there, done that
1784  return prior.find()._unify(that,work); // Also 'prior' needs unification with 'that'
1785  if( cycle_equals(that) ) return vput(that,false);
1786 
1787  if( that.is_err() ) return vput(that,false); // That is an error, ignore 'this' and no progress
1788  if( this.is_err() ) return vput(that,_unify(that,work));
1789 
1790  // In the non-generative set, so do a hard unify, not a fresh-unify.
1791  if( nongen_in(nongen) ) return vput(that,_unify(that,work)); // Famous 'occurs-check', switch to normal unify
1792 
1793  // LHS is a leaf, base, or error
1794  if( this._args==null ) return vput(that,fresh_base(that,work));
1795  if( that.is_leaf() ) // RHS is a tvar; union with a deep copy of LHS
1796  return work==null || vput(that,that.union(_fresh(nongen),work));
1797 
1798  // Special handling for nilable
1799  if( this.is_nilable() && !that.is_nilable() ) {
1800  if( that.is_base() ) {
1801  Type mt = that._flow.meet_nil(Type.XNIL);
1802  if( mt==that._flow ) return false; // Nilable already
1803  if( work!=null ) that._flow = mt;
1804  return true;
1805  }
1806  if( that.is_struct() ) {
1807  if( that._alias.test(0) ) return false; // Nilable already
1808  throw unimpl();
1809  }
1810 
1811  throw unimpl();
1812  }
1813  // That is nilable and this is not
1814  if( that.is_nilable() && !this.is_nilable() ) {
1815  if( this.is_struct() ) {
1816  // fresh_unify a not-nil version of this with the not-nil version of that
1817  T2 copy = this;
1818  if( copy._alias.test(0) ) { // make a not=nil version of struct
1819  copy = this.copy();
1820  copy._alias = copy._alias.clear(0);
1821  System.arraycopy(this._args,0,copy._args,0,this._args.length);
1822  }
1823  boolean progress = copy._fresh_unify(that.args(0),nongen,work);
1824  return _alias.test(0) ? vput(that,progress) : progress;
1825  }
1826  throw unimpl();
1827  }
1828 
1829  if( !Util.eq(_name,that._name) ||
1830  (!is_struct() && _args.length != that._args.length) )
1831  return work == null || vput(that,that._unify(make_err("Cannot unify "+this.p()+" and "+that.p()),work));
1832 
1833  // Structural recursion unification, lazy on LHS
1834  vput(that,false); // Early set, to stop cycles
1835  boolean progress = false;
1836  if( is_struct() )
1837  progress = _fresh_unify_struct(that,nongen,work);
1838  else {
1839  for( int i=0; i<_args.length; i++ ) {
1840  progress |= args(i)._fresh_unify(that.args(i),nongen,work);
1841  if( progress && work==null ) return true;
1842  if( (that=that.find()).is_err() ) return true;
1843  }
1844  if( is_fun() ) {
1845  BitsFun fidxs = meet_fidxs(that);
1846  if( fidxs!=that._fidxs ) progress=true;
1847  if( progress && work==null ) return true;
1848  that._fidxs = fidxs;
1849  }
1850  }
1851  return progress;
1852  }

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

Referenced by com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._fresh_unify_struct(), and com.cliffc.aa.HM.HM.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.HM.T2._fresh_unify_struct ( T2  that,
VStack  nongen,
Worklist  work 
)
private

Definition at line 1855 of file HM.java.

1855  {
1856  assert is_struct() && that.is_struct();
1857  boolean progress = false;
1858  // Unification for structs is more complicated; args are aligned via
1859  // field names and not by position. Conceptually, fields in one struct
1860  // and not the other are put in both before unifying the structs. Open
1861  // structs copy from the other side; closed structs insert a missing
1862  // field error.
1863  for( int i=0; i<_ids.length; i++ ) {
1864  int idx = Util.find(that._ids,_ids[i]);
1865  if( idx == -1 ) { // Missing field on RHS
1866  if( work==null ) return true; // Will definitely make progress
1867  progress = true;
1868  // if both are closed, error on RHS
1869  that.add_fld(_ids[i], that._open ? args(i)._fresh(nongen) : that.miss_field(_ids[i]), work);
1870  } else
1871  progress |= args(i)._fresh_unify(that.args(idx),nongen,work);
1872  if( (that=that.find()).is_err() ) return true;
1873  if( progress && work==null ) return true;
1874  }
1875  // Fields in RHS and not the LHS are also merged; if the LHS is open we'd
1876  // just copy the missing fields into it, then unify the structs
1877  // (shortcut: just skip the copy). If the LHS is closed, then the extra
1878  // RHS fields are an error.
1879  if( !_open )
1880  for( int i=0; i<that._ids.length; i++ ) // For all fields in RHS
1881  if( Util.find(_ids,that._ids[i]) == -1 &&// Missing in LHS
1882  !that.args(i).is_err() ) { // And not yet an error
1883  if( work == null ) return true; // Will definitely make progress
1884  progress |= that.args(i).unify(miss_field(that._ids[i]), work);
1885  }
1886 
1887  // Unify aliases
1888  BitsAlias alias = meet_alias(that);
1889  if( alias!=that._alias ) progress=true;
1890  if( progress && work==null ) return true;
1891  that._alias = alias;
1892  return progress;
1893  }

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

Referenced by com.cliffc.aa.HM.HM.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.HM.T2._get_dups ( VBitSet  visit,
VBitSet  dups 
)
package

Definition at line 2149 of file HM.java.

2149  {
2150  if( visit.tset(_uid) ) {
2151  dups.set(debug_find()._uid);
2152  } else
2153  if( _args!=null )
2154  for( T2 t : _args )
2155  if( t!=null )
2156  t._get_dups(visit,dups);
2157  return dups;
2158  }

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

Referenced by com.cliffc.aa.HM.HM.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.HM.T2._occurs_in_type ( T2  x)
package

Definition at line 1934 of file HM.java.

1934  {
1935  assert no_uf() && x.no_uf();
1936  if( x==this ) return true;
1937  if( ODUPS.tset(x._uid) ) return false; // Been there, done that
1938  if( !x.is_leaf() && x._args!=null )
1939  for( int i=0; i<x._args.length; i++ )
1940  if( _occurs_in_type(x.args(i)) )
1941  return true;
1942  return false;
1943  }

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

Referenced by com.cliffc.aa.HM.HM.T2.nongen_in(), and com.cliffc.aa.HM.HM.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.HM.T2._p ( SB  sb,
VBitSet  visit,
VBitSet  dups 
)
private

Definition at line 2209 of file HM.java.

2209  {
2210  assert no_uf();
2211  if( is_base() ) return sb.p(_flow); // One-shot bases just do type
2212  if( is_leaf() || dups.get(_uid) ) { // Leafs or Duplicates? Take some effort to pretty-print cycles
2213  Integer ii = VNAMES.get(this);
2214  if( ii==null ) VNAMES.put(this,ii=VCNT++); // Type-var name
2215  // 2nd and later visits use the short form
2216  boolean later = visit.tset(_uid);
2217  // Removed as being more confusing to more academic readers
2218  //if( later ) sb.p('$');
2219  char c = (char)('A'+ii);
2220  if( c<'V' ) sb.p(c); else sb.p("V"+ii);
2221  if( later ) return sb;
2222  if( is_leaf() ) return sb;
2223  sb.p(':'); // Dups now print their structure
2224  }
2225  if( is_err () ) return sb.p(_err);
2226 
2227  // Special printing for functions: { arg -> body }
2228  if( is_fun() ) {
2229  sb.p("{ ");
2230  for( int i=0; i<_args.length-1; i++ )
2231  args(i)._p(sb,visit,dups).p(" ");
2232  return args(_args.length-1)._p(sb.p("-> "),visit,dups).p(" }");
2233  }
2234 
2235  // Special printing for structures: @{ fld0 = body, fld1 = body, ... }
2236  if( is_struct() ) {
2237  if( is_tuple() ) {
2238  if( _ids.length == 0 ) return sb.p("()");
2239  sb.p('(');
2240  for( int i=0; i<_ids.length; i++ ) {
2241  int idx = Util.find(_ids,new String(new char[]{(char)('0'+i)}).intern());
2242  args(idx)._p(sb.p(' '),visit,dups).p(',');
2243  }
2244  sb.unchar().p(')');
2245 
2246  } else {
2247  sb.p("@{");
2248  TreeMap<String,Integer> map = new TreeMap<>();
2249  for( int i=0; i<_ids.length; i++ )
2250  map.put( _ids[i], i );
2251  for( int i : map.values() )
2252  args(i)._p(sb.p(' ').p(_ids[i]).p(" = "),visit,dups).p(',');
2253  sb.unchar().p("}");
2254  }
2255  //return _alias.str(sb);
2256  if( _alias.test(0) ) sb.p('?');
2257  return sb;
2258  }
2259 
2260  if( is_nilable() )
2261  return args(0)._p(sb,visit,dups).p('?');
2262 
2263  // Generic structural T2: (fun arg0 arg1...)
2264  sb.p("(").p(_name).p(" ");
2265  for( int i=0; i<_args.length; i++ ) args(i)._p(sb,visit,dups).p(" ");
2266  return sb.unchar().p(")");
2267  }

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

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

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

◆ _unify()

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

Definition at line 1615 of file HM.java.

1615  {
1616  assert no_uf() && that.no_uf();
1617  if( this==that ) return false;
1618 
1619  // All leaf types immediately unify.
1620  if( this._args==null && that._args==null ) {
1621  T2 lhs=this, rhs=that;
1622  if( is_err() || // Errors beat all others
1623  (!that.is_err() && is_base()) )
1624  { rhs=this; lhs=that; } // Base beats plain leaf
1625  // If tied, keep lower uid
1626  if( Util.eq(lhs._name,rhs._name) && _uid<that._uid ) { rhs=this; lhs=that; }
1627  return lhs.union(rhs,work);
1628  }
1629  // Any leaf immediately unifies with any non-leaf
1630  if( this.is_leaf() || that.is_err() ) return this.union(that,work);
1631  if( that.is_leaf() || this.is_err() ) return that.union(this,work);
1632  // Special case for nilable union something
1633  if( this.is_nilable() && !that.is_nilable() ) return this.unify_nil(that,work);
1634  if( that.is_nilable() && !this.is_nilable() ) return that.unify_nil(this,work);
1635 
1636  // Cycle check
1637  long luid = dbl_uid(that); // long-unique-id formed from this and that
1638  T2 rez = DUPS.get(luid);
1639  assert rez==null || rez==that;
1640  if( rez!=null ) return false; // Been there, done that
1641  DUPS.put(luid,that); // Close cycles
1642 
1643  if( work==null ) return true; // Here we definitely make progress; bail out early if just testing
1644 
1645  if( !Util.eq(_name,that._name) )
1646  return union_err(that,work,"Cannot unify "+this.p()+" and "+that.p());
1647  assert _args!=that._args; // Not expecting to share _args and not 'this'
1648 
1649  // Structural recursion unification.
1650 
1651  // Structs unify only on matching fields, and add missing fields.
1652  if( is_struct() ) {
1653  _unify_struct(that,work);
1654  that = that.find();
1655  } else { // Normal structural unification
1656  for( int i=0; i<_args.length; i++ ) { // For all fields in LHS
1657  args(i)._unify(that.args(i),work);
1658  if( (that=that.find()).is_err() ) break;
1659  }
1660  }
1661  if( find().is_err() && !that.is_err() )
1662  // TODO: Find a more elegant way to preserve errors
1663  return that.union(find(),work); // Preserve errors
1664  return find().union(that,work);
1665  }

References com.cliffc.aa.HM.HM.T2._args, com.cliffc.aa.HM.HM.T2._name, com.cliffc.aa.HM.HM.T2._uid, com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.T2._unify_struct(), com.cliffc.aa.HM.HM.T2.args(), com.cliffc.aa.HM.HM.T2.dbl_uid(), com.cliffc.aa.HM.HM.T2.DUPS, com.cliffc.aa.util.Util.eq(), com.cliffc.aa.HM.HM.T2.find(), com.cliffc.aa.HM.HM.T2.is_base(), com.cliffc.aa.HM.HM.T2.is_err(), com.cliffc.aa.HM.HM.T2.is_leaf(), com.cliffc.aa.HM.HM.T2.is_nilable(), com.cliffc.aa.HM.HM.T2.is_struct(), com.cliffc.aa.HM.HM.T2.no_uf(), com.cliffc.aa.HM.HM.T2.p(), com.cliffc.aa.HM.HM.T2.unify_nil(), com.cliffc.aa.HM.HM.T2.union(), and com.cliffc.aa.HM.HM.T2.union_err().

Referenced by com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.T2._unify_struct(), and com.cliffc.aa.HM.HM.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.HM.T2._unify_struct ( T2  that,
Worklist  work 
)
private

Definition at line 1667 of file HM.java.

1667  {
1668  assert this.is_struct() && that.is_struct();
1669  T2 thsi = this;
1670  // Unification for structs is more complicated; args are aligned via
1671  // field names and not by position. Conceptually, fields in one struct
1672  // and not the other are put in both before unifying the structs. Open
1673  // structs copy from the other side; closed structs insert a missing
1674  // field error.
1675  for( int i=0; i<thsi._ids.length; i++ ) { // For all fields in LHS
1676  int idx = Util.find(that._ids,thsi._ids[i]);
1677  if( idx==-1 ) // Missing that field? Copy from left if open, error if closed.
1678  that.add_fld(thsi._ids[i], that._open ? thsi.args(i) : that.miss_field(thsi._ids[i]), work);
1679  else thsi.args(i)._unify(that.args(idx),work); // Unify matching field
1680  if( (that=that.find()).is_err() ) return; // Recursively, might have already rolled this up
1681  thsi = thsi.find(); assert thsi.is_struct();
1682  }
1683  // Fields in RHS and not the LHS are also merged; if the LHS is open we'd
1684  // just copy the missing fields into it, then unify the structs
1685  // (shortcut: just skip the copy). If the LHS is closed, then the extra
1686  // RHS fields are an error.
1687  if( !thsi._open ) // LHS is closed, so extras in RHS are errors
1688  for( int i=0; i<that._ids.length; i++ ) // For all fields in RHS
1689  if( Util.find(thsi._ids,that._ids[i]) == -1 ) // Missing in LHS
1690  that.args(i)._unify(miss_field(that._ids[i]),work); // If closed, extra field is an error
1691  // Shortcut (for asserts): LHS gets same ids as RHS, since its about to be top-level unified
1692  thsi._ids = that._ids;
1693  thsi._open= that._open;
1694  }

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

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

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

◆ _union()

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

Definition at line 1578 of file HM.java.

1578  {
1579  assert that.no_uf();
1580  _flow=null; _fidxs=null; _alias=null; _ids=null; _err=null; // Kill the base types in a unified type
1581  // Worklist: put updates on the worklist for revisiting
1582  if( _deps != null ) {
1583  work.addAll(_deps); // Re-Apply
1584  // Merge update lists, for future unions
1585  if( that._deps==null && that._args==null ) that._deps = _deps;
1586  else for( Syntax dep : _deps ) that.push_update(dep);
1587  _deps = null;
1588  }
1589  if( _args==null || _args.length!=1 ) _args = new T2[1];
1590  // Unify the two base types, preserving errors
1591  _args[0] = that; // U-F update
1592  _name = "X"+_uid; // Flag as a leaf & unified
1593  assert !no_uf();
1594  return true;
1595  }

References com.cliffc.aa.HM.HM.T2._alias, com.cliffc.aa.HM.HM.T2._args, com.cliffc.aa.HM.HM.T2._deps, com.cliffc.aa.HM.HM.T2._err, com.cliffc.aa.HM.HM.T2._fidxs, com.cliffc.aa.HM.HM.T2._flow, com.cliffc.aa.HM.HM.T2._ids, com.cliffc.aa.HM.HM.T2._name, com.cliffc.aa.HM.HM.T2._uid, com.cliffc.aa.HM.HM.Worklist.addAll(), com.cliffc.aa.HM.HM.T2.no_uf(), and com.cliffc.aa.HM.HM.T2.push_update().

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

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

◆ add_deps_work()

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

Definition at line 2132 of file HM.java.

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

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

Referenced by com.cliffc.aa.HM.HM.Ident.add_hm_work(), and com.cliffc.aa.HM.HM.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.HM.T2.add_deps_work_impl ( Worklist  work)
private

Definition at line 2133 of file HM.java.

2133  {
2134  if( is_leaf() ) {
2135  work.addAll(_deps);
2136  } else {
2137  if( UPDATE_VISIT.tset(_uid) ) return;
2138  if( _args != null )
2139  for( int i=0; i<_args.length; i++ )
2140  args(i).add_deps_work_impl(work);
2141  }
2142  }

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

Referenced by com.cliffc.aa.HM.HM.T2.add_deps_work(), and com.cliffc.aa.HM.HM.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.HM.T2.add_fld ( String  id,
T2  fld,
Worklist  work 
)
private

Definition at line 1697 of file HM.java.

1697  {
1698  assert is_struct();
1699  int len = _ids.length;
1700  // Find insertion point
1701  int idx = Arrays.binarySearch(_ids,id);
1702  assert idx<0; // Never found
1703  idx = -idx-1; // Insertion point
1704  // Insert in sorted order
1705  _ids = Arrays.copyOf( _ids,len+1);
1706  _args = Arrays.copyOf(_args,len+1);
1707  System.arraycopy( _ids,idx, _ids,idx+1,len-idx);
1708  System.arraycopy(_args,idx,_args,idx+1,len-idx);
1709  _ids [idx] = id ;
1710  _args[idx] = fld;
1711  fld.push_update(_deps); // If field changes, all deps change
1712  work.addAll(_deps); //
1713  return true; // Always progress
1714  }

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

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

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

◆ args()

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

Definition at line 1415 of file HM.java.

1415  {
1416  T2 u = _args[i];
1417  T2 uu = u.find();
1418  return u==uu ? uu : (_args[i]=uu);
1419  }

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

Referenced by com.cliffc.aa.HM.HM.T2._as_flow(), com.cliffc.aa.HM.HM.T2._cycle_equals(), com.cliffc.aa.HM.HM.T2._cycle_equals_struct(), com.cliffc.aa.HM.HM.T2._find_fidxs(), com.cliffc.aa.HM.HM.T2._find_nil(), com.cliffc.aa.HM.HM.T2._fresh(), com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM.T2._occurs_in_type(), com.cliffc.aa.HM.HM.T2._p(), com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.T2._unify_struct(), com.cliffc.aa.HM.HM.T2.add_deps_work_impl(), com.cliffc.aa.HM.HM.Pair1.Pair1X.apply(), com.cliffc.aa.HM.HM.Lambda.hm(), com.cliffc.aa.HM.HM.Apply.hm(), com.cliffc.aa.HM.HM.Struct.hm(), com.cliffc.aa.HM.HM.Field.hm(), com.cliffc.aa.HM.HM.If.hm(), com.cliffc.aa.HM.HM.NotNil.hm(), com.cliffc.aa.HM.HM.T2.make_fun(), com.cliffc.aa.HM.HM.NotNil.prep_tree(), com.cliffc.aa.HM.HM.PrimSyn.PrimSyn(), com.cliffc.aa.HM.HM.T2.push_update_impl(), com.cliffc.aa.HM.HM.T2.T2(), com.cliffc.aa.HM.HM.T2.unify_nil(), com.cliffc.aa.HM.HM.T2.walk_types_in(), and com.cliffc.aa.HM.HM.T2.walk_types_out().

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

◆ as_flow()

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

Definition at line 1427 of file HM.java.

1427  {
1428  assert ADUPS.isEmpty();
1429  Type t = _as_flow();
1430  ADUPS.clear();
1431  assert Type.intern_check();
1432  return t;
1433  }

References com.cliffc.aa.HM.HM.T2._as_flow(), com.cliffc.aa.HM.HM.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.HM.T2.walk_types_in(), and com.cliffc.aa.HM.HM.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.HM.T2.base_states ( )
private

Definition at line 1515 of file HM.java.

1515  {
1516  int cnt=0;
1517  if( _flow !=null ) cnt++;
1518  if( _fidxs!=null ) cnt++;
1519  if( _err !=null ) cnt++;
1520  if( _alias!=null ) { cnt++; assert _ids!=null; }
1521  else assert _ids==null;
1522  return cnt;
1523  }

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

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

Here is the caller graph for this function:

◆ copy()

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

Definition at line 1335 of file HM.java.

1335  {
1336  T2 t = new T2(_name);
1337  if( _args!=null ) t._args = new T2[_args.length];
1338  t._flow = _flow;
1339  t._fidxs = _fidxs;
1340  t._alias = _alias;
1341  t._ids = _ids;
1342  t._err = _err;
1343  t._deps = _deps;
1344  t._open = _open;
1345  return t;
1346  }

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

Referenced by com.cliffc.aa.HM.HM.T2._fresh(), com.cliffc.aa.HM.HM.T2._fresh_unify(), and com.cliffc.aa.HM.HM.T2.unify_nil().

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

◆ cycle_equals()

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

Definition at line 1962 of file HM.java.

1962  {
1963  assert CDUPS.isEmpty();
1964  boolean rez = _cycle_equals(t);
1965  CDUPS.clear();
1966  return rez;
1967  }

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

Referenced by com.cliffc.aa.HM.HM.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.HM.T2.dbl_uid ( long  uid)
private

Definition at line 1717 of file HM.java.

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

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

◆ dbl_uid() [2/2]

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

Definition at line 1716 of file HM.java.

1716 { return dbl_uid(t._uid); }

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

Referenced by com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.T2.dbl_uid(), and com.cliffc.aa.HM.HM.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.HM.T2.debug_find ( )
package

Definition at line 1364 of file HM.java.

1364  {// Find, without the roll-up
1365  if( !is_leaf() ) return this; // Shortcut
1366  if( _args==null ) return this;
1367  T2 u = _args[0];
1368  if( u.no_uf() ) return u; // Shortcut
1369  // U-F search, no fixup
1370  while( u.is_leaf() && !u.no_uf() ) u = u._args[0];
1371  return u;
1372  }

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

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

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

◆ find() [1/2]

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

Definition at line 1374 of file HM.java.

1374  {
1375  T2 u = _find0();
1376  return u.is_nilable() ? u._find_nil() : u;
1377  }

References com.cliffc.aa.HM.HM.T2._find0(), com.cliffc.aa.HM.HM.T2._find_nil(), and com.cliffc.aa.HM.HM.T2.is_nilable().

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

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

◆ find() [2/2]

T2 com.cliffc.aa.HM.HM.T2.find ( int  uid)
package

Definition at line 2278 of file HM.java.

2278 { return _find(uid,new VBitSet()); }

References com.cliffc.aa.HM.HM.T2._find().

Here is the call graph for this function:

◆ find_fidxs()

BitsFun com.cliffc.aa.HM.HM.T2.find_fidxs ( )
package

Definition at line 2100 of file HM.java.

2100 { FIDX_VISIT.clear(); FIDXS = BitsFun.EMPTY; _find_fidxs(); return FIDXS; }

References com.cliffc.aa.HM.HM.T2._find_fidxs(), com.cliffc.aa.type.BitsFun.EMPTY, com.cliffc.aa.HM.HM.T2.FIDX_VISIT, and com.cliffc.aa.HM.HM.T2.FIDXS.

Referenced by com.cliffc.aa.HM.HM.Root.val().

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

◆ fput()

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

Definition at line 2056 of file HM.java.

2056  {
2057  Apply.T2MAP.merge(this, t, Type::meet);
2058  return t;
2059  }

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

Referenced by com.cliffc.aa.HM.HM.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.HM.T2.fresh ( )
package

Definition at line 1898 of file HM.java.

1898  {
1899  assert VARS.isEmpty();
1900  T2 rez = _fresh(null);
1901  VARS.clear();
1902  return rez;
1903  }

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

Referenced by com.cliffc.aa.HM.HM.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.HM.T2.fresh_base ( T2  that,
Worklist  work 
)
private

Definition at line 1719 of file HM.java.

1719  {
1720  assert base_states()<=1 && that.base_states()<=1;
1721  boolean progress=false;
1722  Type flow = meet_flow (that); progress |= flow != that._flow ;
1723  BitsFun fidxs = meet_fidxs(that); progress |= fidxs != that._fidxs;
1724  BitsAlias alias = meet_alias(that); progress |= alias != that._alias;
1725  String[] ids = meet_ids (that); progress |= ids != that._ids;
1726  boolean open = meet_opens(that); progress |= open != that._open;
1727  String err = meet_err (that); progress |= !Util.eq(err,that._err);
1728  if( !progress ) return false;
1729  if( work==null ) return true;
1730  // Progress
1731  Type that_flow = that._flow;
1732  that._flow = flow ;
1733  that._fidxs = fidxs;
1734  that._alias = alias;
1735  that._ids = ids;
1736  that._open = open;
1737  that._err = err;
1738  if( !_can_be_HM_base(that,that_flow) ) {
1739  that._flow = that_flow; // Unwind for error message
1740  String msg = "Cannot unify "+this.p()+" and "+that.p();
1741  that._flow=null; that._fidxs=null; that._alias=null; that._ids=null; // Now kill the base types, since in-error
1742  return that.union(make_err(msg),work);
1743  }
1744  assert that.base_states()<=1;
1745  that.add_deps_work(work);
1746  if( that.is_leaf() ) that._name = _name; // That is a base/err now
1747  return true;
1748  }

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

Referenced by com.cliffc.aa.HM.HM.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.HM.T2.fresh_unify ( T2  that,
VStack  nongen,
Worklist  work 
)
package

Definition at line 1769 of file HM.java.

1769  {
1770  assert VARS.isEmpty() && DUPS.isEmpty();
1771  int old = CNT;
1772  boolean progress = _fresh_unify(that,nongen,work);
1773  VARS.clear(); DUPS.clear();
1774  if( work==null && old!=CNT && DEBUG_LEAKS )
1775  throw unimpl("busted, made T2s but just testing");
1776  return progress;
1777  }

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

Referenced by com.cliffc.aa.HM.HM.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.HM.T2.get_dups ( VBitSet  dups)
package

Definition at line 2148 of file HM.java.

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

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

Referenced by com.cliffc.aa.HM.HM.T2.p(), com.cliffc.aa.HM.HM.Syntax.p0(), and com.cliffc.aa.HM.HM.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.HM.T2.is_base ( )
package

Definition at line 1358 of file HM.java.

1358 { return isa("Base"); }

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

Referenced by com.cliffc.aa.HM.HM.T2._as_flow(), com.cliffc.aa.HM.HM.T2._find_nil(), com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._p(), com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.Pair1.Pair1X.apply(), com.cliffc.aa.HM.HM.NotNil.hm(), com.cliffc.aa.HM.HM.T2.str(), com.cliffc.aa.HM.HM.T2.unify_nil(), com.cliffc.aa.HM.HM.T2.walk_types_in(), and com.cliffc.aa.HM.HM.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.HM.T2.is_err ( )
package

Definition at line 1362 of file HM.java.

1362 { return isa("Err"); }

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

Referenced by com.cliffc.aa.HM.HM.T2._as_flow(), com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM.T2._p(), com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.Lambda.hm(), com.cliffc.aa.HM.HM.Apply.hm(), com.cliffc.aa.HM.HM.Struct.hm(), com.cliffc.aa.HM.HM.Field.hm(), com.cliffc.aa.HM.HM.PrimSyn.hm(), com.cliffc.aa.HM.HM.NotNil.hm(), com.cliffc.aa.HM.HM.T2.str(), com.cliffc.aa.HM.HM.T2.walk_types_in(), and com.cliffc.aa.HM.HM.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.HM.T2.is_fun ( )
package

Definition at line 1360 of file HM.java.

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

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

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

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

◆ is_leaf()

◆ is_nilable()

boolean com.cliffc.aa.HM.HM.T2.is_nilable ( )
package

Definition at line 1359 of file HM.java.

1359 { return isa("?"); }

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

Referenced by com.cliffc.aa.HM.HM.T2._as_flow(), com.cliffc.aa.HM.HM.T2._find_nil(), com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._p(), com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.T2.find(), com.cliffc.aa.HM.HM.Field.hm(), com.cliffc.aa.HM.HM.NotNil.hm(), com.cliffc.aa.HM.HM.T2.no_uf(), com.cliffc.aa.HM.HM.T2.unify_nil(), and com.cliffc.aa.HM.HM.T2.walk_types_in().

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

◆ is_struct()

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

◆ is_tuple()

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

Definition at line 2269 of file HM.java.

2269  {
2270  if( _ids==null ) return false;
2271  for( String id : _ids )
2272  if( !isDigit((byte) id.charAt(0)) )
2273  return false;
2274  return true;
2275  }

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

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

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

◆ isa()

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

Definition at line 1357 of file HM.java.

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

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

Referenced by com.cliffc.aa.HM.HM.T2.is_base(), com.cliffc.aa.HM.HM.T2.is_err(), com.cliffc.aa.HM.HM.T2.is_fun(), com.cliffc.aa.HM.HM.T2.is_nilable(), and com.cliffc.aa.HM.HM.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.HM.T2.make_base ( Type  flow)
staticpackage

Definition at line 1323 of file HM.java.

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

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

Referenced by com.cliffc.aa.HM.HM.Con.prep_tree(), and com.cliffc.aa.HM.HM.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.HM.T2.make_err ( String  s)
staticpackage

Definition at line 1333 of file HM.java.

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

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

Referenced by com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2.fresh_base(), com.cliffc.aa.HM.HM.Apply.hm(), com.cliffc.aa.HM.HM.Field.hm(), com.cliffc.aa.HM.HM.T2.miss_field(), and com.cliffc.aa.HM.HM.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.HM.T2.make_fun ( BitsFun  fidxs,
T2...  args 
)
staticpackage

Definition at line 1324 of file HM.java.

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

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

Referenced by com.cliffc.aa.HM.HM.Lambda.hm(), com.cliffc.aa.HM.HM.Apply.hm(), com.cliffc.aa.HM.HM.Pair1.Pair1(), and com.cliffc.aa.HM.HM.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.HM.T2.make_leaf ( )
staticpackage

Definition at line 1321 of file HM.java.

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

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

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

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

◆ make_nil()

static T2 com.cliffc.aa.HM.HM.T2.make_nil ( T2  leaf)
staticpackage

Definition at line 1322 of file HM.java.

1322 { return new T2("?",leaf); }

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

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

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.HM.T2.make_struct ( BitsAlias  aliases,
String[]  ids,
T2[]  flds 
)
staticpackage

Definition at line 1325 of file HM.java.

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

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

Referenced by com.cliffc.aa.HM.HM.Struct.hm(), com.cliffc.aa.HM.HM.Field.hm(), com.cliffc.aa.HM.HM.T2.make_struct(), com.cliffc.aa.HM.HM.Pair.Pair(), com.cliffc.aa.HM.HM.Pair1.Pair1(), com.cliffc.aa.HM.HM.Pair1.Pair1X.Pair1X(), com.cliffc.aa.HM.HM.Struct.prep_tree(), and com.cliffc.aa.HM.HM.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.HM.T2.make_struct ( BitsAlias  aliases,
String[]  ids,
T2[]  flds,
boolean  open 
)
staticpackage

Definition at line 1326 of file HM.java.

1326  {
1327  T2 tstr = new T2("@{}",flds);
1328  tstr._alias=aliases;
1329  tstr._ids = ids;
1330  tstr._open= open;
1331  return tstr;
1332  }

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

Here is the call graph for this function:

◆ meet_alias()

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

Definition at line 1487 of file HM.java.

1487  {
1488  if( this._alias==null ) return that._alias;
1489  if( that._alias==null ) return this._alias;
1490  return _alias.meet(that._alias);
1491  }

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

Referenced by com.cliffc.aa.HM.HM.T2._fresh_unify_struct(), com.cliffc.aa.HM.HM.T2.fresh_base(), and com.cliffc.aa.HM.HM.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.HM.T2.meet_err ( T2  that)
private

Definition at line 1509 of file HM.java.

1509  {
1510  if( this._err==null ) return that._err;
1511  if( that._err==null ) return this._err;
1512  // TODO: Probably gather unrelated strings in a set
1513  return _uid < that._uid ? _err : that._err;
1514  }

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

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

Here is the caller graph for this function:

◆ meet_fidxs()

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

Definition at line 1482 of file HM.java.

1482  {
1483  if( this._fidxs==null ) return that._fidxs;
1484  if( that._fidxs==null ) return this._fidxs;
1485  return _fidxs.meet(that._fidxs);
1486  }

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

Referenced by com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2.fresh_base(), and com.cliffc.aa.HM.HM.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.HM.T2.meet_flow ( T2  that)
private

Definition at line 1477 of file HM.java.

1477  {
1478  if( this._flow==null ) return that._flow;
1479  if( that._flow==null ) return this._flow;
1480  return _flow.meet(that._flow);
1481  }

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

Referenced by com.cliffc.aa.HM.HM.T2.fresh_base(), and com.cliffc.aa.HM.HM.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.HM.T2.meet_ids ( T2  that)
private

Definition at line 1492 of file HM.java.

1492  {
1493  String[] ids = that._ids;
1494  if( _ids==ids ) return ids;
1495  if( _ids==null ) return ids;
1496  if( ids==null ) return _ids;
1497  if( _ids.length!=ids.length ) throw unimpl(); // Handled at a higher level
1498  for( String id : ids )
1499  if( Util.find(_ids, id) == -1 )
1500  throw unimpl();
1501  return ids; // Return RHS
1502  }

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

Referenced by com.cliffc.aa.HM.HM.T2.fresh_base(), and com.cliffc.aa.HM.HM.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.HM.T2.meet_opens ( T2  that)
private

Definition at line 1503 of file HM.java.

1503  {
1504  if( _open==that._open ) return that._open;
1505  if( !is_struct() ) return that._open;
1506  if( !that.is_struct() ) return _open;
1507  throw unimpl();
1508  }

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

Referenced by com.cliffc.aa.HM.HM.T2.fresh_base(), and com.cliffc.aa.HM.HM.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.HM.T2.miss_field ( String  id)
package

Definition at line 1334 of file HM.java.

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

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

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

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

◆ no_uf()

boolean com.cliffc.aa.HM.HM.T2.no_uf ( )
package

Definition at line 1356 of file HM.java.

1356 { return _name.charAt(0)!='X' && (!is_nilable() || _args[0].is_leaf()); }

References com.cliffc.aa.HM.HM.T2._args, com.cliffc.aa.HM.HM.T2._name, com.cliffc.aa.HM.HM.T2.is_leaf(), and com.cliffc.aa.HM.HM.T2.is_nilable().

Referenced by com.cliffc.aa.HM.HM.T2._as_flow(), com.cliffc.aa.HM.HM.T2._cycle_equals(), com.cliffc.aa.HM.HM.T2._fresh(), com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._occurs_in_type(), com.cliffc.aa.HM.HM.T2._p(), com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.T2._union(), com.cliffc.aa.HM.HM.T2.debug_find(), com.cliffc.aa.HM.HM.T2.push_update_impl(), com.cliffc.aa.HM.HM.T2.str(), com.cliffc.aa.HM.HM.T2.union(), com.cliffc.aa.HM.HM.T2.walk_types_in(), and com.cliffc.aa.HM.HM.T2.walk_types_out().

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

◆ nongen_in()

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

Definition at line 1950 of file HM.java.

1950  {
1951  if( vs==null ) return false;
1952  ODUPS.clear();
1953  for( T2 t2 : vs )
1954  if( _occurs_in_type(t2.find()) )
1955  return true;
1956  return false;
1957  }

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

Referenced by com.cliffc.aa.HM.HM.T2._fresh(), com.cliffc.aa.HM.HM.T2._fresh_unify(), and com.cliffc.aa.HM.HM.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.HM.T2.occurs_in_type ( T2  x)
package

Definition at line 1945 of file HM.java.

1945  {
1946  ODUPS.clear();
1947  return _occurs_in_type(x);
1948  }

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

Here is the call graph for this function:

◆ p() [1/2]

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

Definition at line 2205 of file HM.java.

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

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

Referenced by com.cliffc.aa.HM.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.T2.fresh_base(), com.cliffc.aa.HM.HM.T2.miss_field(), com.cliffc.aa.HM.HM.T2.p(), com.cliffc.aa.HM.TestHM.run(), com.cliffc.aa.HM.TestHM9.run(), com.cliffc.aa.HM.TestHM.test05(), com.cliffc.aa.HM.TestHM9.test05(), com.cliffc.aa.HM.TestHM.test06(), com.cliffc.aa.HM.TestHM9.test06(), com.cliffc.aa.HM.TestHM.test14(), com.cliffc.aa.HM.TestHM9.test14(), com.cliffc.aa.HM.TestHM.test18(), com.cliffc.aa.HM.TestHM9.test18(), com.cliffc.aa.HM.TestHM.test20(), com.cliffc.aa.HM.TestHM9.test20(), com.cliffc.aa.HM.TestHM9.test32(), com.cliffc.aa.HM.TestHM.test32(), com.cliffc.aa.HM.TestHM9.test33(), com.cliffc.aa.HM.TestHM.test33(), com.cliffc.aa.HM.TestHM9.test34(), com.cliffc.aa.HM.TestHM.test34(), com.cliffc.aa.HM.TestHM9.test36(), com.cliffc.aa.HM.TestHM.test36(), com.cliffc.aa.HM.TestHM.test39(), com.cliffc.aa.HM.TestHM9.test39(), com.cliffc.aa.HM.TestHM.test40(), com.cliffc.aa.HM.TestHM9.test40(), com.cliffc.aa.HM.TestHM.test41(), com.cliffc.aa.HM.TestHM9.test41(), com.cliffc.aa.HM.TestHM.test42(), com.cliffc.aa.HM.TestHM9.test42(), com.cliffc.aa.HM.TestHM.test43(), com.cliffc.aa.HM.TestHM9.test43(), com.cliffc.aa.HM.TestHM.test44(), com.cliffc.aa.HM.TestHM9.test44(), com.cliffc.aa.HM.TestHM.test45(), com.cliffc.aa.HM.TestHM9.test45(), com.cliffc.aa.HM.TestHM.test49(), com.cliffc.aa.HM.TestHM9.test49(), com.cliffc.aa.HM.TestHM.test50(), com.cliffc.aa.HM.TestHM9.test50(), com.cliffc.aa.HM.TestHM.test51(), com.cliffc.aa.HM.TestHM.test52(), com.cliffc.aa.HM.TestHM.test55(), com.cliffc.aa.HM.TestHM.test56(), com.cliffc.aa.HM.TestHM.test57(), and com.cliffc.aa.HM.HM.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.HM.T2.p ( VBitSet  dups)
package

Definition at line 2208 of file HM.java.

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

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

Here is the call graph for this function:

◆ push_update() [1/2]

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

Definition at line 2118 of file HM.java.

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

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

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

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.HM.T2.push_update ( Syntax  a)
package

Definition at line 2119 of file HM.java.

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

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

Here is the call graph for this function:

◆ push_update_impl()

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

Definition at line 2120 of file HM.java.

2120  {
2121  assert no_uf();
2122  if( UPDATE_VISIT.tset(_uid) ) return;
2123  if( _deps==null ) _deps = new Ary<>(Syntax.class);
2124  if( _deps.find(a)==-1 ) _deps.push(a);
2125  if( _args!=null )
2126  for( int i=0; i<_args.length; i++ )
2127  if( _args[i]!=null )
2128  args(i).push_update_impl(a);
2129  }

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

Referenced by com.cliffc.aa.HM.HM.T2.push_update(), and com.cliffc.aa.HM.HM.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.HM.T2.reset ( )
staticpackage

Definition at line 2288 of file HM.java.

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

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

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

Here is the caller graph for this function:

◆ str() [1/2]

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

Definition at line 2202 of file HM.java.

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

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

Here is the call graph for this function:

◆ str() [2/2]

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

Definition at line 2163 of file HM.java.

2163  {
2164 
2165  if( is_err () ) return sb.p(_err);
2166  if( is_base() ) return sb.p(_flow);
2167  boolean dup = dups.get(_uid);
2168  if( is_leaf() ) {
2169  sb.p(_name);
2170  return no_uf() ? sb : _args[0].str(sb.p(">>"), visit, dups);
2171  }
2172  if( dup ) sb.p("$V").p(_uid);
2173  if( visit.tset(_uid) && dup ) return sb;
2174  if( dup ) sb.p(':');
2175 
2176  // Special printing for functions
2177  if( is_fun() ) {
2178  sb.p("{");
2179  if( _fidxs==null ) sb.p('_'); else _fidxs.str(sb);
2180  sb.p(' ');
2181  for( int i=0; i<_args.length-1; i++ )
2182  str(sb,visit,_args[i],dups).p(" ");
2183  return str(sb.p("-> "),visit,_args[_args.length-1],dups).p(" }");
2184  }
2185 
2186  // Special printing for structures
2187  if( is_struct() ) {
2188  sb.p("@{");
2189  if( _alias==null ) sb.p('_'); else _alias.str(sb);
2190  sb.p(' ');
2191  if( _ids==null ) sb.p("_ ");
2192  else for( int i=0; i<_ids.length; i++ )
2193  str(sb.p(' ').p(_ids[i]).p(" = "),visit,_args[i],dups).p(',');
2194  return sb.unchar().p("}");
2195  }
2196 
2197  // Generic structural T2
2198  sb.p("(").p(_name).p(" ");
2199  for( T2 t : _args ) str(sb,visit,t,dups).p(" ");
2200  return sb.unchar().p(")");
2201  }

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

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

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

◆ toString()

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

Definition at line 2162 of file HM.java.

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

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

Here is the call graph for this function:

◆ unify()

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

Definition at line 1604 of file HM.java.

1604  {
1605  if( this==that ) return false;
1606  assert DUPS.isEmpty();
1607  boolean progress = _unify(that,work);
1608  DUPS.clear();
1609  return progress;
1610  }

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

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

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

◆ unify_nil()

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

Definition at line 1559 of file HM.java.

1559  {
1560  assert is_nilable() && !that.is_nilable();
1561  if( work==null ) return true; // Will make progress
1562  // Clone the top-level struct and make this nilable point to the clone;
1563  // this will collapse into the clone at the next find() call.
1564  // Unify the nilable leaf into that.
1565  T2 leaf = args(0); assert leaf.is_leaf();
1566  T2 copy = that.copy();
1567  if( that.is_base() ) {
1569  } else if( that.is_struct() ) {
1570  copy._alias = copy._alias.clear(0);
1571  System.arraycopy(that._args,0,copy._args,0,that._args.length);
1572  } else
1573  throw unimpl();
1574  return leaf._union(copy,work) | that._union(find(),work);
1575  }

References com.cliffc.aa.HM.HM.T2._alias, com.cliffc.aa.HM.HM.T2._args, com.cliffc.aa.HM.HM.T2._flow, com.cliffc.aa.HM.HM.T2._union(), com.cliffc.aa.HM.HM.T2.args(), com.cliffc.aa.type.Bits< B extends Bits< B >.clear(), com.cliffc.aa.HM.HM.T2.copy(), com.cliffc.aa.HM.HM.T2.find(), com.cliffc.aa.HM.HM.T2.is_base(), com.cliffc.aa.HM.HM.T2.is_leaf(), com.cliffc.aa.HM.HM.T2.is_nilable(), com.cliffc.aa.HM.HM.T2.is_struct(), com.cliffc.aa.type.Type< T extends Type< T >.join(), and com.cliffc.aa.type.Type< T extends Type< T >.NSCALR.

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

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

◆ union()

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

Definition at line 1527 of file HM.java.

1527  {
1528  assert no_uf() && that.no_uf(); // Cannot union twice
1529  assert base_states()<=1 && that.base_states()<=1;
1530  if( this==that ) return false;
1531  if( work==null ) return true; // Report progress without changing
1532  // Keep the merge of all base types, revisiting deps if any changes
1533  if( _flow !=that._flow ||
1534  _fidxs!=that._fidxs ||
1535  _alias!=that._alias ||
1536  _ids !=that._ids ||
1537  _open !=that._open ||
1538  !Util.eq(_err,that._err) )
1539  work.addAll(that._deps); // Any progress, revisit deps
1540  // If flow types are not compatible, return an error now
1541  if( _flow!=null & that._flow!=null && (_flow.widen() != that._flow.widen() && !_flow.isa(that._flow.widen())) )
1542  return union_err(that,work,"Cannot unify "+this.p()+" and "+that.p());
1543  that._flow = meet_flow (that);
1544  that._fidxs = meet_fidxs(that);
1545  that._alias = meet_alias(that);
1546  that._ids = meet_ids (that);
1547  that._open = meet_opens(that);
1548  that._err = meet_err (that);
1549  assert that._flow != Type.XNIL;
1550  if( that._err!=null ) { // Kill the base types in an error
1551  that._flow=null; that._fidxs=null; that._alias=null; that._ids=null;
1552  }
1553  // Hard union this into that, no more testing.
1554  return _union(that,work);
1555  }

References com.cliffc.aa.HM.HM.T2._alias, com.cliffc.aa.HM.HM.T2._err, com.cliffc.aa.HM.HM.T2._fidxs, com.cliffc.aa.HM.HM.T2._flow, com.cliffc.aa.HM.HM.T2._ids, com.cliffc.aa.HM.HM.T2._open, com.cliffc.aa.HM.HM.T2._union(), com.cliffc.aa.HM.HM.T2.base_states(), com.cliffc.aa.util.Util.eq(), com.cliffc.aa.type.Type< T extends Type< T >.isa(), com.cliffc.aa.HM.HM.T2.meet_alias(), com.cliffc.aa.HM.HM.T2.meet_err(), com.cliffc.aa.HM.HM.T2.meet_fidxs(), com.cliffc.aa.HM.HM.T2.meet_flow(), com.cliffc.aa.HM.HM.T2.meet_ids(), com.cliffc.aa.HM.HM.T2.meet_opens(), com.cliffc.aa.HM.HM.T2.no_uf(), com.cliffc.aa.HM.HM.T2.p(), com.cliffc.aa.HM.HM.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.HM.T2._fresh_unify(), com.cliffc.aa.HM.HM.T2._unify(), com.cliffc.aa.HM.HM.T2.fresh_base(), and com.cliffc.aa.HM.HM.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.HM.T2.union_err ( T2  that,
Worklist  work,
String  msg 
)
private

Definition at line 1757 of file HM.java.

1757  {
1758  that._flow=null; that._fidxs=null; that._alias=null; that._ids=null; // Now kill the base types, since in-error
1759  union(that,work);
1760  return that.union(make_err(msg),work);
1761  }

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

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

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

◆ vput()

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

Definition at line 1895 of file HM.java.

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

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

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

Here is the caller graph for this function:

◆ walk_types_in()

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

Definition at line 2005 of file HM.java.

2005  {
2006  long duid = dbl_uid(t._uid);
2007  if( Apply.WDUPS.putIfAbsent(duid,"")!=null ) return t;
2008  assert no_uf();
2009  if( is_err() ) return fput(t); //
2010  // Base variables (when widened to an HM type) might force a lift.
2011  if( is_base() ) return fput(_flow.widen().join(t));
2012  // Free variables keep the input flow type.
2013  if( is_leaf() ) return fput(t);
2014  // Nilable
2015  if( is_nilable() ) {
2016  fput(t);
2017  args(0).walk_types_in(t); // TODO: Not sure if i should strip nil or not
2018  return t;
2019  }
2020  if( t==Type.SCALAR || t==Type.NSCALR ) return fput(t); // Will be scalar for all the breakdown types
2021  if( is_fun() ) {
2022  if( !(t instanceof TypeFunPtr) ) return t; // Typically, some kind of error situation
2023  // TODO: PAIR1 should report better
2024  TypeFunPtr tfp = (TypeFunPtr)t;
2025  T2 ret = args(_args.length-1);
2026  if( tfp._fidxs==BitsFun.FULL ) return ret.walk_types_in(Type. SCALAR);
2027  if( tfp._fidxs==BitsFun.FULL.dual() ) return ret.walk_types_in(Type.XSCALAR);
2028  for( int fidx : ((TypeFunPtr)t)._fidxs ) {
2029  Lambda lambda = Lambda.FUNS.get(fidx);
2030  Type body = lambda.find().is_err()
2031  ? Type.SCALAR // Error, no lift
2032  : (lambda._body == null // Null only for primitives
2033  ? lambda.find().args(lambda._targs.length).as_flow() // Get primitive return type
2034  : lambda._body._flow); // Else use body type
2035  ret.walk_types_in(body);
2036  }
2037  return t;
2038  }
2039 
2040  if( is_struct() ) {
2041  fput(t); // Recursive types need to put themselves first
2042  if( !(t instanceof TypeMemPtr) ) return t;
2043  TypeMemPtr tmp = (TypeMemPtr)t;
2044  if( !(tmp._obj instanceof TypeStruct) ) return t;
2045  TypeStruct ts = (TypeStruct)tmp._obj;
2046  for( int i=0; i<_args.length; i++ ) {
2047  int idx = ts.fld_find(_ids[i]);
2048  // Missing fields are walked as SCALAR
2049  args(i).walk_types_in(idx==-1 ? Type.SCALAR : ts.at(idx));
2050  }
2051  return ts;
2052  }
2053 
2054  throw unimpl();
2055  }

References com.cliffc.aa.HM.HM.T2._args, com.cliffc.aa.HM.HM.Lambda._body, com.cliffc.aa.type.TypeFunPtr._fidxs, com.cliffc.aa.HM.HM.T2._fidxs, com.cliffc.aa.HM.HM.Syntax._flow, com.cliffc.aa.HM.HM.T2._flow, com.cliffc.aa.HM.HM.T2._ids, com.cliffc.aa.type.TypeMemPtr._obj, com.cliffc.aa.HM.HM.Lambda._targs, com.cliffc.aa.type.Type< T extends Type< T >._uid, com.cliffc.aa.HM.HM.T2.args(), com.cliffc.aa.HM.HM.T2.as_flow(), com.cliffc.aa.type.TypeStruct.at(), com.cliffc.aa.HM.HM.T2.dbl_uid(), com.cliffc.aa.type.Bits< B extends Bits< B >.dual(), com.cliffc.aa.HM.HM.Syntax.find(), com.cliffc.aa.type.TypeStruct.fld_find(), com.cliffc.aa.HM.HM.T2.fput(), com.cliffc.aa.type.BitsFun.FULL, com.cliffc.aa.HM.HM.Lambda.FUNS, com.cliffc.aa.HM.HM.T2.is_base(), com.cliffc.aa.HM.HM.T2.is_err(), com.cliffc.aa.HM.HM.T2.is_fun(), com.cliffc.aa.HM.HM.T2.is_leaf(), com.cliffc.aa.HM.HM.T2.is_nilable(), com.cliffc.aa.HM.HM.T2.is_struct(), com.cliffc.aa.type.Type< T extends Type< T >.join(), com.cliffc.aa.HM.HM.T2.no_uf(), com.cliffc.aa.type.Type< T extends Type< T >.NSCALR, com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.putIfAbsent(), com.cliffc.aa.type.Type< T extends Type< T >.SCALAR, com.cliffc.aa.HM.HM.T2.walk_types_in(), com.cliffc.aa.HM.HM.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.HM.Apply.val(), and com.cliffc.aa.HM.HM.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.HM.T2.walk_types_out ( Type  t)
package

Definition at line 2061 of file HM.java.

2061  {
2062  assert no_uf();
2063  if( t == Type.XSCALAR ) return t; // No lift possible
2064  Type tmap = Apply.T2MAP.get(this);
2065  if( tmap != null ) return tmap;
2066  if( is_err() ) throw unimpl();
2067  assert !is_leaf() && !is_base(); // All output leafs found as inputs already
2068  if( is_fun() ) return t; // No change, already known as a function (and no TFS in the flow types)
2069  if( is_struct() ) {
2070  if( !(t instanceof TypeMemPtr) ) throw unimpl();
2071  TypeMemPtr tmp = (TypeMemPtr)t;
2072  if( !(tmp._obj instanceof TypeStruct) ) throw unimpl();
2073  TypeStruct ts = (TypeStruct)tmp._obj;
2074  boolean progress=false;
2075  for( int i=0; i<_args.length; i++ ) {
2076  int idx = ts.fld_find(_ids[i]);
2077  if( idx==-1 ) continue;
2078  Type targ = ts.at(idx);
2079  Type rez = args(i).walk_types_out(targ);
2080  progress |= targ != rez;
2081  }
2082  if( !progress ) return t;
2083  // Make a new result
2084  TypeFld[] flds = TypeFlds.get(ts.len());
2085  for( int i=0; i<_args.length; i++ ) {
2086  int idx = ts.fld_find(_ids[i]);
2087  if( idx==-1 ) continue;
2088  Type targ = ts.at(idx);
2089  Type rez = args(i).walk_types_out(targ);
2090  flds[i] = ts.fld(i).make_from(rez);
2091  }
2092  return tmp.make_from(ts.make_from(flds));
2093  }
2094  throw unimpl(); // Handled all cases
2095  }

References com.cliffc.aa.HM.HM.T2._args, com.cliffc.aa.HM.HM.T2._ids, com.cliffc.aa.type.TypeMemPtr._obj, com.cliffc.aa.HM.HM.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.HM.T2.is_base(), com.cliffc.aa.HM.HM.T2.is_err(), com.cliffc.aa.HM.HM.T2.is_fun(), com.cliffc.aa.HM.HM.T2.is_leaf(), com.cliffc.aa.HM.HM.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.HM.T2.no_uf(), com.cliffc.aa.HM.HM.Apply.T2MAP, com.cliffc.aa.HM.HM.T2.walk_types_out(), and com.cliffc.aa.type.Type< T extends Type< T >.XSCALAR.

Referenced by com.cliffc.aa.HM.HM.Apply.val(), and com.cliffc.aa.HM.HM.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.HM.T2.ADUPS = new NonBlockingHashMapLong<>()
staticpackage

Definition at line 1426 of file HM.java.

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

◆ CDUPS

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

◆ CNT

◆ DUPS

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

◆ FIDX_VISIT

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

◆ FIDXS

BitsFun com.cliffc.aa.HM.HM.T2.FIDXS = null
staticprivate

◆ ODUPS

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

◆ UPDATE_VISIT

◆ VARS

◆ VCNT

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

Definition at line 2206 of file HM.java.

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

◆ VNAMES

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

Definition at line 2207 of file HM.java.

Referenced by com.cliffc.aa.HM.HM.T2._p(), and com.cliffc.aa.HM.HM.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.type.Type.NSCALR
static final Type NSCALR
Definition: Type.java:330
com.cliffc.aa.type.TypeFld.Access.Final
Final
Definition: TypeFld.java:112
com.cliffc.aa.HM.HM.T2.isa
boolean isa(String name)
Definition: HM.java:1357
com.cliffc.aa.type.TypeFlds.get
TypeFld[] get()
Definition: TypeFlds.java:59
com.cliffc.aa.type.Bits.str
SB str(SB sb)
Definition: Bits.java:134
com.cliffc.aa.type.BitsFun.EMPTY
static final BitsFun EMPTY
Definition: BitsFun.java:37
com.cliffc.aa.HM.HM.isDigit
static boolean isDigit(byte c)
Definition: HM.java:273
com.cliffc.aa.type.TypeFunPtr
Definition: TypeFunPtr.java:23
com.cliffc.aa.HM.HM.T2._name
String _name
Definition: HM.java:1298
com.cliffc.aa.HM.HM.T2.is_leaf
boolean is_leaf()
Definition: HM.java:1355
com.cliffc.aa.HM.HM.T2.meet_opens
boolean meet_opens(T2 that)
Definition: HM.java:1503
com.cliffc.aa.type.Type.isa
boolean isa(Type t)
Definition: Type.java:623
com.cliffc.aa.util.Util.find
static int find(int[] es, int e)
Definition: Util.java:6
com.cliffc.aa.HM.HM.T2.ODUPS
static final VBitSet ODUPS
Definition: HM.java:1933
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.type.Bits.clear
B clear(int bit)
Definition: Bits.java:255
com.cliffc.aa.type.Type.join
Type join(Type t)
Definition: Type.java:619
com.cliffc.aa.HM.HM.T2.CDUPS
static final HashMap< T2, T2 > CDUPS
Definition: HM.java:1961
com.cliffc.aa.HM.HM.T2.vput
boolean vput(T2 that, boolean progress)
Definition: HM.java:1895
com.cliffc.aa.type.Type.SCALAR
static final Type SCALAR
Definition: Type.java:328
com.cliffc.aa.HM.HM.T2.VARS
static final HashMap< T2, T2 > VARS
Definition: HM.java:1768
com.cliffc.aa.type.Type.widen
Type widen()
Definition: Type.java:828
com.cliffc.aa.HM.HM.T2.meet_ids
String[] meet_ids(T2 that)
Definition: HM.java:1492
com.cliffc.aa.HM.HM.T2._p
SB _p(SB sb, VBitSet visit, VBitSet dups)
Definition: HM.java:2209
com.cliffc.aa.type.TypeStruct.UF
static final NonBlockingHashMapLong< Type > UF
Definition: TypeStruct.java:475
com.cliffc.aa.HM.HM.T2._cycle_equals
boolean _cycle_equals(T2 t)
Definition: HM.java:1968
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.HM.T2.union_err
boolean union_err(T2 that, Worklist work, String msg)
Definition: HM.java:1757
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.HM.HM.T2.UPDATE_VISIT
static final VBitSet UPDATE_VISIT
Definition: HM.java:2117
com.cliffc.aa.HM.HM.T2.is_struct
boolean is_struct()
Definition: HM.java:1361
com.cliffc.aa.HM.HM.T2._fresh
T2 _fresh(VStack nongen)
Definition: HM.java:1904
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.type.Type.meet_nil
Type meet_nil(Type nil)
Definition: Type.java:904
com.cliffc.aa.HM.HM.T2.unify_nil
boolean unify_nil(T2 that, Worklist work)
Definition: HM.java:1559
com.cliffc.aa.type.TypeFld.NO_DISP
static final TypeFld NO_DISP
Definition: TypeFld.java:170
com.cliffc.aa.HM.HM.T2.fresh_base
boolean fresh_base(T2 that, Worklist work)
Definition: HM.java:1719
com.cliffc.aa.type.TypeFunPtr._fidxs
BitsFun _fidxs
Definition: TypeFunPtr.java:26
com.cliffc.aa.HM.HM.T2.walk_types_out
Type walk_types_out(Type t)
Definition: HM.java:2061
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.HM.HM.T2._occurs_in_type
boolean _occurs_in_type(T2 x)
Definition: HM.java:1934
com.cliffc.aa.type.TypeStruct.install_cyclic
TypeStruct install_cyclic(Ary< Type > reachs)
Definition: TypeStruct.java:422
com.cliffc.aa.HM.HM.T2.args
T2 args(int i)
Definition: HM.java:1415
com.cliffc.aa.HM.HM.T2.add_deps_work_impl
void add_deps_work_impl(Worklist work)
Definition: HM.java:2133
com.cliffc.aa.type.Type.meet
final Type meet(Type t)
Definition: Type.java:412
com.cliffc.aa.type.TypeStruct
A memory-based collection of optionally named fields.
Definition: TypeStruct.java:50
com.cliffc.aa.type.Bits.test
static boolean test(long[] bits, int i)
Definition: Bits.java:224
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.HM.T2.FIDX_VISIT
static final VBitSet FIDX_VISIT
Definition: HM.java:2098
com.cliffc.aa.HM.HM.T2.push_update
T2 push_update(Ary< Syntax > as)
Definition: HM.java:2118
com.cliffc.aa.HM.HM.T2.FIDXS
static BitsFun FIDXS
Definition: HM.java:2099
com.cliffc.aa.util.SB.unchar
SB unchar()
Definition: SB.java:58
com.cliffc.aa.HM.HM.T2._flow
Type _flow
Definition: HM.java:1309
com.cliffc.aa.util.VBitSet.tset
boolean tset(int idx)
Definition: VBitSet.java:7
com.cliffc.aa.HM.HM.T2.is_base
boolean is_base()
Definition: HM.java:1358
com.cliffc.aa.HM.HM.T2.push_update_impl
void push_update_impl(Syntax a)
Definition: HM.java:2120
com.cliffc.aa.HM.HM.T2.CNT
static int CNT
Definition: HM.java:1292
com.cliffc.aa.HM.HM.T2.walk_types_in
Type walk_types_in(Type t)
Definition: HM.java:2005
com.cliffc.aa.HM.HM.T2._as_flow
Type _as_flow()
Definition: HM.java:1434
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.HM.T2.p
String p()
Definition: HM.java:2205
com.cliffc.aa.HM.HM.T2._alias
BitsAlias _alias
Definition: HM.java:1312
com.cliffc.aa.HM.HM.T2.cycle_equals
boolean cycle_equals(T2 t)
Definition: HM.java:1962
com.cliffc.aa.HM.HM.T2._find0
T2 _find0()
Definition: HM.java:1379
com.cliffc.aa.type.Type.RECURSIVE_MEET
static int RECURSIVE_MEET
Definition: Type.java:163
com.cliffc.aa.util.Util
Definition: Util.java:5
com.cliffc.aa.HM.HM.T2.is_err
boolean is_err()
Definition: HM.java:1362
com.cliffc.aa.type.TypeStruct.reachable
Ary< Type > reachable()
Definition: TypeStruct.java:779
com.cliffc.aa.type.Bits.meet_nil
B meet_nil()
Definition: Bits.java:212
com.cliffc.aa.HM.HM.T2.is_tuple
boolean is_tuple()
Definition: HM.java:2269
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.HM.T2.meet_fidxs
BitsFun meet_fidxs(T2 that)
Definition: HM.java:1482
com.cliffc.aa.HM.HM.T2._args
T2[] _args
Definition: HM.java:1301
com.cliffc.aa.HM.HM.T2._find
T2 _find(int uid, VBitSet visit)
Definition: HM.java:2279
com.cliffc.aa.HM.HM.id
static String id()
Definition: HM.java:240
com.cliffc.aa.type.TypeStr
Definition: TypeStr.java:14
com.cliffc.aa.HM.HM.T2.base_states
int base_states()
Definition: HM.java:1515
com.cliffc.aa.HM.HM.T2.DUPS
static final HashMap< Long, T2 > DUPS
Definition: HM.java:1603
com.cliffc.aa.HM.HM.T2._open
boolean _open
Definition: HM.java:1314
com.cliffc.aa.HM.HM.T2._err
String _err
Definition: HM.java:1315
com.cliffc.aa.util.VBitSet
Definition: VBitSet.java:5
com.cliffc.aa.type.BitsFun
Definition: BitsFun.java:7
com.cliffc.aa.HM.HM.DEBUG_LEAKS
static final boolean DEBUG_LEAKS
Definition: HM.java:88
com.cliffc.aa.HM.HM.T2._cycle_equals_struct
boolean _cycle_equals_struct(T2 t)
Definition: HM.java:1992
com.cliffc.aa.util.SB
Tight/tiny StringBuilder wrapper.
Definition: SB.java:8
com.cliffc.aa.HM.HM.T2.T2
T2(@NotNull String name)
Definition: HM.java:1348
com.cliffc.aa.HM.HM.T2._get_dups
VBitSet _get_dups(VBitSet visit, VBitSet dups)
Definition: HM.java:2149
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.HM.T2._can_be_HM_base
boolean _can_be_HM_base(T2 that, Type that_flow)
Definition: HM.java:1749
com.cliffc.aa.HM.HM.T2._deps
Ary< Syntax > _deps
Definition: HM.java:1318
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.HM.T2.VCNT
static int VCNT
Definition: HM.java:2206
com.cliffc.aa.HM.HM.T2.copy
T2 copy()
Definition: HM.java:1335
com.cliffc.aa.HM.HM.T2.fput
Type fput(final Type t)
Definition: HM.java:2056
com.cliffc.aa.HM.HM.T2.no_uf
boolean no_uf()
Definition: HM.java:1356
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.HM.T2._fresh_unify_struct
boolean _fresh_unify_struct(T2 that, VStack nongen, Worklist work)
Definition: HM.java:1855
com.cliffc.aa.HM.HM.T2.make_err
static T2 make_err(String s)
Definition: HM.java:1333
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.HM.T2.meet_flow
Type meet_flow(T2 that)
Definition: HM.java:1477
com.cliffc.aa.HM.HM.T2.nongen_in
boolean nongen_in(VStack vs)
Definition: HM.java:1950
com.cliffc.aa.HM.HM.T2.is_nilable
boolean is_nilable()
Definition: HM.java:1359
com.cliffc.aa.HM.HM.T2.find
T2 find()
Definition: HM.java:1374
com.cliffc.aa.HM.HM.T2.make_struct
static T2 make_struct(BitsAlias aliases, String[] ids, T2[] flds)
Definition: HM.java:1325
com.cliffc.aa.HM.HM.T2._unify_struct
void _unify_struct(T2 that, Worklist work)
Definition: HM.java:1667
com.cliffc.aa.type.TypeStruct.shrink
static TypeStruct shrink(Ary< Type > reaches, TypeStruct tstart)
Definition: TypeStruct.java:657
com.cliffc.aa.HM.HM.T2.VNAMES
static final HashMap< T2, Integer > VNAMES
Definition: HM.java:2207
com.cliffc.aa.type.Type.XNIL
static final Type XNIL
Definition: Type.java:333
com.cliffc.aa.HM.HM.T2.dbl_uid
long dbl_uid(T2 t)
Definition: HM.java:1716
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.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.HM.HM.T2.meet_alias
BitsAlias meet_alias(T2 that)
Definition: HM.java:1487
com.cliffc.aa.type.Bits.meet
B meet(final B bs)
Definition: Bits.java:298
com.cliffc.aa.HM.HM.T2._union
boolean _union(T2 that, Worklist work)
Definition: HM.java:1578
com.cliffc.aa.type.TypeStruct._cyclic
boolean _cyclic
Definition: TypeStruct.java:54
com.cliffc.aa.HM.HM.T2.get_dups
VBitSet get_dups(VBitSet dups)
Definition: HM.java:2148
com.cliffc.aa.HM.HM.T2.meet_err
String meet_err(T2 that)
Definition: HM.java:1509
com.cliffc.aa.HM.HM.T2.str
SB str(SB sb, VBitSet visit, VBitSet dups)
Definition: HM.java:2163
com.cliffc.aa.HM.HM.T2.is_fun
boolean is_fun()
Definition: HM.java:1360
com.cliffc.aa.HM.HM.T2.ADUPS
static final NonBlockingHashMapLong< TypeStruct > ADUPS
Definition: HM.java:1426
com.cliffc.aa.type.TypeFld.make_from
TypeFld make_from(Type t)
Definition: TypeFld.java:66
com.cliffc.aa.HM.HM.T2._ids
String[] _ids
Definition: HM.java:1313
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.HM.T2.union
boolean union(T2 that, Worklist work)
Definition: HM.java:1527
com.cliffc.aa.HM.HM.T2.miss_field
T2 miss_field(String id)
Definition: HM.java:1334
com.cliffc.aa.HM.HM.T2._fidxs
BitsFun _fidxs
Definition: HM.java:1310
com.cliffc.aa.HM.HM.T2._uid
final int _uid
Definition: HM.java:1293
com.cliffc.aa.type.TypeMemPtr
Definition: TypeMemPtr.java:14
com.cliffc.aa.HM.HM.T2._fresh_unify
boolean _fresh_unify(T2 that, VStack nongen, Worklist work)
Definition: HM.java:1780
com.cliffc.aa.HM.HM.T2._unify
boolean _unify(T2 that, Worklist work)
Definition: HM.java:1615
com.cliffc.aa.HM.HM.T2.debug_find
T2 debug_find()
Definition: HM.java:1364
com.cliffc.aa.HM.HM.T2._find_fidxs
void _find_fidxs()
Definition: HM.java:2101
com.cliffc.aa.type.TypeMemPtr.make
static TypeMemPtr make(BitsAlias aliases, TypeObj obj)
Definition: TypeMemPtr.java:66