aa
com.cliffc.aa.type.TypeMem Class Reference

Memory type; the state of all of memory; memory edges order memory ops. More...

Inheritance diagram for com.cliffc.aa.type.TypeMem:
[legend]
Collaboration diagram for com.cliffc.aa.type.TypeMem:
[legend]

Public Member Functions

boolean above (Type t)
 
boolean above_center ()
 
TypeObj[] alias2objs ()
 
BitsAlias aliases ()
 
BitsAlias all_reaching_aliases (BitsAlias aliases)
 
BitsAlias and_unused (BitsAlias escs)
 
TypeObj at (int alias)
 
boolean basic_live ()
 
final boolean contains (Type t)
 
TypeMem crush ()
 
boolean cycle_equals (Type o)
 
final T dual ()
 
boolean equals (Object o)
 
TypeMem flatten_fields ()
 
boolean fld_is_mod (BitsAlias aliases, String fld)
 
double getd ()
 
long getl ()
 
String getstr ()
 
boolean has_name ()
 
boolean has_used (BitSet aliases)
 
final int hashCode ()
 
Type high ()
 
boolean is_con ()
 
boolean is_display_ptr ()
 
boolean is_forward_ref ()
 
boolean is_live ()
 
boolean isa (Type t)
 
final boolean isa_scalar ()
 
byte isBitShape (Type t)
 
Type join (Type t)
 
TypeObj ld (TypeMemPtr ptr)
 
int len ()
 
TypeLive live ()
 
boolean live_no_disp ()
 
Type make_from (Type head, TypeMem map, VBitSet visit)
 
boolean may_be_con ()
 
boolean may_nil ()
 
final Type meet (Type t)
 
Type meet_loop (Type t2)
 
Type meet_nil (Type nil)
 
boolean must_nil ()
 
Type oob ()
 
Type oob (Type e)
 
TypeMem oob (TypeMem e)
 
TypeMemPtr oob (TypeMemPtr e)
 
TypeObj oob (TypeObj e)
 
TypeStruct oob (TypeStruct e)
 
Type oob_deep (Type t)
 
Type oop_deep_impl (Type t)
 
TypeMem remove (BitsAlias escs)
 
final T remove_name ()
 
TypeMem remove_no_escapes (BitsAlias escs, String fld, Type live)
 
TypeMem set (int alias, TypeObj obj)
 
final T set_name (String name)
 
TypeMemPtr sharpen (TypeMemPtr dull)
 
Type sharptr (Type ptr)
 
Type simple_ptr ()
 
TypeMem slice_reaching_aliases (BitsAlias aliases)
 
TypeMem st_new (int alias, TypeObj obj)
 
SB str (SB sb, VBitSet dups, TypeMem mem, boolean debug)
 
final String toString ()
 
TypeMem update (BitsAlias aliases, Access fin, String fld, Type val)
 
TypeMem update (BitsAlias aliases, TypeInt idx, Type val)
 
void walk (Predicate< Type > p)
 
TypeMem widen ()
 

Static Public Member Functions

static Ary< TypeALL_TYPES ()
 
static boolean eq (Type[] t0, Type[] t1)
 
static void init0 (HashMap< String, Type > types)
 
static boolean intern_check ()
 
static TypeMem make (BitsAlias aliases, TypeObj oop)
 
static TypeMem make (int alias, TypeObj oop)
 
static TypeMem make0 (TypeObj[] as)
 
static TypeMem make_live (TypeLive live)
 

Public Attributes

int _hash
 
String _name
 
int _uid
 

Static Public Attributes

static final Type ALL
 
static final Type ANY
 
static final TypeMem ANYMEM
 
static final Type CTRL
 
static final TypeMem DEAD
 
static final TypeMem EMPTY
 
static final TypeMem ESCAPE
 
static final TypeMem FULL
 
static final TypeMem MEM
 
static final TypeMem MEM_ABC
 
static final Type NIL
 
static final Type NSCALR
 
static final Type REAL
 
static int RECURSIVE_MEET
 
static final Type SCALAR
 
static final Type XCTRL
 
static final TypeMem XMEM
 
static final Type XNIL
 
static final Type XNSCALR
 
static final Type XSCALAR
 

Protected Member Functions

Type clone ()
 
init (byte type, String name)
 
TypeMem xdual ()
 
Type xmeet (Type t)
 

Package Functions

int compute_hash ()
 
boolean contains (Type t, VBitSet bs)
 
final Type cross_nil (Type t)
 
final T hashcons_free ()
 
boolean intern_check1 ()
 
Type intern_lookup ()
 
boolean interned ()
 
boolean is_display ()
 
final String mtname (Type t, Type mt)
 
Type not_nil ()
 
rdual ()
 
TypeStruct repeats_in_cycles (TypeStruct head, VBitSet bs)
 
final T retern ()
 
TypeMemPtr sharp_get (TypeMemPtr tmp)
 
TypeMemPtr sharput (TypeMemPtr dull, TypeMemPtr sharp)
 
RuntimeException typerr (Type t)
 
final T untern ()
 

Static Package Functions

 [static initializer]
 
 [static initializer]
 
static TypeObj at (TypeObj[] tos, int alias)
 
static int at_idx (TypeObj[]tos, int alias)
 
static boolean check_name (String n)
 
static boolean check_startup ()
 
static void concat (Ary< Type > ts, Type[] ts1)
 
static Type intern_find (int uid)
 
static int intern_size ()
 
static Type make (byte type)
 

Package Attributes

_dual
 
byte _type
 

Static Package Attributes

static final TypeMem ALIVE
 
static final TypeMem ALLMEM
 
static final TypeMem LESC_NO_DISP
 
static final TypeMem LIVE_BOT
 
static final TypeMem LNO_DISP
 
static final TypeMem MEM_STR
 
static final Type NREAL
 
static final Pool[] POOLS
 
static final byte TALL
 
static final byte TANY
 
static final byte TARY
 
static final byte TCTRL
 
static final byte TFLD
 
static final byte TFLT
 
static final byte TFUNPTR
 
static final byte TFUNSIG
 
static final byte TINT
 
static final byte TLAST
 
static final byte TLIVE
 
static final byte TMEM
 
static final byte TMEMPTR
 
static final byte TNIL
 
static final byte TNREAL
 
static final byte TNSCALR
 
static final byte TOBJ
 
static final byte TREAL
 
static final byte TRPC
 
static final byte TSCALAR
 
static final byte TSIMPLE
 
static final byte TSTR
 
static final byte TSTRUCT
 
static final byte TTUPLE
 
static final byte TXCTRL
 
static final byte TXNIL
 
static final byte TXNREAL
 
static final byte TXNSCALR
 
static final byte TXREAL
 
static final byte TXSCALAR
 
static final TypeMem[] TYPES = new TypeMem[]{FULL,MEM,MEM_ABC.dual(),ALLMEM,ESCAPE}
 

Private Member Functions

_set_name (String name)
 
int _uid ()
 
boolean check_commute (Type t, Type mt)
 
boolean check_symmetric (Type t, Type mt)
 
hashcons ()
 
TypeMem init (TypeObj[] pubs)
 
boolean intern_check0 (Type v)
 
boolean is_num ()
 
boolean is_ptr ()
 
boolean is_simple ()
 
Type xmt_name (Type t, Type mt)
 

Static Private Member Functions

static TypeObj[] _make1 (TypeObj[] as)
 
static TypeObj _meet (TypeObj a, TypeObj b, boolean is_loop)
 
static TypeObj[] _meet (TypeObj[] as, TypeObj[] bs, boolean is_loop)
 
static TypeObj[] _st_new (TypeObj[] base, TypeObj[] as, int alias)
 
static boolean check (TypeObj[] as)
 
static TypeObj ld (TypeObj[] tos, BitsAlias aliases)
 
static TypeMem make (TypeObj[] pubs)
 

Private Attributes

TypeObj[] _pubs
 
HashMap< TypeMemPtr, TypeMemPtr_sharp_cache
 

Static Private Attributes

static Ary< TypeALL_TYPES
 
static int CNT
 
static final ConcurrentHashMap< Type, TypeINTERN
 
static final byte[] ISA_SCALAR
 
static final char[] LIVEC = new char[]{' ','#','R','3'}
 
static Type[] SCALAR_PRIMS
 
static final String[] STRS
 
static final Type XNREAL
 
static final Type XREAL
 

Detailed Description

Memory type; the state of all of memory; memory edges order memory ops.

Produced at the program start, consumed by all function calls, consumed be Loads, consumed and produced by Stores. Can be broken out in the "equiv- alence class" (Alias#) model of memory over a bulk memory to allow more fine grained knowledge. Memory is accessed via Alias::s, where all TypeObjs in an Alias class are Meet together as an approximation.

Conceptually, each alias# represents an infinite set of pointers - broken into equivalence classes. We can split such a class in half - some pointers will go left and some go right, and where we can't tell we'll use both sets. Any alias set is a tree-like nested set of sets bottoming out in individual pointers. The types are conceptually unchanged if we start using e.g. 2 alias::s instead of 1 everywhere - we've just explicitly named the next layer in the tree-of-sets.

Splitting happens during code-cloning (inlining) where we make a copy of an alias generator (NewNode). Both copies are alias renumbered to child alias numbers from the parent. The IR will be holding on to some copies of the original alias#, which is now confused with both children. After a full round of gcp() this confusion will be removed. While the confusion is not (yet) removed, we will have to deal with this mixture of the left child, right child, and parent.

We use an "all-memory" notion to handle the worse-case from e.g. all unknown calls. Really the worse a Call can be is to "leak" all aliases that come in to the the call (and are reachable from those) - but we need a convenient Bottom type. Missing aliases default to TypeObj.

The representation is a collection of TypeObjs indexed by alias#. Missing aliases are always equal to their nearest present parent. The root at alias#1 is only either TypeObj.BOT or TOP. Alias#0 is nil and is always missing. The structure is canonicalized; if a child is a dup of a parent it is removed (since an ask will yield the correct value from the parent).

There is no meet/join relationship between parent and child; a child can be precisely updated independently from the parent and other siblings.

CNC - Observe that the alias Trees on Fields applies to Indices on arrays as well - if we can group indices in a tree-like access pattern (obvious one being All vs some Constants).

Definition at line 53 of file TypeMem.java.

Member Function Documentation

◆ [static initializer]() [1/2]

com.cliffc.aa.type.TypeMem.[static initializer]
staticpackage

◆ [static initializer]() [2/2]

com.cliffc.aa.type.TypeMem.[static initializer]
staticpackage

◆ _make1()

static TypeObj [] com.cliffc.aa.type.TypeMem._make1 ( TypeObj[]  as)
staticprivate

Definition at line 179 of file TypeMem.java.

179  {
180  int len = as.length;
181  if( len > 1 && as[1]==null ) {
182  int i; for( i=2; i<len; i++ )
183  if( as[i]!=null && as[i] != TypeObj.XOBJ )
184  break;
185  if( i==len ) return null; // All things are dead, so dead
186  as[1] = TypeObj.XOBJ; // Default memory is "do not care"
187  }
188  if( len <= 2 ) return as;
189  // No dups of a parent
190  for( int i=1; i<as.length; i++ )
191  if( as[i] != null )
192  for( int par = BitsAlias.TREE.parent(i); par!=0; par = BitsAlias.TREE.parent(par) )
193  if( as[par] != null ) {
194  if( as[par] == as[i] ) as[i] = null;
195  break;
196  }
197  // Remove trailing nulls; make the array "tight"
198  while( as[len-1] == null ) len--;
199  if( as.length!=len ) as = Arrays.copyOf(as,len);
200  return as;
201  }

References com.cliffc.aa.type.TypeMem.len(), com.cliffc.aa.type.BitsAlias.TREE, and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.XOBJ.

Referenced by com.cliffc.aa.type.TypeMem.make0(), com.cliffc.aa.type.TypeMem.meet_loop(), com.cliffc.aa.type.TypeMem.update(), and com.cliffc.aa.type.TypeMem.xmeet().

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

◆ _meet() [1/2]

static TypeObj com.cliffc.aa.type.TypeMem._meet ( TypeObj  a,
TypeObj  b,
boolean  is_loop 
)
staticprivate

Definition at line 297 of file TypeMem.java.

297  {
298  return (TypeObj)(is_loop ? a.meet_loop(b) : a.meet(b));
299  }

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

Here is the call graph for this function:

◆ _meet() [2/2]

static TypeObj [] com.cliffc.aa.type.TypeMem._meet ( TypeObj[]  as,
TypeObj[]  bs,
boolean  is_loop 
)
staticprivate

Definition at line 280 of file TypeMem.java.

280  {
281  TypeObj mt_live = (TypeObj)as[0].meet(bs[0]);
282  int len = Math.max(as.length,bs.length);
283  int mlen = Math.min(as.length,bs.length);
284  if( mlen==1 ) { // At least 1 is short
285  // Short & low "wins": result is short.
286  if( (!as[0].above_center() && as.length==1) ||
287  (!bs[0].above_center() && bs.length==1) )
288  return new TypeObj[]{mt_live};
289  }
290  TypeObj[] objs = new TypeObj[len];
291  objs[0] = mt_live;
292  for( int i=1; i<len; i++ )
293  objs[i] = i<mlen && as[i]==null && bs[i]==null // Shortcut null-vs-null
294  ? null : _meet(at(as,i),at(bs,i),is_loop); // meet element-by-element
295  return objs;
296  }

References com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.above_center(), com.cliffc.aa.type.TypeMem.above_center(), com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.TypeMem.len(), and com.cliffc.aa.type.Type< TypeMem >.meet().

Referenced by com.cliffc.aa.type.TypeMem.meet_loop(), and com.cliffc.aa.type.TypeMem.xmeet().

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

◆ _set_name()

T com.cliffc.aa.type.Type< T extends Type< T >._set_name ( String  name)
privateinherited

Definition at line 558 of file Type.java.

558  {
559  POOLS[_type]._clone++;
560  T t1 = (T)clone();
561  t1._name = name;
562  return t1.hashcons_free();
563  }

◆ _st_new()

static TypeObj [] com.cliffc.aa.type.TypeMem._st_new ( TypeObj[]  base,
TypeObj[]  as,
int  alias 
)
staticprivate

Definition at line 454 of file TypeMem.java.

454  {
455  return base==as ? Arrays.copyOf(base,Math.max(base.length,alias+1)) : as;
456  }

Referenced by com.cliffc.aa.type.TypeMem.st_new().

Here is the caller graph for this function:

◆ _uid()

int com.cliffc.aa.type.Type< T extends Type< T >._uid
privateinherited

Definition at line 103 of file Type.java.

103 { return CNT++; }

◆ above()

boolean com.cliffc.aa.type.Type< T extends Type< T >.above ( Type< TypeMem t)
inherited

Definition at line 625 of file Type.java.

625 { return t != this && meet(t)==t; }

◆ above_center()

boolean com.cliffc.aa.type.TypeMem.above_center ( )

Definition at line 548 of file TypeMem.java.

548  {
549  for( TypeObj alias : _pubs )
550  if( alias != null && !alias.above_center() && !alias.is_con() )
551  return false;
552  return true;
553  }

References com.cliffc.aa.type.TypeMem._pubs.

Referenced by com.cliffc.aa.type.TypeMem._meet(), com.cliffc.aa.type.TypeMem.aliases(), com.cliffc.aa.type.TypeMem.check(), com.cliffc.aa.node.MemPrimNode.LValueLength.live_use(), and com.cliffc.aa.node.LoadNode.live_use().

Here is the caller graph for this function:

◆ alias2objs()

TypeObj [] com.cliffc.aa.type.TypeMem.alias2objs ( )

Definition at line 148 of file TypeMem.java.

148 { return _pubs; }

References com.cliffc.aa.type.TypeMem._pubs.

Referenced by com.cliffc.aa.type.TypeMemPtr.make_from(), and com.cliffc.aa.node.DefMemNode.make_mem().

Here is the caller graph for this function:

◆ aliases()

BitsAlias com.cliffc.aa.type.TypeMem.aliases ( )

Definition at line 152 of file TypeMem.java.

152  {
153  if( this== FULL ) return BitsAlias.NZERO;
154  if( this==EMPTY ) return BitsAlias.EMPTY;
155  BitsAlias bas = BitsAlias.EMPTY;
156  for( int i = 0; i< _pubs.length; i++ )
157  if( _pubs[i]!=null && !_pubs[i].above_center() )
158  bas = bas.set(i);
159  return bas;
160  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeMem.above_center(), com.cliffc.aa.type.BitsAlias.EMPTY, com.cliffc.aa.type.TypeMem.EMPTY, com.cliffc.aa.type.TypeMem.FULL, com.cliffc.aa.type.BitsAlias.NZERO, and com.cliffc.aa.type.Bits< B extends Bits< B >.set().

Referenced by com.cliffc.aa.type.TypeMem.all_reaching_aliases(), com.cliffc.aa.type.TypeMem.fld_is_mod(), com.cliffc.aa.type.TypeMem.has_used(), com.cliffc.aa.type.TypeMem.ld(), com.cliffc.aa.type.TypeMem.make(), com.cliffc.aa.type.TypeMem.slice_reaching_aliases(), and com.cliffc.aa.type.TypeMem.update().

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

◆ all_reaching_aliases()

BitsAlias com.cliffc.aa.type.TypeMem.all_reaching_aliases ( BitsAlias  aliases)

Definition at line 349 of file TypeMem.java.

349  {
350  if( aliases==BitsAlias.NIL || aliases==BitsAlias.EMPTY ) return BitsAlias.EMPTY;
351  if( aliases==BitsAlias.FULL ) return aliases;
352  AryInt work = new AryInt();
353  VBitSet visit = new VBitSet();
354  for( int alias : aliases )
355  for( int kid=alias; kid!=0; kid = BitsAlias.next_kid(alias,kid) )
356  { work.push(kid); visit.set(kid); }
357 
358  while( !work.isEmpty() ) {
359  int alias=work.pop();
360  if( alias==0 ) continue;
361  TypeObj to = at(alias);
362  if( to==TypeObj.OBJ || to==TypeObj.ISUSED )
363  return BitsAlias.FULL; // All structs with all possible pointers
364  if( !(to instanceof TypeStruct) ) continue;
365  TypeStruct ts = (TypeStruct)to;
366  // Incomplete struct? This is an early escapee from Parse times; more
367  // fields may be added which we assume is a pointer to all.
368  if( ts._open )
369  return BitsAlias.FULL; // Generic open struct points to all
370  for( TypeFld tfld : ts.flds() ) {
371  Type fld = tfld._t;
372  if( TypeMemPtr.OOP.isa(fld) )
373  fld = TypeMemPtr.OOP; // All possible pointers
374  if( fld instanceof TypeFunPtr ) fld = ((TypeFunPtr)fld)._disp;
375  if( !(fld instanceof TypeMemPtr) ) continue; // Not a pointer, no more aliases
376  if( ((TypeMemPtr)fld)._aliases.test(1) )
377  return BitsAlias.FULL; // All possible pointers
378  // Walk the possible pointers, and include them in the slice
379  for( int ptralias : ((TypeMemPtr)fld)._aliases )
380  for( int kid=ptralias; kid!=0; kid = BitsAlias.next_kid(ptralias,kid) )
381  if( !visit.tset(kid) ) {
382  work.push(kid);
383  aliases = aliases.set(kid);
384  }
385  }
386  }
387  assert !aliases.may_nil();
388  return aliases;
389  }

References com.cliffc.aa.type.TypeStruct._open, com.cliffc.aa.type.TypeMem.aliases(), com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.BitsAlias.EMPTY, com.cliffc.aa.type.TypeStruct.flds(), com.cliffc.aa.type.BitsAlias.FULL, com.cliffc.aa.type.Type< T extends Type< T >.isa(), com.cliffc.aa.util.AryInt.isEmpty(), com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.ISUSED, com.cliffc.aa.type.Bits< B extends Bits< B >.may_nil(), com.cliffc.aa.type.BitsAlias.next_kid(), com.cliffc.aa.type.BitsAlias.NIL, com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.OBJ, com.cliffc.aa.type.TypeMemPtr.OOP, com.cliffc.aa.util.AryInt.pop(), com.cliffc.aa.util.AryInt.push(), com.cliffc.aa.type.Bits< B extends Bits< B >.set(), and com.cliffc.aa.util.VBitSet.tset().

Referenced by com.cliffc.aa.node.ScopeNode.compute_live_mem(), com.cliffc.aa.node.CallEpiNode.esc_out(), com.cliffc.aa.node.CallNode.live_use(), and com.cliffc.aa.node.CallNode.value().

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

◆ ALL_TYPES()

static Ary<Type> com.cliffc.aa.type.Type< T extends Type< T >.ALL_TYPES
staticinherited

Definition at line 651 of file Type.java.

651  {
652  if( ALL_TYPES != null ) return ALL_TYPES;
653  Ary<Type> ts = new Ary<>(new Type[1],0);
654  concat(ts,Type .TYPES);
655  concat(ts,TypeFlt .TYPES);
656  concat(ts,TypeFunPtr.TYPES);
657  concat(ts,TypeFunSig.TYPES);
658  concat(ts,TypeInt .TYPES);
659  concat(ts,TypeLive .TYPES);
660  concat(ts,TypeMem .TYPES);
661  concat(ts,TypeMemPtr.TYPES);
662  concat(ts,TypeObj .TYPES);
663  concat(ts,TypeRPC .TYPES);
664  concat(ts,TypeStr .TYPES);
665  concat(ts,TypeStruct.TYPES);
666  concat(ts,TypeTuple .TYPES);
667  concat(ts,TypeAry .TYPES);
668  // Partial order Sort, makes for easier tests later. Arrays.sort requires
669  // a total order (i.e., the obvious Comparator breaks the sort contract),
670  // so we hand-roll a simple bubble sort.
671  for( int i=0; i<ts._len; i++ )
672  for( int j=i+1; j<ts._len; j++ )
673  if( ts._es[j].isa(ts._es[i]) ) { Type tmp = ts._es[i]; ts._es[i] = ts._es[j]; ts._es[j] = tmp; }
674  return (ALL_TYPES = ts); // Preserve for tests
675  }

◆ and_unused()

BitsAlias com.cliffc.aa.type.TypeMem.and_unused ( BitsAlias  escs)

Definition at line 498 of file TypeMem.java.

498  {
499  int len = Math.max(_pubs.length,escs.max()+1);
500  BitsAlias bs = BitsAlias.EMPTY;
501  for( int i=1; i<len; i++ )
502  if( at(i)==TypeObj.UNUSED && escs.test_recur(i) )
503  bs = bs.set(i);
504  return bs;
505  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.BitsAlias.EMPTY, com.cliffc.aa.type.TypeMem.len(), com.cliffc.aa.type.Bits< B extends Bits< B >.max(), com.cliffc.aa.type.Bits< B extends Bits< B >.set(), com.cliffc.aa.type.Bits< B extends Bits< B >.test_recur(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED.

Referenced by com.cliffc.aa.node.CallNode.escapees().

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

◆ at() [1/2]

◆ at() [2/2]

static TypeObj com.cliffc.aa.type.TypeMem.at ( TypeObj[]  tos,
int  alias 
)
staticpackage

Definition at line 136 of file TypeMem.java.

136 { return tos.length==1 ? tos[0].oob(TypeObj.ISUSED): tos[at_idx(tos,alias)]; }

References com.cliffc.aa.type.TypeMem.at_idx(), com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.ISUSED, and com.cliffc.aa.type.Type< T extends Type< T >.oob().

Here is the call graph for this function:

◆ at_idx()

static int com.cliffc.aa.type.TypeMem.at_idx ( TypeObj[]  tos,
int  alias 
)
staticpackage

Definition at line 138 of file TypeMem.java.

138  {
139  if( alias==0 ) return 1; // Either base memory, or assert
140  while( true ) {
141  if( alias < tos.length && tos[alias] != null )
142  return alias;
143  alias = BitsAlias.TREE.parent(alias);
144  assert alias!=0;
145  }
146  }

References com.cliffc.aa.type.BitsAlias.TREE.

Referenced by com.cliffc.aa.type.TypeMem.at().

Here is the caller graph for this function:

◆ basic_live()

boolean com.cliffc.aa.type.TypeMem.basic_live ( )

Definition at line 561 of file TypeMem.java.

561 { return _pubs.length==1; }

References com.cliffc.aa.type.TypeMem._pubs.

Referenced by com.cliffc.aa.node.Node.live(), com.cliffc.aa.node.ProjNode.live_use(), com.cliffc.aa.node.CProjNode.live_use(), com.cliffc.aa.node.PhiNode.live_use(), com.cliffc.aa.node.ScopeNode.live_use(), com.cliffc.aa.node.CallNode.live_use(), and com.cliffc.aa.node.Node.live_uses().

Here is the caller graph for this function:

◆ check()

static boolean com.cliffc.aa.type.TypeMem.check ( TypeObj[]  as)
staticprivate

Definition at line 75 of file TypeMem.java.

75  {
76  if( !(as[0] instanceof TypeLive) ) return false; // Slot 0 reserved for live-ness
77  if( as.length == 1 ) return true;
78  if( as[1]!=TypeObj.OBJ && as[1]!=TypeObj.XOBJ &&
79  as[1]!=TypeObj.ISUSED && as[1]!=TypeObj.UNUSED &&
80  !(as[1] instanceof TypeLive) &&
81  as[1] != null )
82  return false; // Only 2 choices
83  if( as[0].above_center()!=as[1].above_center() ) return false;
84  if( as.length==2 ) return true; // Trivial all of memory
85  // "tight" - something in the last slot
86  if( as[as.length-1] == null ) return false;
87  // No dups of any parent
88  for( int i=2; i<as.length; i++ )
89  if( as[i] != null )
90  for( int par = BitsAlias.TREE.parent(i); par!=0; par = BitsAlias.TREE.parent(par) )
91  if( as[par] != null ) {
92  if( as[par] == as[i] ) return false; // Dup of a parent
93  break;
94  }
95  return true;
96  }

References com.cliffc.aa.type.TypeMem.above_center(), com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.ISUSED, com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.OBJ, com.cliffc.aa.type.BitsAlias.TREE, com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED, and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.XOBJ.

Referenced by com.cliffc.aa.type.TypeMem.init().

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

◆ check_commute()

boolean com.cliffc.aa.type.Type< T extends Type< T >.check_commute ( Type< TypeMem t,
Type< TypeMem mt 
)
privateinherited

Definition at line 593 of file Type.java.

593  {
594  if( t==this ) return true;
595  if( is_simple() && !t.is_simple() ) return true; // By design, flipped the only allowed order
596  Type mt2 = t.xmeet(this); // Reverse args and try again
597 
598  // Also reverse names.
599  Type nmt2 = t.xmt_name(this,mt2);
600 
601  if( mt==nmt2 ) return true;
602  System.out.println("Meet not commutative: "+this+".meet("+t+")="+mt+",\n but "+t+".meet("+this+")="+nmt2);
603  return false;
604  }

◆ check_name()

static boolean com.cliffc.aa.type.Type< T extends Type< T >.check_name ( String  n)
staticpackageinherited

Definition at line 548 of file Type.java.

548 { return n.isEmpty() || n.charAt(n.length()-1)==':'; }

◆ check_startup()

static boolean com.cliffc.aa.type.Type< T extends Type< T >.check_startup
staticpackageinherited

Definition at line 684 of file Type.java.

684  {
685  Type[] ts = ALL_TYPES().asAry();
686 
687  // Confirm commutative & complete
688  for( Type t0 : ts )
689  for( Type t1 : ts ) {
690  Type mt = t0.meet(t1);
691  assert t0.check_commute (t1,mt);
692  assert t0.check_symmetric(t1,mt);
693  }
694 
695  // Confirm associative
696  int errs=0;
697  for( Type t0 : ts )
698  for( Type t1 : ts )
699  for( Type t2 : ts ) {
700  Type t01 = t0 .meet(t1 );
701  Type t12 = t1 .meet(t2 );
702  Type t01_2 = t01.meet(t2 );
703  Type t0_12 = t0 .meet(t12);
704  if( t01_2 != t0_12 && errs++ < 10 )
705  System.err.println("("+t0+"&"+t1+") & "+t2+" == "+t0+" & ("+t1+" & "+t2+"); "+
706  "("+t01 +") & "+t2+" == "+t0+" & ("+t12 +"); "+
707  t01_2 +" == "+t0_12);
708  }
709  assert errs==0 : "Found "+errs+" associative errors";
710 
711 
712  // Confirm symmetry. If A isa B, then A.join(C) isa B.join(C)
713  for( Type t0 : ts )
714  for( Type t1 : ts ) {
715  if( t0.isa(t1) ) {
716  for( Type t2 : ts ) {
717  Type t02 = t0.join(t2);
718  Type t12 = t1.join(t2);
719  Type mt = t02.meet(t12);
720  if( mt != t12 && errs++ < 10 ) {
721  System.err.println("("+t0+" ^ "+t2+") = "+t02+"; "+
722  "("+t1+" ^ "+t2+") = "+t12+"; "+
723  "their meet = "+mt+" which is not "+t12);
724  }
725  }
726  }
727  }
728  assert errs==0 : "Found "+errs+" non-join-type errors";
729 
730  // Check scalar primitives; all are SCALARS and none sub-type each other.
731  SCALAR_PRIMS = new Type[] { TypeInt.INT64, TypeFlt.FLT64, TypeMemPtr.OOP0, TypeFunPtr.GENERIC_FUNPTR, TypeRPC.ALL_CALL };
732  for( Type t : SCALAR_PRIMS ) assert t.isa(SCALAR);
733  for( int i=0; i<SCALAR_PRIMS.length; i++ )
734  for( int j=i+1; j<SCALAR_PRIMS.length; j++ )
735  assert !SCALAR_PRIMS[i].isa(SCALAR_PRIMS[j]);
736 
737  return true;
738  }

◆ check_symmetric()

boolean com.cliffc.aa.type.Type< T extends Type< T >.check_symmetric ( Type< TypeMem t,
Type< TypeMem mt 
)
privateinherited

Definition at line 608 of file Type.java.

608  {
609  if( t==this ) return true;
610  Type ta = mt._dual.meet(t._dual);
611  Type tb = mt._dual.meet( _dual);
612  if( ta==t._dual && tb==_dual ) return true;
613  System.err.print("("+this+" & "+t+")=="+mt+" but \n("+mt._dual+" & ");
614  if( ta!=t._dual ) System.err.println(t._dual+")=="+ta+" \nwhich is not "+t._dual);
615  else System.err.println( _dual+")=="+tb+" \nwhich is not "+ _dual);
616  return false;
617  }

◆ clone()

Type com.cliffc.aa.type.Type< T extends Type< T >.clone
protectedinherited

Definition at line 304 of file Type.java.

304  {
305  try {
306  POOLS[_type]._clone++;
307  Type t = (Type)super.clone();
308  t._uid = _uid();
309  t._dual = null;
310  t._hash = 0;
311  if( t instanceof TypeStruct )
312  ((TypeStruct)t)._cyclic = false;
313  return t;
314  }
315  catch( CloneNotSupportedException cns ) { throw new RuntimeException(cns); }
316  }

◆ compute_hash()

int com.cliffc.aa.type.TypeMem.compute_hash ( )
package

Definition at line 97 of file TypeMem.java.

97  {
98  int sum=TMEM;
99  for( TypeObj obj : _pubs ) sum += obj==null ? 0 : obj._hash;
100  return sum;
101  }

References com.cliffc.aa.type.TypeMem._pubs, and com.cliffc.aa.type.Type< TypeMem >.TMEM.

◆ concat()

static void com.cliffc.aa.type.Type< T extends Type< T >.concat ( Ary< Type< TypeMem > >  ts,
Type< TypeMem >[]  ts1 
)
staticpackageinherited

Definition at line 676 of file Type.java.

676  {
677  for( Type t1 : ts1 ) {
678  assert !t1.above_center(); // Always below-center or equal, because we'll dual anyways
679  ts.push(t1);
680  if( t1!=t1.dual() ) ts.push(t1.dual());
681  }
682  }

◆ contains() [1/2]

final boolean com.cliffc.aa.type.Type< T extends Type< T >.contains ( Type< TypeMem t)
inherited

Definition at line 926 of file Type.java.

926 { return contains(t,null); }

◆ contains() [2/2]

boolean com.cliffc.aa.type.Type< T extends Type< T >.contains ( Type< TypeMem t,
VBitSet  bs 
)
packageinherited

Definition at line 927 of file Type.java.

927 { return this==t; }

◆ cross_nil()

final Type com.cliffc.aa.type.Type< T extends Type< T >.cross_nil ( Type< TypeMem t)
packageinherited

Definition at line 865 of file Type.java.

865 { return must_nil() || t.must_nil() ? SCALAR : NSCALR; }

◆ crush()

TypeMem com.cliffc.aa.type.TypeMem.crush ( )

Definition at line 425 of file TypeMem.java.

425  {
426  TypeObj[] oops = _pubs.clone();
427  oops[0] = null;
428  for( int i=1; i<oops.length; i++ )
429  if( oops[i]!=null ) oops[i] = oops[i].crush();
430  return TypeMem.make0(oops);
431  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.Type< T extends Type< T >.clone(), com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.crush(), and com.cliffc.aa.type.TypeMem.make0().

Here is the call graph for this function:

◆ cycle_equals()

boolean com.cliffc.aa.type.TypeMem.cycle_equals ( Type  o)

Definition at line 113 of file TypeMem.java.

113 { return equals(o); }

References com.cliffc.aa.type.TypeMem.equals().

Here is the call graph for this function:

◆ dual()

final T com.cliffc.aa.type.Type< T extends Type< T >.dual
inherited

Definition at line 361 of file Type.java.

361 { return _dual; }

◆ eq()

static boolean com.cliffc.aa.type.Type< T extends Type< T >.eq ( Type< TypeMem >[]  t0,
Type< TypeMem >[]  t1 
)
staticinherited

Definition at line 136 of file Type.java.

136  {
137  if( t0==t1 ) return true;
138  if( t0==null || t1==null ) return false;
139  if( t0.length != t1.length ) return false;
140  for( int i=0; i<t0.length; i++ )
141  if( t0[i] != t1[i] )
142  return false;
143  return true;
144  }

◆ equals()

boolean com.cliffc.aa.type.TypeMem.equals ( Object  o)

Definition at line 102 of file TypeMem.java.

102  {
103  if( this==o ) return true;
104  if( !(o instanceof TypeMem) ) return false;
105  TypeMem tf = (TypeMem)o;
106  if( _pubs .length != tf._pubs .length ) return false;
107  for( int i = 0; i< _pubs.length; i++ )
108  if( _pubs[i] != tf._pubs[i] ) // note '==' and NOT '.equals()'
109  return false;
110  return true;
111  }

References com.cliffc.aa.type.TypeMem._pubs.

Referenced by com.cliffc.aa.type.TypeMem.cycle_equals().

Here is the caller graph for this function:

◆ flatten_fields()

TypeMem com.cliffc.aa.type.TypeMem.flatten_fields ( )

Definition at line 522 of file TypeMem.java.

522  {
523  TypeObj to, tof=null;
524  int i; for( i=1; i< _pubs.length; i++ ) {
525  if( (to = _pubs[i]) != null && (tof = to.flatten_fields())!=to )
526  break;
527  }
528  if( i== _pubs.length ) return this;
529 
530  TypeObj[] tos = _pubs.clone();
531  tos[0] = null;
532  tos[i++] = tof;
533  for( ; i< _pubs.length; i++ )
534  if( tos[i] != null )
535  tos[i] = tos[i].flatten_fields();
536  return make0(tos);
537  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.Type< T extends Type< T >.clone(), com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.flatten_fields(), and com.cliffc.aa.type.TypeMem.make0().

Referenced by com.cliffc.aa.node.ScopeNode.compute_live_mem(), com.cliffc.aa.node.ScopeNode.live_use(), and com.cliffc.aa.TestLive.testNewObj().

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

◆ fld_is_mod()

boolean com.cliffc.aa.type.TypeMem.fld_is_mod ( BitsAlias  aliases,
String  fld 
)

Definition at line 508 of file TypeMem.java.

508  {
509  for( int alias : aliases ) {
510  if( alias != 0 ) {
511  TypeObj to = at(alias);
512  if( !(to instanceof TypeStruct) ) return true;
513  TypeStruct ts = (TypeStruct)to;
514  int idx = ts.fld_find(fld);
515  if( idx == -1 || ts.fld(idx)._access != Access.Final )
516  return true; // Cannot check for R/O here, because R/O can lift to R/W
517  }
518  }
519  return false;
520  }

References com.cliffc.aa.type.TypeFld._access, com.cliffc.aa.type.TypeMem.aliases(), com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.TypeFld.Access.Final, com.cliffc.aa.type.TypeStruct.fld(), and com.cliffc.aa.type.TypeStruct.fld_find().

Referenced by com.cliffc.aa.node.LoadNode._find_previous_store_call().

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

◆ getd()

double com.cliffc.aa.type.Type< T extends Type< T >.getd
inherited

Definition at line 804 of file Type.java.

804 { if( _type==TNIL || _type==TXNIL ) return 0.0; throw typerr(null); }

◆ getl()

long com.cliffc.aa.type.Type< T extends Type< T >.getl
inherited

Definition at line 802 of file Type.java.

802 { if( _type==TNIL || _type==TXNIL ) return 0; throw typerr(null); }

◆ getstr()

String com.cliffc.aa.type.Type< T extends Type< T >.getstr
inherited

Definition at line 806 of file Type.java.

806 { throw typerr(null); }

◆ has_name()

boolean com.cliffc.aa.type.Type< T extends Type< T >.has_name
inherited

Definition at line 549 of file Type.java.

549 { return !_name.isEmpty(); }

◆ has_used()

boolean com.cliffc.aa.type.TypeMem.has_used ( BitSet  aliases)

Definition at line 312 of file TypeMem.java.

312  {
313  for( int alias = aliases.nextSetBit(0); alias != -1; alias = aliases.nextSetBit(alias + 1))
314  if( at(alias)!= TypeObj.UNUSED )
315  return true; // Has a not-unused (some used) type
316  return false;
317  }

References com.cliffc.aa.type.TypeMem.aliases(), com.cliffc.aa.type.TypeMem.at(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED.

Here is the call graph for this function:

◆ hashCode()

final int com.cliffc.aa.type.Type< T extends Type< T >.hashCode
inherited

Definition at line 106 of file Type.java.

106 { assert _hash!=0; return _hash; }

◆ hashcons()

T com.cliffc.aa.type.Type< T extends Type< T >.hashcons
privateinherited

Definition at line 165 of file Type.java.

165  {
166  _hash = compute_hash(); // Set hash
167  T t2 = (T)INTERN.get(this); // Lookup
168  if( t2!=null ) { // Found prior
169  assert t2._dual != null; // Prior is complete with dual
170  assert this != t2; // Do not hashcons twice, should not get self back
171  return t2; // Return prior
172  }
173  if( RECURSIVE_MEET > 0 ) // Mid-building recursive types; do not intern
174  return (T)this;
175  // Not in type table
176  _dual = null; // No dual yet
177  INTERN.put(this,this); // Put in table without dual
178  T d = xdual(); // Compute dual without requiring table lookup, and not setting name
179  d._name = _name; // xdual does not set name either
180  d._hash = d.compute_hash(); // Set dual hash
181  _dual = d;
182  if( this==d ) return d; // Self-symmetric? Dual is self
183  assert !equals(d); // Self-symmetric is handled by caller
184  assert d._dual==null; // Else dual-dual not computed yet
185  assert INTERN.get(d)==null;
186  d._dual = (T)this;
187  INTERN.put(d,d);
188  return (T)this;
189  }

◆ hashcons_free()

final T com.cliffc.aa.type.Type< T extends Type< T >.hashcons_free
packageinherited

Definition at line 153 of file Type.java.

153  {
154  T t2 = hashcons();
155  return this==t2 ? t2 : (T)POOLS[_type].free(this,t2);
156  }

◆ high()

Type com.cliffc.aa.type.Type< T extends Type< T >.high
inherited

Definition at line 796 of file Type.java.

796 { return above_center() ? this : dual(); }

◆ init() [1/2]

T com.cliffc.aa.type.Type< T extends Type< T >.init ( byte  type,
String  name 
)
protectedinherited

Definition at line 105 of file Type.java.

105 { _type=type; _name=name; return (T)this; }

◆ init() [2/2]

TypeMem com.cliffc.aa.type.TypeMem.init ( TypeObj[]  pubs)
private

Definition at line 67 of file TypeMem.java.

67  {
68  super.init(TMEM,"");
69  assert check(pubs); // Caller has canonicalized arrays already
70  _pubs = pubs;
71  return this;
72  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeMem.check(), com.cliffc.aa.type.TypeMem.init(), and com.cliffc.aa.type.Type< TypeMem >.TMEM.

Referenced by com.cliffc.aa.type.TypeMem.init(), com.cliffc.aa.type.TypeMem.make(), and com.cliffc.aa.type.TypeMem.xdual().

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

◆ init0()

static void com.cliffc.aa.type.Type< T extends Type< T >.init0 ( HashMap< String, Type< TypeMem > >  types)
staticinherited

Definition at line 642 of file Type.java.

642  {
643  types.put("real",REAL);
644  types.put("scalar",SCALAR);
645  TypeInt.init1(types);
646  TypeFlt.init1(types);
647  TypeStr.init1(types);
648  }

◆ intern_check()

static boolean com.cliffc.aa.type.Type< T extends Type< T >.intern_check
staticinherited

Definition at line 212 of file Type.java.

212  {
213  int errs=0;
214  for( Type k : INTERN.keySet() ) {
215  Type v = INTERN.get(k);
216  if( !k.intern_check0(v) ) {
217  System.out.println("INTERN_CHECK FAIL: "+k._uid+":"+k+" vs "+v._uid+":"+v);
218  errs++;
219  }
220  }
221  return errs==0;
222  }

◆ intern_check0()

boolean com.cliffc.aa.type.Type< T extends Type< T >.intern_check0 ( Type< TypeMem v)
privateinherited

Definition at line 223 of file Type.java.

223  {
224  if( this != v || _dual==null || _dual._dual!=this || compute_hash()!=_hash ) return false;
225  return intern_check1();
226  }

◆ intern_check1()

boolean com.cliffc.aa.type.Type< T extends Type< T >.intern_check1
packageinherited

Definition at line 227 of file Type.java.

227 { return true; }

◆ intern_find()

static Type com.cliffc.aa.type.Type< T extends Type< T >.intern_find ( int  uid)
staticpackageinherited

Definition at line 229 of file Type.java.

229  {
230  for( Type k : INTERN.keySet() )
231  if( k._uid==uid )
232  return k;
233  return null;
234  }

◆ intern_lookup()

Type com.cliffc.aa.type.Type< T extends Type< T >.intern_lookup
packageinherited

Definition at line 210 of file Type.java.

210 { return INTERN.get(this); }

◆ intern_size()

static int com.cliffc.aa.type.Type< T extends Type< T >.intern_size
staticpackageinherited

Definition at line 211 of file Type.java.

211 { return INTERN.size(); }

◆ interned()

boolean com.cliffc.aa.type.Type< T extends Type< T >.interned
packageinherited

Definition at line 209 of file Type.java.

209 { return INTERN.get(this)==this; }

◆ is_con()

boolean com.cliffc.aa.type.TypeMem.is_con ( )

Definition at line 555 of file TypeMem.java.

555 { return false;}

◆ is_display()

boolean com.cliffc.aa.type.Type< T extends Type< T >.is_display
packageinherited

Definition at line 942 of file Type.java.

942 { return false; }

◆ is_display_ptr()

boolean com.cliffc.aa.type.Type< T extends Type< T >.is_display_ptr
inherited

Definition at line 941 of file Type.java.

941 { return _type==TSCALAR || _type==TXSCALAR || _type==TNIL || _type==TXNIL || _type==TANY || _type==TALL; }

◆ is_forward_ref()

boolean com.cliffc.aa.type.Type< T extends Type< T >.is_forward_ref
inherited

Definition at line 799 of file Type.java.

799 { return false; }

◆ is_live()

boolean com.cliffc.aa.type.TypeMem.is_live ( )

Definition at line 560 of file TypeMem.java.

560 { return _pubs.length>1 || (live()!=TypeLive.DEAD && live()!=TypeLive.LIVE.dual()); }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeLive.DEAD, com.cliffc.aa.type.TypeLive.LIVE, and com.cliffc.aa.type.TypeMem.live().

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

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

◆ is_num()

boolean com.cliffc.aa.type.Type< T extends Type< T >.is_num
privateinherited

Definition at line 353 of file Type.java.

353 { byte t = _type; return t == TREAL || t == TXREAL || t == TNREAL || t == TXNREAL || t == TINT || t == TFLT; }

◆ is_ptr()

boolean com.cliffc.aa.type.Type< T extends Type< T >.is_ptr
privateinherited

Definition at line 352 of file Type.java.

352 { byte t = _type; return t == TFUNPTR || t == TMEMPTR; }

◆ is_simple()

boolean com.cliffc.aa.type.Type< T extends Type< T >.is_simple
privateinherited

Definition at line 351 of file Type.java.

351 { return _type < TSIMPLE; }

◆ isa()

boolean com.cliffc.aa.type.Type< T extends Type< T >.isa ( Type< TypeMem t)
inherited

Definition at line 623 of file Type.java.

623 { return meet(t)==t; }

◆ isa_scalar()

final boolean com.cliffc.aa.type.Type< T extends Type< T >.isa_scalar
inherited

Definition at line 356 of file Type.java.

356 { assert ISA_SCALAR.length==TLAST; return ISA_SCALAR[_type]!=0; }

◆ isBitShape()

byte com.cliffc.aa.type.Type< T extends Type< T >.isBitShape ( Type< TypeMem t)
inherited

Definition at line 814 of file Type.java.

814  {
815  if( has_name() || t.has_name() ) throw com.cliffc.aa.AA.unimpl();
816  if( _type == TNIL || _type==TXNIL ) return 0; // Nil is free to convert always
817  if( above_center() && isa(t) ) return 0; // Can choose compatible format
818  if( _type == t._type ) return 0; // Same type is OK
819  if( t._type==TSCALAR ) return 0; // Generic function arg never requires a conversion
820  if( _type == TALL || t._type==TALL || _type == TSCALAR || _type == TNSCALR ) return -1; // Scalar has to resolve
821  if( (_type == TREAL || _type == TNREAL) && t.is_num() ) return -1; // Real->Int/Flt has to resolve
822  if( t._type == TNIL || t._type == TXNIL ) return (byte)(may_nil() ? -1 : 99); // Must resolve to a NIL first
823 
824  throw typerr(t); // Overridden in subtypes
825  }

◆ join()

Type com.cliffc.aa.type.Type< T extends Type< T >.join ( Type< TypeMem t)
inherited

Definition at line 619 of file Type.java.

619 { return dual().meet(t.dual()).dual(); }

◆ ld() [1/2]

TypeObj com.cliffc.aa.type.TypeMem.ld ( TypeMemPtr  ptr)

Definition at line 325 of file TypeMem.java.

325  {
326  if( ptr._aliases == BitsAlias.NIL.dual() || ptr._aliases == BitsAlias.NIL )
327  return TypeObj.XOBJ;
328  if( ptr._aliases == BitsAlias.EMPTY )
329  return oob(TypeObj.OBJ);
330  if( this== FULL ) return TypeObj. OBJ;
331  if( this==EMPTY ) return TypeObj.XOBJ;
332  return ld(_pubs,ptr._aliases);
333  }

References com.cliffc.aa.type.TypeMemPtr._aliases, com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.Bits< B extends Bits< B >.dual(), com.cliffc.aa.type.BitsAlias.EMPTY, com.cliffc.aa.type.TypeMem.EMPTY, com.cliffc.aa.type.TypeMem.FULL, com.cliffc.aa.type.BitsAlias.NIL, com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.OBJ, com.cliffc.aa.type.Type< TypeMem >.oob(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.XOBJ.

Referenced by com.cliffc.aa.node.StoreNode.err(), com.cliffc.aa.node.LoadNode.err(), com.cliffc.aa.REPL.go_one(), com.cliffc.aa.node.StoreNode.ideal_reduce(), com.cliffc.aa.type.TypeMemPtr.make_from(), com.cliffc.aa.type.TypeMemPtr.str(), com.cliffc.aa.type.TestType.testOOPsNulls(), com.cliffc.aa.TestParse.testParse06(), com.cliffc.aa.type.TestType.testRecursive(), com.cliffc.aa.node.TestNodeSmall.testRecursiveDisplay(), com.cliffc.aa.type.TestType.testStructTuple(), com.cliffc.aa.node.NewStrNode.AddStrStr.value(), and com.cliffc.aa.node.IntrinsicNode.value().

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

◆ ld() [2/2]

static TypeObj com.cliffc.aa.type.TypeMem.ld ( TypeObj[]  tos,
BitsAlias  aliases 
)
staticprivate

Definition at line 334 of file TypeMem.java.

334  {
335  boolean any = aliases.above_center();
336  // Any alias, plus all of its children, are meet/joined. This does a
337  // tree-based scan on the inner loop.
338  TypeObj obj1 = any ? TypeObj.ISUSED : TypeObj.UNUSED;
339  for( int alias : aliases )
340  for( int kid=alias; kid!=0; kid=BitsAlias.next_kid(alias,kid) ) {
341  TypeObj x = at(tos,kid);
342  obj1 = (TypeObj)(any ? obj1.join(x) : obj1.meet(x));
343  }
344  return obj1;
345  }

References com.cliffc.aa.type.Bits< B extends Bits< B >.above_center(), com.cliffc.aa.type.TypeMem.aliases(), com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.ISUSED, com.cliffc.aa.type.Type< T extends Type< T >.join(), com.cliffc.aa.type.Type< T extends Type< T >.meet(), com.cliffc.aa.type.BitsAlias.next_kid(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED.

Here is the call graph for this function:

◆ len()

int com.cliffc.aa.type.TypeMem.len ( )

Definition at line 149 of file TypeMem.java.

149 { return _pubs.length; }

References com.cliffc.aa.type.TypeMem._pubs.

Referenced by com.cliffc.aa.type.TypeMem._make1(), com.cliffc.aa.type.TypeMem._meet(), com.cliffc.aa.type.TypeMem.and_unused(), and com.cliffc.aa.node.CallEpiNode.value().

Here is the caller graph for this function:

◆ live()

TypeLive com.cliffc.aa.type.TypeMem.live ( )

Definition at line 559 of file TypeMem.java.

559 { return (TypeLive)_pubs[0]; }

References com.cliffc.aa.type.TypeMem._pubs.

Referenced by com.cliffc.aa.node.CallNode.ideal_reduce(), com.cliffc.aa.type.TypeMem.is_live(), com.cliffc.aa.node.FunPtrNode.live(), com.cliffc.aa.node.MemJoinNode.live(), com.cliffc.aa.node.RetNode.live(), com.cliffc.aa.node.CallNode.live(), com.cliffc.aa.type.TypeMem.make_live(), and com.cliffc.aa.type.TypeMem.remove_no_escapes().

Here is the caller graph for this function:

◆ live_no_disp()

boolean com.cliffc.aa.type.TypeMem.live_no_disp ( )

Definition at line 320 of file TypeMem.java.

320  {
321  return this==TypeMem.LNO_DISP || this==TypeMem.LESC_NO_DISP || this==TypeMem.DEAD;
322  }

References com.cliffc.aa.type.TypeMem.DEAD, com.cliffc.aa.type.TypeMem.LESC_NO_DISP, and com.cliffc.aa.type.TypeMem.LNO_DISP.

Referenced by com.cliffc.aa.node.LoadNode._live_use(), com.cliffc.aa.node.LoadNode.get_fld2(), and com.cliffc.aa.node.Node.walk_opt().

Here is the caller graph for this function:

◆ make() [1/4]

static TypeMem com.cliffc.aa.type.TypeMem.make ( BitsAlias  aliases,
TypeObj  oop 
)
static

Definition at line 211 of file TypeMem.java.

211  {
212  TypeObj[] as = new TypeObj[aliases.max()+1];
213  as[1] = TypeObj.UNUSED;
214  for( int alias : aliases )
215  if( alias != 0 )
216  as[alias] = oop;
217  return make0(as);
218  }

References com.cliffc.aa.type.TypeMem.aliases(), com.cliffc.aa.type.TypeMem.make0(), com.cliffc.aa.type.Bits< B extends Bits< B >.max(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED.

Here is the call graph for this function:

◆ make() [2/4]

static Type com.cliffc.aa.type.Type< T extends Type< T >.make ( byte  type)
staticpackageinherited

Definition at line 147 of file Type.java.

147  {
148  Pool P = POOLS[type];
149  Type t1 = P.malloc();
150  return t1.init(type,"").hashcons_free();
151  }

◆ make() [3/4]

static TypeMem com.cliffc.aa.type.TypeMem.make ( int  alias,
TypeObj  oop 
)
static

Definition at line 205 of file TypeMem.java.

205  {
206  TypeObj[] as = new TypeObj[alias+1];
207  as[1] = TypeObj.UNUSED;
208  as[alias] = oop;
209  return make0(as);
210  }

References com.cliffc.aa.type.TypeMem.make0(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED.

Here is the call graph for this function:

◆ make() [4/4]

static TypeMem com.cliffc.aa.type.TypeMem.make ( TypeObj[]  pubs)
staticprivate

Definition at line 163 of file TypeMem.java.

163  {
164  Pool P = POOLS[TMEM];
165  TypeMem t1 = P.malloc();
166  return t1.init(pubs).hashcons_free();
167  }

References com.cliffc.aa.type.Type< T extends Type< T >.hashcons_free(), com.cliffc.aa.type.TypeMem.init(), com.cliffc.aa.type.Type< TypeMem >.POOLS, and com.cliffc.aa.type.Type< TypeMem >.TMEM.

Referenced by com.cliffc.aa.type.TypeMem.make0(), com.cliffc.aa.type.TypeMem.meet_loop(), com.cliffc.aa.type.TestType.testRecursive(), com.cliffc.aa.type.TypeMem.update(), and com.cliffc.aa.type.TypeMem.xmeet().

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

◆ make0()

static TypeMem com.cliffc.aa.type.TypeMem.make0 ( TypeObj[]  as)
static

Definition at line 170 of file TypeMem.java.

170  {
171  assert as.length==1 || as[0]==null;
172  if( as.length> 1 ) as[0] = as[1].oob(TypeLive.LIVE);
173  TypeObj[] tos = _make1(as);
174  if( tos==null ) return DEAD; // All things are dead, so dead
175  return make(tos);
176  }

References com.cliffc.aa.type.TypeMem._make1(), com.cliffc.aa.type.TypeMem.DEAD, com.cliffc.aa.type.TypeLive.LIVE, com.cliffc.aa.type.TypeMem.make(), and com.cliffc.aa.type.Type< T extends Type< T >.oob().

Referenced by com.cliffc.aa.type.TypeMem.crush(), com.cliffc.aa.type.TypeMem.flatten_fields(), com.cliffc.aa.type.TypeMem.make(), com.cliffc.aa.type.TypeMem.make_live(), com.cliffc.aa.type.TypeMem.remove(), com.cliffc.aa.type.TypeMem.remove_no_escapes(), com.cliffc.aa.type.TypeMem.set(), com.cliffc.aa.type.TypeMem.slice_reaching_aliases(), com.cliffc.aa.type.TypeMem.st_new(), com.cliffc.aa.type.TestType.testRecursive(), com.cliffc.aa.type.TestType.testStructTuple(), com.cliffc.aa.node.TestNodeSmall.tmem(), com.cliffc.aa.node.DefMemNode.value(), com.cliffc.aa.node.MemJoinNode.value(), com.cliffc.aa.node.CallEpiNode.value(), and com.cliffc.aa.type.TypeMem.widen().

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

◆ make_from()

Type com.cliffc.aa.type.Type< T extends Type< T >.make_from ( Type< TypeMem head,
TypeMem  map,
VBitSet  visit 
)
inherited

Definition at line 945 of file Type.java.

945 { return this; }

◆ make_live()

static TypeMem com.cliffc.aa.type.TypeMem.make_live ( TypeLive  live)
static

Definition at line 220 of file TypeMem.java.

220 { return make0(new TypeObj[]{live}); }

References com.cliffc.aa.type.TypeMem.live(), and com.cliffc.aa.type.TypeMem.make0().

Referenced by com.cliffc.aa.node.ConNode< T extends Type >.live().

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

◆ may_be_con()

boolean com.cliffc.aa.type.TypeMem.may_be_con ( )

Definition at line 554 of file TypeMem.java.

554 { return false;}

◆ may_nil()

boolean com.cliffc.aa.type.Type< T extends Type< T >.may_nil
inherited

Definition at line 869 of file Type.java.

869  {
870  switch(_type) {
871  case TALL:
872  case TREAL:
873  case TSCALAR:
874  case TXNSCALR: case TNSCALR:
875  case TXNREAL: case TNREAL:
876  case TTUPLE:
877  return false;
878  case TANY:
879  case TXREAL:
880  case TXSCALAR:
881  case TCTRL: // Nonsense, only for IfNode.value test
882  case TXCTRL: // Nonsense, only for IfNode.value test
883  case TMEM: // Nonsense, only for IfNode.value test
884  return true;
885  default: throw typerr(null); // Overridden in subclass
886  }
887  }

◆ meet()

final Type com.cliffc.aa.type.Type< T extends Type< T >.meet ( Type< TypeMem t)
inherited

Definition at line 412 of file Type.java.

412  {
413  // Short cut for the self case
414  if( t == this ) return this;
415  // Short-cut for seeing this meet before
416  Type mt = Key.get(this,t);
417  if( mt != null ) return mt;
418 
419  // "Triangulate" the matrix and cut in half the number of cases.
420  // Reverse; xmeet 2nd arg is never "is_simple" and never equal to "this".
421  // This meet ignores the _name field, and can return any-old name it wants.
422  mt = !is_simple() && t.is_simple() ? t.xmeet(this) : xmeet(t);
423 
424  // Meet the names. Subclasses basically ignore the names as they have
425  // their own complicated meets to perform, so we meet them here for all.
426  Type nmt = xmt_name(t,mt);
427 
428  // Quick check on NIL: if either argument is NIL the result is allowed to
429  // be NIL... but nobody in the lattice can make a NIL from whole cloth, or
430  // we get the crossing-nil bug.
431  assert (nmt != NIL && nmt!=XNIL) || this==NIL || this==XNIL || t==NIL || t==XNIL;
432 
433  // Record this meet, to short-cut next time
434  if( RECURSIVE_MEET == 0 ) // Only not mid-building recursive types;
435  Key.put(this,t,nmt);
436  return nmt;
437  }

◆ meet_loop()

Type com.cliffc.aa.type.TypeMem.meet_loop ( Type  t2)

Definition at line 302 of file TypeMem.java.

302  {
303  if( t2._type != TMEM ) return ALL;
304  TypeMem tf = (TypeMem)t2;
305  // Meet of default values, meet of element-by-element.
306  TypeObj[] as = _meet(_pubs,tf._pubs,true);
307  TypeObj[] tos = _make1(as);
308  return tos==null ? DEAD : make(tos); // All things are dead, so dead
309  }

References com.cliffc.aa.type.TypeMem._make1(), com.cliffc.aa.type.TypeMem._meet(), com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.Type< T extends Type< T >._type, com.cliffc.aa.type.Type< TypeMem >.ALL, com.cliffc.aa.type.TypeMem.DEAD, com.cliffc.aa.type.TypeMem.make(), and com.cliffc.aa.type.Type< TypeMem >.TMEM.

Here is the call graph for this function:

◆ meet_nil()

Type com.cliffc.aa.type.Type< T extends Type< T >.meet_nil ( Type< TypeMem nil)
inherited

Definition at line 904 of file Type.java.

904  {
905  assert nil==NIL || nil==XNIL;
906  switch( _type ) {
907  case TANY:
908  case TXREAL:
909  case TXSCALAR:
910  case TXNIL: return nil; // Preserve high/low flavor
911  case TNIL: return NIL;
912  case TXNREAL:
913  case TXNSCALR: return TypeInt.BOOL;
914  case TREAL: case TNREAL: return REAL;
915  case TSCALAR: case TNSCALR: return SCALAR;
916  case TCTRL: case TXCTRL:
917  case TOBJ:
918  case TSTR:
919  case TSTRUCT:
920  case TMEM: return ALL;
921  default: throw typerr(null); // Overridden in subclass
922  }
923  }

◆ mtname()

final String com.cliffc.aa.type.Type< T extends Type< T >.mtname ( Type< TypeMem t,
Type< TypeMem mt 
)
packageinherited

Definition at line 567 of file Type.java.

567  {
568  Type t0 = this, t1 = t;
569  String s0 = t0._name, s1 = t1._name;
570  assert check_name(s0) && check_name(s1);
571  if( Util.eq(s0,s1) ) return s0;
572  // Sort by name length
573  if( s0.length() > s1.length() ) { t1=this; t0=t; s0=t0._name; s1=t1._name; }
574  int x = 0, i; char c; // Last colon separator index
575  // Find split point
576  for( i = 0; i < s0.length(); i++ ) {
577  if( (c=s0.charAt(i)) != s1.charAt(i) )
578  break;
579  if( c==':' ) x=i;
580  }
581  // If s0 is a prefix of s1, and s0 is high then it can cover s1.
582  if( i==s0.length() && t0.above_center() && (!t1.above_center() || mt.above_center()) )
583  return s1;
584  // Keep the common prefix, which might be all of s0
585  String s2 = i==s0.length() ? s0 : s0.substring(0, x).intern();
586  assert check_name(s2);
587  return s2;
588  }

◆ must_nil()

boolean com.cliffc.aa.type.TypeMem.must_nil ( )

Definition at line 556 of file TypeMem.java.

556 { return false; } // never a nil

◆ not_nil()

Type com.cliffc.aa.type.TypeMem.not_nil ( )
package

Definition at line 557 of file TypeMem.java.

557 { return this; }

◆ oob() [1/6]

Type com.cliffc.aa.type.Type< T extends Type< T >.oob
inherited

Definition at line 635 of file Type.java.

635 { return oob(ALL); }

◆ oob() [2/6]

Type com.cliffc.aa.type.Type< T extends Type< T >.oob ( Type< TypeMem e)
inherited

Definition at line 636 of file Type.java.

636 { return above_center() ? e.dual() : e; }

◆ oob() [3/6]

TypeMem com.cliffc.aa.type.Type< T extends Type< T >.oob ( TypeMem  e)
inherited

Definition at line 639 of file Type.java.

639 { return above_center() ? e.dual() : e; }

◆ oob() [4/6]

TypeMemPtr com.cliffc.aa.type.Type< T extends Type< T >.oob ( TypeMemPtr  e)
inherited

Definition at line 640 of file Type.java.

640 { return above_center() ? e.dual() : e; }

◆ oob() [5/6]

TypeObj com.cliffc.aa.type.Type< T extends Type< T >.oob ( TypeObj  e)
inherited

Definition at line 637 of file Type.java.

637 { return above_center() ? (TypeObj)e.dual() : e; }

◆ oob() [6/6]

TypeStruct com.cliffc.aa.type.Type< T extends Type< T >.oob ( TypeStruct  e)
inherited

Definition at line 638 of file Type.java.

638 { return above_center() ? e.dual() : e; }

◆ oob_deep()

Type com.cliffc.aa.type.Type< T extends Type< T >.oob_deep ( Type< TypeMem t)
inherited

Definition at line 632 of file Type.java.

632 { return oop_deep_impl(t); }

◆ oop_deep_impl()

Type com.cliffc.aa.type.Type< T extends Type< T >.oop_deep_impl ( Type< TypeMem t)
inherited

Definition at line 634 of file Type.java.

634 { return oob(); }

◆ rdual()

T com.cliffc.aa.type.Type< T extends Type< T >.rdual
packageinherited

Definition at line 366 of file Type.java.

366 { assert _dual!=null; return _dual; }

◆ remove()

TypeMem com.cliffc.aa.type.TypeMem.remove ( BitsAlias  escs)

Definition at line 487 of file TypeMem.java.

487  {
488  if( escs==BitsAlias.EMPTY ) return this;
489  if( escs==BitsAlias.FULL ) throw com.cliffc.aa.AA.unimpl(); // Shortcut
490  TypeObj[] tos = _pubs.clone();
491  for( int i = 1; i< _pubs.length; i++ )
492  if( escs.test(i) )
493  tos[i] = TypeObj.UNUSED;
494  return make0(tos);
495  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.Type< T extends Type< T >.clone(), com.cliffc.aa.type.BitsAlias.EMPTY, com.cliffc.aa.type.BitsAlias.FULL, com.cliffc.aa.type.TypeMem.make0(), com.cliffc.aa.AA.unimpl(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED.

Here is the call graph for this function:

◆ remove_name()

final T com.cliffc.aa.type.Type< T extends Type< T >.remove_name
inherited

Definition at line 556 of file Type.java.

556 { return has_name() ? _set_name("") : (T)this; }

◆ remove_no_escapes()

TypeMem com.cliffc.aa.type.TypeMem.remove_no_escapes ( BitsAlias  escs,
String  fld,
Type  live 
)

Definition at line 479 of file TypeMem.java.

479  {
480  TypeObj[] tos = new TypeObj[Math.max(_pubs.length,escs.max()+1)];
481  for( int i=1; i<tos.length; i++ )
482  tos[i] = escs.test_recur(i) ? at(i).remove_other_flds(fld,live) : TypeObj.UNUSED;
483  return make0(tos);
484  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.TypeMem.live(), com.cliffc.aa.type.TypeMem.make0(), com.cliffc.aa.type.Bits< B extends Bits< B >.max(), com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.remove_other_flds(), com.cliffc.aa.type.Bits< B extends Bits< B >.test_recur(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED.

Referenced by com.cliffc.aa.node.NewStrNode.AddStrStr.live_use().

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

◆ repeats_in_cycles()

TypeStruct com.cliffc.aa.type.Type< T extends Type< T >.repeats_in_cycles ( TypeStruct  head,
VBitSet  bs 
)
packageinherited

Definition at line 938 of file Type.java.

938 { return null; }

◆ retern()

final T com.cliffc.aa.type.Type< T extends Type< T >.retern
packageinherited

Definition at line 201 of file Type.java.

201  {
202  assert _dual._dual == this;
203  assert _hash != 0;
204  assert INTERN.get(this)==null;
205  INTERN.put(this,this);
206  assert INTERN.get(this)==this;
207  return (T)this;
208  }

◆ set()

TypeMem com.cliffc.aa.type.TypeMem.set ( int  alias,
TypeObj  obj 
)

Definition at line 434 of file TypeMem.java.

434  {
435  if( at(alias)==obj ) return this; // Shortcut
436  int max = Math.max(_pubs.length,alias+1);
437  TypeObj[] tos = Arrays.copyOf(_pubs,max);
438  tos[0] = null;
439  tos[alias] = obj;
440  return make0(tos);
441  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeMem.at(), and com.cliffc.aa.type.TypeMem.make0().

Referenced by com.cliffc.aa.node.ConTypeNode.value(), com.cliffc.aa.node.MrgProjNode.value(), and com.cliffc.aa.node.IntrinsicNode.value().

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

◆ set_name()

final T com.cliffc.aa.type.Type< T extends Type< T >.set_name ( String  name)
inherited

Definition at line 551 of file Type.java.

551  {
552  assert check_name(name);
553  return _set_name(name);
554  }

◆ sharp_get()

TypeMemPtr com.cliffc.aa.type.TypeMem.sharp_get ( TypeMemPtr  tmp)
package

Definition at line 411 of file TypeMem.java.

411 { return _sharp_cache==null ? null : _sharp_cache.get(tmp); }

References com.cliffc.aa.type.TypeMem._sharp_cache.

Referenced by com.cliffc.aa.type.TypeStruct._dull(), com.cliffc.aa.type.TypeStruct._sharp(), and com.cliffc.aa.type.TypeStruct.sharpen().

Here is the caller graph for this function:

◆ sharpen()

TypeMemPtr com.cliffc.aa.type.TypeMem.sharpen ( TypeMemPtr  dull)

Definition at line 402 of file TypeMem.java.

402  {
403  assert dull==dull.simple_ptr();
404  if( _sharp_cache != null ) { // Check the cache first
405  TypeMemPtr sharp = _sharp_cache.get(dull);
406  if( sharp != null ) return sharp;
407  }
408  // Switch to TypeStruct for building recursive structures.
409  return TypeStruct.sharpen(this,dull);
410  }

References com.cliffc.aa.type.TypeMem._sharp_cache, com.cliffc.aa.type.TypeStruct.sharpen(), and com.cliffc.aa.type.TypeMemPtr.simple_ptr().

Referenced by com.cliffc.aa.type.TypeMem.sharptr(), and com.cliffc.aa.TestParse.testParse07().

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

◆ sharptr()

Type com.cliffc.aa.type.TypeMem.sharptr ( Type  ptr)

Definition at line 419 of file TypeMem.java.

419  {
420  return ptr instanceof TypeMemPtr ? sharpen((TypeMemPtr)ptr) :
421  (ptr instanceof TypeTuple ? ((TypeTuple)ptr).sharptr(this) : ptr);
422  }

References com.cliffc.aa.type.TypeMem.sharpen(), and com.cliffc.aa.type.TypeTuple.sharptr().

Referenced by com.cliffc.aa.type.TypeTuple.sharptr(), and com.cliffc.aa.type.Type< TypeFlt >.sharptr().

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

◆ sharput()

TypeMemPtr com.cliffc.aa.type.TypeMem.sharput ( TypeMemPtr  dull,
TypeMemPtr  sharp 
)
package

Definition at line 412 of file TypeMem.java.

412  {
413  assert dull.interned() && sharp.interned();
414  if( _sharp_cache==null ) _sharp_cache = new HashMap<>();
415  _sharp_cache.put(dull,sharp);
416  return sharp; // return new not old
417  }

References com.cliffc.aa.type.TypeMem._sharp_cache, and com.cliffc.aa.type.Type< T extends Type< T >.interned().

Referenced by com.cliffc.aa.type.TypeStruct._dull(), com.cliffc.aa.type.TypeStruct._sharp(), and com.cliffc.aa.type.TypeStruct.sharpen().

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

◆ simple_ptr()

Type com.cliffc.aa.type.Type< T extends Type< T >.simple_ptr
inherited

Definition at line 358 of file Type.java.

358 { return this; }

◆ slice_reaching_aliases()

TypeMem com.cliffc.aa.type.TypeMem.slice_reaching_aliases ( BitsAlias  aliases)

Definition at line 392 of file TypeMem.java.

392  {
393  if( aliases==BitsAlias.FULL ) return this;
394  TypeObj[] tos = new TypeObj[Math.max(_pubs.length,aliases.max()+1)];
395  tos[1] = at(1);
396  for( int i=2; i<tos.length; i++ )
397  tos[i] = aliases.test_recur(i) ? at(i) : TypeObj.UNUSED;
398  return make0(tos);
399  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeMem.aliases(), com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.BitsAlias.FULL, com.cliffc.aa.type.TypeMem.make0(), com.cliffc.aa.type.Bits< B extends Bits< B >.max(), com.cliffc.aa.type.Bits< B extends Bits< B >.test_recur(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.UNUSED.

Referenced by com.cliffc.aa.node.ScopeNode.compute_live_mem(), com.cliffc.aa.node.CallNode.live_use(), com.cliffc.aa.node.MemSplitNode.value(), and com.cliffc.aa.node.CallNode.value().

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

◆ st_new()

TypeMem com.cliffc.aa.type.TypeMem.st_new ( int  alias,
TypeObj  obj 
)

Definition at line 446 of file TypeMem.java.

446  {
447  TypeObj[] pubs = _pubs ;
448  TypeObj pub = at(pubs ,alias); // Current value for alias
449  if( pub==obj ) return this; // Shortcut
450  (pubs = _st_new(_pubs,pubs,alias))[alias] = (TypeObj)pub.meet(obj);
451  pubs[0] = null;
452  return make0(pubs);
453  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeMem._st_new(), com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.TypeMem.make0(), and com.cliffc.aa.type.Type< T extends Type< T >.meet().

Referenced by com.cliffc.aa.node.MrgProjNode.value().

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

◆ str()

SB com.cliffc.aa.type.TypeMem.str ( SB  sb,
VBitSet  dups,
TypeMem  mem,
boolean  debug 
)

Definition at line 115 of file TypeMem.java.

115  {
116  if( this==FULL ) return sb.p("[ all ]");
117  if( this==EMPTY) return sb.p("[_____]");
118  if( this== MEM ) return sb.p("[ mem ]");
119  if( this==XMEM ) return sb.p("[~mem ]");
120 
121  if( _pubs.length==1 )
122  return _pubs[0].str(sb.p('['),dups,mem,debug).p(']');
123 
124  if( _pubs[0]==TypeLive.DEAD ) sb.p('!');
125  else _pubs[0].str(sb,dups,mem,debug);
126 
127  sb.p('[');
128  for( int i = 1; i< _pubs.length; i++ )
129  if( _pubs[i] != null )
130  _pubs[i].str(sb.p(i).p(':'),dups,mem,debug).p(",");
131  return sb.unchar().p(']');
132  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeLive.DEAD, com.cliffc.aa.type.TypeMem.EMPTY, com.cliffc.aa.type.TypeMem.FULL, com.cliffc.aa.type.TypeMem.MEM, com.cliffc.aa.util.SB.p(), com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.str(), com.cliffc.aa.util.SB.unchar(), and com.cliffc.aa.type.TypeMem.XMEM.

Here is the call graph for this function:

◆ toString()

final String com.cliffc.aa.type.Type< T extends Type< T >.toString
inherited

Definition at line 127 of file Type.java.

127 { return str(new SB(),new VBitSet(),null,true).toString(); }

◆ typerr()

RuntimeException com.cliffc.aa.type.Type< T extends Type< T >.typerr ( Type< TypeMem t)
packageinherited

Definition at line 947 of file Type.java.

947  {
948  throw new RuntimeException("Should not reach here: internal type system error with "+this+(t==null?"":(" and "+t)));
949  }

◆ untern()

final T com.cliffc.aa.type.Type< T extends Type< T >.untern
packageinherited

Definition at line 193 of file Type.java.

193  {
194  assert _hash != 0;
195  assert INTERN.get(this)==this;
196  Type rez = INTERN.remove(this);
197  assert rez == this;
198  return (T)this;
199  }

◆ update() [1/2]

TypeMem com.cliffc.aa.type.TypeMem.update ( BitsAlias  aliases,
Access  fin,
String  fld,
Type  val 
)

Definition at line 459 of file TypeMem.java.

459  {
460  Ary<TypeObj> pubs = new Ary<>(_pubs .clone());
461  for( int alias : aliases )
462  if( alias != 0 )
463  for( int kid=alias; kid != 0; kid=BitsAlias.next_kid(alias,kid) )
464  pubs.setX(kid,at(_pubs,kid).update(fin,fld,val)); // imprecise
465  return make(_make1(pubs.asAry()));
466  }

References com.cliffc.aa.type.TypeMem._make1(), com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeMem.aliases(), com.cliffc.aa.util.Ary< E >.asAry(), com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.Type< TypeMem >.clone(), com.cliffc.aa.type.TypeMem.make(), com.cliffc.aa.type.BitsAlias.next_kid(), and com.cliffc.aa.util.Ary< E >.setX().

Referenced by com.cliffc.aa.type.TypeMem.update(), com.cliffc.aa.node.StoreNode.value(), com.cliffc.aa.node.MemPrimNode.LValueWrite.value(), and com.cliffc.aa.node.MemPrimNode.LValueWriteFinal.value().

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

◆ update() [2/2]

TypeMem com.cliffc.aa.type.TypeMem.update ( BitsAlias  aliases,
TypeInt  idx,
Type  val 
)

Definition at line 469 of file TypeMem.java.

469  {
470  Ary<TypeObj> pubs = new Ary<>(_pubs .clone());
471  for( int alias : aliases )
472  if( alias != 0 )
473  for( int kid=alias; kid != 0; kid=BitsAlias.next_kid(alias,kid) )
474  pubs.setX(kid,at(_pubs,kid).update(idx,val)); // imprecise
475  return make(_make1(pubs.asAry()));
476  }

References com.cliffc.aa.type.TypeMem._make1(), com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.TypeMem.aliases(), com.cliffc.aa.util.Ary< E >.asAry(), com.cliffc.aa.type.TypeMem.at(), com.cliffc.aa.type.Type< TypeMem >.clone(), com.cliffc.aa.type.TypeMem.make(), com.cliffc.aa.type.BitsAlias.next_kid(), com.cliffc.aa.util.Ary< E >.setX(), and com.cliffc.aa.type.TypeMem.update().

Here is the call graph for this function:

◆ walk()

void com.cliffc.aa.type.Type< T extends Type< T >.walk ( Predicate< Type< TypeMem > >  p)
inherited

Definition at line 936 of file Type.java.

936 { assert is_simple(); p.test(this); }

◆ widen()

TypeMem com.cliffc.aa.type.TypeMem.widen ( )

Definition at line 539 of file TypeMem.java.

539  {
540  TypeObj[] tos = _pubs.clone();
541  tos[0] = null;
542  for( int i=1; i<tos.length; i++ )
543  if( tos[i]!=null )
544  tos[i] = tos[i].widen();
545  return make0(tos);
546  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.Type< T extends Type< T >.clone(), com.cliffc.aa.type.TypeMem.make0(), and com.cliffc.aa.type.TypeObj< O extends TypeObj< O >.widen().

Here is the call graph for this function:

◆ xdual()

TypeMem com.cliffc.aa.type.TypeMem.xdual ( )
protected

Definition at line 264 of file TypeMem.java.

264  {
265  TypeObj[] pubs = new TypeObj[_pubs.length];
266  for( int i = 0; i< _pubs.length; i++ )
267  if( _pubs[i] != null )
268  pubs[i] = (TypeObj) _pubs[i].dual();
269  return new TypeMem().init(pubs);
270  }

References com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.Type< TypeMem >.dual(), and com.cliffc.aa.type.TypeMem.init().

Here is the call graph for this function:

◆ xmeet()

Type com.cliffc.aa.type.TypeMem.xmeet ( Type  t)
protected

Definition at line 271 of file TypeMem.java.

271  {
272  if( t._type != TMEM ) return ALL;
273  TypeMem tf = (TypeMem)t;
274  // Meet of default values, meet of element-by-element.
275  TypeObj[] as = _meet(_pubs,tf._pubs,false);
276  TypeObj[] tos = _make1(as);
277  return tos==null ? DEAD : make(tos); // All things are dead, so dead
278  }

References com.cliffc.aa.type.TypeMem._make1(), com.cliffc.aa.type.TypeMem._meet(), com.cliffc.aa.type.TypeMem._pubs, com.cliffc.aa.type.Type< T extends Type< T >._type, com.cliffc.aa.type.Type< TypeMem >.ALL, com.cliffc.aa.type.TypeMem.DEAD, com.cliffc.aa.type.TypeMem.make(), and com.cliffc.aa.type.Type< TypeMem >.TMEM.

Here is the call graph for this function:

◆ xmt_name()

Type com.cliffc.aa.type.Type< T extends Type< T >.xmt_name ( Type< TypeMem t,
Type< TypeMem mt 
)
privateinherited

Definition at line 441 of file Type.java.

441  {
442  String n = mtname(t,mt); // Meet name strings
443  // If the names are incompatible and the meet remained high then the
444  // mismatched names force a drop.
445  if( n.length() < _name.length() && n.length() < t._name.length() && mt.above_center() ) {
446  if( mt.interned() ) // recursive type creation?
447  mt = mt.dual(); // Force low
448  }
449  if( mt.is_simple() ) n=""; // No named simple types
450  if( mt._type==TOBJ ) n=""; // OBJ splits into strings (arrays) and structs, which can keep their names
451 
452  // Inject the name
453  if( !Util.eq(mt._name,n) ) // Fast path cutout
454  mt = mt.set_name(n);
455  return mt;
456  }

Member Data Documentation

◆ _dual

T com.cliffc.aa.type.Type< T extends Type< T >._dual
packageinherited

Definition at line 100 of file Type.java.

◆ _hash

int com.cliffc.aa.type.Type< T extends Type< T >._hash
inherited

Definition at line 97 of file Type.java.

◆ _name

String com.cliffc.aa.type.Type< T extends Type< T >._name
inherited

Definition at line 99 of file Type.java.

◆ _pubs

◆ _sharp_cache

HashMap<TypeMemPtr,TypeMemPtr> com.cliffc.aa.type.TypeMem._sharp_cache
private

◆ _type

byte com.cliffc.aa.type.Type< T extends Type< T >._type
packageinherited

Definition at line 98 of file Type.java.

◆ _uid

int com.cliffc.aa.type.Type< T extends Type< T >._uid
inherited

Definition at line 96 of file Type.java.

◆ ALIVE

final TypeMem com.cliffc.aa.type.TypeMem.ALIVE
staticpackage

◆ ALL

final Type com.cliffc.aa.type.Type< T extends Type< T >.ALL
staticinherited

Definition at line 324 of file Type.java.

◆ ALL_TYPES

Ary<Type> com.cliffc.aa.type.Type< T extends Type< T >.ALL_TYPES
staticprivateinherited

Definition at line 650 of file Type.java.

◆ ALLMEM

final TypeMem com.cliffc.aa.type.TypeMem.ALLMEM
staticpackage

Definition at line 228 of file TypeMem.java.

Referenced by com.cliffc.aa.node.MemPrimNode.LValueLength._live_use(), com.cliffc.aa.node.LoadNode._live_use(), com.cliffc.aa.node.StartMemNode.all_live(), com.cliffc.aa.node.ThretNode.all_live(), com.cliffc.aa.node.DefMemNode.all_live(), com.cliffc.aa.node.MemSplitNode.all_live(), com.cliffc.aa.node.MProjNode.all_live(), com.cliffc.aa.node.NewNode< TypeStruct >.all_live(), com.cliffc.aa.node.MrgProjNode.all_live(), com.cliffc.aa.node.PhiNode.all_live(), com.cliffc.aa.node.IntrinsicNode.all_live(), com.cliffc.aa.node.ScopeNode.all_live(), com.cliffc.aa.node.StoreNode.all_live(), com.cliffc.aa.node.MemJoinNode.all_live(), com.cliffc.aa.node.MemPrimNode.WritePrimNode.all_live(), com.cliffc.aa.node.RetNode.all_live(), com.cliffc.aa.node.CallEpiNode.all_live(), com.cliffc.aa.node.CallNode.all_live(), com.cliffc.aa.node.PrimNode.AndThen.all_live(), com.cliffc.aa.node.PrimNode.OrElse.all_live(), com.cliffc.aa.node.ScopeNode.compute_live_mem(), com.cliffc.aa.node.NewStrNode.ConStr.ConStr(), com.cliffc.aa.node.NewStrNode.ConvertF64Str.ConvertF64Str(), com.cliffc.aa.node.NewStrNode.ConvertI64Str.ConvertI64Str(), com.cliffc.aa.Parse.gather_errors(), com.cliffc.aa.node.PhiNode.is_mem(), com.cliffc.aa.node.ThretNode.live(), com.cliffc.aa.node.ScopeNode.live(), com.cliffc.aa.node.RetNode.live(), com.cliffc.aa.node.CallNode.live(), com.cliffc.aa.node.ThunkNode.live_use(), com.cliffc.aa.node.MemPrimNode.ReadPrimNode.live_use(), com.cliffc.aa.node.NewStrNode.AddStrStr.live_use(), com.cliffc.aa.node.ScopeNode.live_use(), com.cliffc.aa.node.CallNode.live_use(), com.cliffc.aa.node.PrimNode.AndThen.live_use(), com.cliffc.aa.node.PrimNode.OrElse.live_use(), com.cliffc.aa.type.TypeTuple.make(), com.cliffc.aa.type.TypeTuple.make_args(), com.cliffc.aa.node.NewAryNode.NewAryNode(), com.cliffc.aa.node.NewNode< T extends TypeObj< T >.NewPrimNode< TypeAry >.NewPrimNode(), com.cliffc.aa.node.PhiNode.PhiNode(), com.cliffc.aa.node.PrimNode.PrimNode(), com.cliffc.aa.type.TestType.testLoad(), com.cliffc.aa.node.ThretNode.ThretNode(), com.cliffc.aa.Parse.type0(), com.cliffc.aa.node.DefMemNode.value(), com.cliffc.aa.node.StoreNode.value(), com.cliffc.aa.node.MemJoinNode.value(), com.cliffc.aa.node.RetNode.value(), and com.cliffc.aa.node.CallEpiNode.value().

◆ ANY

final Type com.cliffc.aa.type.Type< T extends Type< T >.ANY
staticinherited

Definition at line 325 of file Type.java.

◆ ANYMEM

◆ CNT

int com.cliffc.aa.type.Type< T extends Type< T >.CNT
staticprivateinherited

Definition at line 95 of file Type.java.

◆ CTRL

final Type com.cliffc.aa.type.Type< T extends Type< T >.CTRL
staticinherited

Definition at line 326 of file Type.java.

◆ DEAD

◆ EMPTY

◆ ESCAPE

◆ FULL

◆ INTERN

final ConcurrentHashMap<Type,Type> com.cliffc.aa.type.Type< T extends Type< T >.INTERN
staticprivateinherited

Definition at line 162 of file Type.java.

◆ ISA_SCALAR

final byte [] com.cliffc.aa.type.Type< T extends Type< T >.ISA_SCALAR
staticprivateinherited

Definition at line 355 of file Type.java.

◆ LESC_NO_DISP

final TypeMem com.cliffc.aa.type.TypeMem.LESC_NO_DISP
staticpackage

◆ LIVE_BOT

◆ LIVEC

final char [] com.cliffc.aa.type.TypeMem.LIVEC = new char[]{' ','#','R','3'}
staticprivate

Definition at line 114 of file TypeMem.java.

◆ LNO_DISP

final TypeMem com.cliffc.aa.type.TypeMem.LNO_DISP
staticpackage

◆ MEM

◆ MEM_ABC

final TypeMem com.cliffc.aa.type.TypeMem.MEM_ABC
static

◆ MEM_STR

final TypeMem com.cliffc.aa.type.TypeMem.MEM_STR
staticpackage

Definition at line 229 of file TypeMem.java.

Referenced by com.cliffc.aa.node.NewStrNode.AddStrStr.AddStrStr().

◆ NIL

final Type com.cliffc.aa.type.Type< T extends Type< T >.NIL
staticinherited

Definition at line 332 of file Type.java.

◆ NREAL

final Type com.cliffc.aa.type.Type< T extends Type< T >.NREAL
staticpackageinherited

Definition at line 336 of file Type.java.

◆ NSCALR

final Type com.cliffc.aa.type.Type< T extends Type< T >.NSCALR
staticinherited

Definition at line 330 of file Type.java.

◆ POOLS

final Pool [] com.cliffc.aa.type.Type< T extends Type< T >.POOLS
staticpackageinherited

Definition at line 281 of file Type.java.

◆ REAL

final Type com.cliffc.aa.type.Type< T extends Type< T >.REAL
staticinherited

Definition at line 334 of file Type.java.

◆ RECURSIVE_MEET

int com.cliffc.aa.type.Type< T extends Type< T >.RECURSIVE_MEET
staticinherited

Definition at line 163 of file Type.java.

◆ SCALAR

final Type com.cliffc.aa.type.Type< T extends Type< T >.SCALAR
staticinherited

Definition at line 328 of file Type.java.

◆ SCALAR_PRIMS

Type [] com.cliffc.aa.type.Type< T extends Type< T >.SCALAR_PRIMS
staticprivateinherited

Definition at line 349 of file Type.java.

◆ STRS

final String [] com.cliffc.aa.type.Type< T extends Type< T >.STRS
staticprivateinherited

Definition at line 262 of file Type.java.

◆ TALL

final byte com.cliffc.aa.type.Type< T extends Type< T >.TALL
staticpackageinherited

Definition at line 239 of file Type.java.

◆ TANY

final byte com.cliffc.aa.type.Type< T extends Type< T >.TANY
staticpackageinherited

Definition at line 240 of file Type.java.

◆ TARY

final byte com.cliffc.aa.type.Type< T extends Type< T >.TARY
staticpackageinherited

Definition at line 269 of file Type.java.

◆ TCTRL

final byte com.cliffc.aa.type.Type< T extends Type< T >.TCTRL
staticpackageinherited

Definition at line 241 of file Type.java.

◆ TFLD

final byte com.cliffc.aa.type.Type< T extends Type< T >.TFLD
staticpackageinherited

Definition at line 271 of file Type.java.

◆ TFLT

final byte com.cliffc.aa.type.Type< T extends Type< T >.TFLT
staticpackageinherited

Definition at line 264 of file Type.java.

◆ TFUNPTR

final byte com.cliffc.aa.type.Type< T extends Type< T >.TFUNPTR
staticpackageinherited

Definition at line 274 of file Type.java.

◆ TFUNSIG

final byte com.cliffc.aa.type.Type< T extends Type< T >.TFUNSIG
staticpackageinherited

Definition at line 275 of file Type.java.

◆ TINT

final byte com.cliffc.aa.type.Type< T extends Type< T >.TINT
staticpackageinherited

Definition at line 263 of file Type.java.

◆ TLAST

final byte com.cliffc.aa.type.Type< T extends Type< T >.TLAST
staticpackageinherited

Definition at line 277 of file Type.java.

◆ TLIVE

final byte com.cliffc.aa.type.Type< T extends Type< T >.TLIVE
staticpackageinherited

Definition at line 276 of file Type.java.

◆ TMEM

final byte com.cliffc.aa.type.Type< T extends Type< T >.TMEM
staticpackageinherited

Definition at line 272 of file Type.java.

◆ TMEMPTR

final byte com.cliffc.aa.type.Type< T extends Type< T >.TMEMPTR
staticpackageinherited

Definition at line 273 of file Type.java.

◆ TNIL

final byte com.cliffc.aa.type.Type< T extends Type< T >.TNIL
staticpackageinherited

Definition at line 259 of file Type.java.

◆ TNREAL

final byte com.cliffc.aa.type.Type< T extends Type< T >.TNREAL
staticpackageinherited

Definition at line 257 of file Type.java.

◆ TNSCALR

final byte com.cliffc.aa.type.Type< T extends Type< T >.TNSCALR
staticpackageinherited

Definition at line 253 of file Type.java.

◆ TOBJ

final byte com.cliffc.aa.type.Type< T extends Type< T >.TOBJ
staticpackageinherited

Definition at line 267 of file Type.java.

◆ TREAL

final byte com.cliffc.aa.type.Type< T extends Type< T >.TREAL
staticpackageinherited

Definition at line 255 of file Type.java.

◆ TRPC

final byte com.cliffc.aa.type.Type< T extends Type< T >.TRPC
staticpackageinherited

Definition at line 265 of file Type.java.

◆ TSCALAR

final byte com.cliffc.aa.type.Type< T extends Type< T >.TSCALAR
staticpackageinherited

Definition at line 246 of file Type.java.

◆ TSIMPLE

final byte com.cliffc.aa.type.Type< T extends Type< T >.TSIMPLE
staticpackageinherited

Definition at line 261 of file Type.java.

◆ TSTR

final byte com.cliffc.aa.type.Type< T extends Type< T >.TSTR
staticpackageinherited

Definition at line 270 of file Type.java.

◆ TSTRUCT

final byte com.cliffc.aa.type.Type< T extends Type< T >.TSTRUCT
staticpackageinherited

Definition at line 268 of file Type.java.

◆ TTUPLE

final byte com.cliffc.aa.type.Type< T extends Type< T >.TTUPLE
staticpackageinherited

Definition at line 266 of file Type.java.

◆ TXCTRL

final byte com.cliffc.aa.type.Type< T extends Type< T >.TXCTRL
staticpackageinherited

Definition at line 242 of file Type.java.

◆ TXNIL

final byte com.cliffc.aa.type.Type< T extends Type< T >.TXNIL
staticpackageinherited

Definition at line 260 of file Type.java.

◆ TXNREAL

final byte com.cliffc.aa.type.Type< T extends Type< T >.TXNREAL
staticpackageinherited

Definition at line 258 of file Type.java.

◆ TXNSCALR

final byte com.cliffc.aa.type.Type< T extends Type< T >.TXNSCALR
staticpackageinherited

Definition at line 254 of file Type.java.

◆ TXREAL

final byte com.cliffc.aa.type.Type< T extends Type< T >.TXREAL
staticpackageinherited

Definition at line 256 of file Type.java.

◆ TXSCALAR

final byte com.cliffc.aa.type.Type< T extends Type< T >.TXSCALAR
staticpackageinherited

Definition at line 247 of file Type.java.

◆ TYPES

final TypeMem [] com.cliffc.aa.type.TypeMem.TYPES = new TypeMem[]{FULL,MEM,MEM_ABC.dual(),ALLMEM,ESCAPE}
staticpackage

Definition at line 261 of file TypeMem.java.

◆ XCTRL

final Type com.cliffc.aa.type.Type< T extends Type< T >.XCTRL
staticinherited

Definition at line 327 of file Type.java.

◆ XMEM

◆ XNIL

final Type com.cliffc.aa.type.Type< T extends Type< T >.XNIL
staticinherited

Definition at line 333 of file Type.java.

◆ XNREAL

final Type com.cliffc.aa.type.Type< T extends Type< T >.XNREAL
staticprivateinherited

Definition at line 337 of file Type.java.

◆ XNSCALR

final Type com.cliffc.aa.type.Type< T extends Type< T >.XNSCALR
staticinherited

Definition at line 331 of file Type.java.

◆ XREAL

final Type com.cliffc.aa.type.Type< T extends Type< T >.XREAL
staticprivateinherited

Definition at line 335 of file Type.java.

◆ XSCALAR

final Type com.cliffc.aa.type.Type< T extends Type< T >.XSCALAR
staticinherited

Definition at line 329 of file Type.java.


The documentation for this class was generated from the following file:
com.cliffc.aa.type.BitsAlias.FULL
static BitsAlias FULL
Definition: BitsAlias.java:27
com.cliffc.aa.type.Type< TypeMem >::xdual
T xdual()
Definition: Type.java:365
com.cliffc.aa.type.Type< TypeMem >::NSCALR
static final Type NSCALR
Definition: Type.java:330
com.cliffc.aa.type.TypeMem.check
static boolean check(TypeObj[] as)
Definition: TypeMem.java:75
com.cliffc.aa.type.Type< TypeMem >::intern_check1
boolean intern_check1()
Definition: Type.java:227
com.cliffc.aa.type.TypeMem._meet
static TypeObj[] _meet(TypeObj[] as, TypeObj[] bs, boolean is_loop)
Definition: TypeMem.java:280
com.cliffc.aa.type.TypeMem.make
static TypeMem make(TypeObj[] pubs)
Definition: TypeMem.java:163
com.cliffc.aa.type.Type< TypeMem >::TMEMPTR
static final byte TMEMPTR
Definition: Type.java:273
com.cliffc.aa.type.TypeMem.ld
TypeObj ld(TypeMemPtr ptr)
Definition: TypeMem.java:325
com.cliffc.aa.util.AryInt.isEmpty
boolean isEmpty()
Definition: AryInt.java:16
com.cliffc.aa.type.TypeMem.DEAD
static final TypeMem DEAD
Definition: TypeMem.java:226
com.cliffc.aa.type.Type< TypeMem >::clone
Type clone()
Definition: Type.java:304
com.cliffc.aa.util.Ary.push
E push(E e)
Add element in amortized constant time.
Definition: Ary.java:58
com.cliffc.aa.type.TypeMem.at_idx
static int at_idx(TypeObj[]tos, int alias)
Definition: TypeMem.java:138
com.cliffc.aa.type.Type< TypeMem >::TREAL
static final byte TREAL
Definition: Type.java:255
com.cliffc.aa.type.Type.isa
boolean isa(Type t)
Definition: Type.java:623
com.cliffc.aa.type.TypeMem._sharp_cache
HashMap< TypeMemPtr, TypeMemPtr > _sharp_cache
Definition: TypeMem.java:65
com.cliffc.aa.type.TypeMem.update
TypeMem update(BitsAlias aliases, Access fin, String fld, Type val)
Definition: TypeMem.java:459
com.cliffc.aa.type.Type< TypeMem >::typerr
RuntimeException typerr(Type t)
Definition: Type.java:947
com.cliffc.aa.type.Type< TypeMem >::_set_name
T _set_name(String name)
Definition: Type.java:558
com.cliffc.aa.util.Util.eq
static boolean eq(String s0, String s1)
Definition: Util.java:16
com.cliffc.aa.type.Type.join
Type join(Type t)
Definition: Type.java:619
com.cliffc.aa.type.TypeMem.XMEM
static final TypeMem XMEM
Definition: TypeMem.java:225
com.cliffc.aa.type.Type.interned
boolean interned()
Definition: Type.java:209
com.cliffc.aa.type.Type< TypeMem >::SCALAR
static final Type SCALAR
Definition: Type.java:328
com.cliffc
com.cliffc.aa.type.Type._hash
int _hash
Definition: Type.java:97
com.cliffc.aa.type.Type.widen
Type widen()
Definition: Type.java:828
com.cliffc.aa.type.Type< TypeMem >::may_nil
boolean may_nil()
Definition: Type.java:869
com.cliffc.aa.type.Type< TypeMem >::Type
Type()
Definition: Type.java:102
com.cliffc.aa.type.Type.check_commute
boolean check_commute(Type t, Type mt)
Definition: Type.java:593
com.cliffc.aa.type.Type
an implementation of language AA
Definition: Type.java:94
com.cliffc.aa.type.Type< TypeMem >::CNT
static int CNT
Definition: Type.java:95
com.cliffc.aa.util.Ary
Definition: Ary.java:11
com.cliffc.aa.type.Type< TypeMem >::compute_hash
int compute_hash()
Definition: Type.java:109
com.cliffc.aa.type.Type< TypeMem >::TSTR
static final byte TSTR
Definition: Type.java:270
com.cliffc.aa.type.Type< TypeMem >::_type
byte _type
Definition: Type.java:98
com.cliffc.aa.type.Type.xmt_name
Type xmt_name(Type t, Type mt)
Definition: Type.java:441
com.cliffc.aa.util.Ary._len
int _len
Definition: Ary.java:13
com.cliffc.aa.type.TypeMem._make1
static TypeObj[] _make1(TypeObj[] as)
Definition: TypeMem.java:179
com.cliffc.aa.util.Ary._es
E[] _es
Definition: Ary.java:12
com.cliffc.aa.type.Type< TypeMem >::TXNIL
static final byte TXNIL
Definition: Type.java:260
com.cliffc.aa.type.Type< TypeMem >::TLAST
static final byte TLAST
Definition: Type.java:277
com.cliffc.aa.type.Type< TypeMem >::check_name
static boolean check_name(String n)
Definition: Type.java:548
com.cliffc.aa.type.TypeMem.equals
boolean equals(Object o)
Definition: TypeMem.java:102
com.cliffc.aa.type.TypeMem._pubs
TypeObj[] _pubs
Definition: TypeMem.java:58
com.cliffc.aa.type.Type< TypeMem >::meet
final Type meet(Type t)
Definition: Type.java:412
com.cliffc.aa.type.Type< TypeMem >::TANY
static final byte TANY
Definition: Type.java:240
com.cliffc.aa.type.Bits.test_recur
boolean test_recur(int i)
Definition: Bits.java:232
com.cliffc.aa.AA.unimpl
static RuntimeException unimpl()
Definition: AA.java:10
com.cliffc.aa.type.Type< TypeMem >::str
SB str(SB sb, VBitSet dups, TypeMem mem, boolean debug)
Definition: Type.java:131
com.cliffc.aa.type.Type< TypeMem >::TFUNPTR
static final byte TFUNPTR
Definition: Type.java:274
com.cliffc.aa.type.Type< TypeMem >::TINT
static final byte TINT
Definition: Type.java:263
com.cliffc.aa.type.TypeLive.DEAD
static final TypeLive DEAD
Definition: TypeLive.java:59
com.cliffc.aa.type.TypeMem.above_center
boolean above_center()
Definition: TypeMem.java:548
com.cliffc.aa.type.Type< TypeMem >::ISA_SCALAR
static final byte[] ISA_SCALAR
Definition: Type.java:355
com.cliffc.aa.util.SB.unchar
SB unchar()
Definition: SB.java:58
com.cliffc.aa.type.Type< TypeMem >::ALL
static final Type ALL
Definition: Type.java:324
com.cliffc.aa.type.Type< TypeMem >::ALL_TYPES
static Ary< Type > ALL_TYPES
Definition: Type.java:650
com.cliffc.aa.type.Type< TypeMem >::TMEM
static final byte TMEM
Definition: Type.java:272
com.cliffc.aa.type.Bits.may_nil
boolean may_nil()
Definition: Bits.java:209
com.cliffc.aa.util.Ary.asAry
E[] asAry()
Definition: Ary.java:172
com.cliffc.aa.util.VBitSet.tset
boolean tset(int idx)
Definition: VBitSet.java:7
com.cliffc.aa.type.Bits.above_center
boolean above_center()
Definition: Bits.java:204
com.cliffc.aa.type.Type< TypeMem >::TXNREAL
static final byte TXNREAL
Definition: Type.java:258
com.cliffc.aa.type.Type< TypeMem >::TTUPLE
static final byte TTUPLE
Definition: Type.java:266
com.cliffc.aa.type.TypeMem.make0
static TypeMem make0(TypeObj[] as)
Definition: TypeMem.java:170
com.cliffc.aa.type.Type.set_name
final T set_name(String name)
Definition: Type.java:551
com.cliffc.aa.type.Type._dual
T _dual
Definition: Type.java:100
com.cliffc.aa.type.TypeMem.len
int len()
Definition: TypeMem.java:149
com.cliffc.aa.type.Type< TypeMem >::above_center
boolean above_center()
Definition: Type.java:741
com.cliffc.aa.type.Type< TypeMem >::TSTRUCT
static final byte TSTRUCT
Definition: Type.java:268
com.cliffc.aa.type.TypeMem.live
TypeLive live()
Definition: TypeMem.java:559
com.cliffc.aa.type.Type< TypeMem >::TALL
static final byte TALL
Definition: Type.java:239
com.cliffc.aa.type.BitsAlias.NIL
static BitsAlias NIL
Definition: BitsAlias.java:27
com.cliffc.aa.type.Type< TypeMem >::RECURSIVE_MEET
static int RECURSIVE_MEET
Definition: Type.java:163
com.cliffc.aa.type.Type< TypeMem >::has_name
boolean has_name()
Definition: Type.java:549
com.cliffc.aa.util.Ary.setX
E setX(int i, E e)
Definition: Ary.java:115
com.cliffc.aa.type.Type< TypeMem >::contains
final boolean contains(Type t)
Definition: Type.java:926
com.cliffc.aa.type.TypeMem.FULL
static final TypeMem FULL
Definition: TypeMem.java:222
com.cliffc.aa.type.Type.is_num
boolean is_num()
Definition: Type.java:353
com.cliffc.aa.util.Util
Definition: Util.java:5
com.cliffc.aa.type.TypeObj.UNUSED
static final TypeObj UNUSED
Definition: TypeObj.java:46
com.cliffc.aa.type.TypeObj.remove_other_flds
TypeObj remove_other_flds(String fld, Type live)
Definition: TypeObj.java:75
com.cliffc.aa.type.Type.xmeet
Type xmeet(Type t)
Definition: Type.java:461
com.cliffc.aa.type.Type< TypeMem >::must_nil
boolean must_nil()
Definition: Type.java:845
com.cliffc.aa.type.Type< TypeMem >::INTERN
static final ConcurrentHashMap< Type, Type > INTERN
Definition: Type.java:162
com.cliffc.aa.type.Type< TypeMem >::mtname
final String mtname(Type t, Type mt)
Definition: Type.java:567
com.cliffc.aa.type.Type.init
T init(byte type, String name)
Definition: Type.java:105
com.cliffc.aa.type.TypeMem.sharptr
Type sharptr(Type ptr)
Definition: TypeMem.java:419
com.cliffc.aa.type.TypeMem._st_new
static TypeObj[] _st_new(TypeObj[] base, TypeObj[] as, int alias)
Definition: TypeMem.java:454
com.cliffc.aa.util.AryInt.pop
int pop()
Definition: AryInt.java:37
com.cliffc.aa.type.Type< TypeMem >::TSCALAR
static final byte TSCALAR
Definition: Type.java:246
com.cliffc.aa.type.Type< TypeMem >::TYPES
static final Type[] TYPES
Definition: Type.java:340
com.cliffc.aa.type.Type< TypeMem >::TXSCALAR
static final byte TXSCALAR
Definition: Type.java:247
com.cliffc.aa.util.AryInt.push
AryInt push(int e)
Add element in amortized constant time.
Definition: AryInt.java:45
com.cliffc.aa.type.BitsAlias.EMPTY
static BitsAlias EMPTY
Definition: BitsAlias.java:27
com.cliffc.aa.type.Type< TypeMem >::TNIL
static final byte TNIL
Definition: Type.java:259
com.cliffc.aa.type.TypeLive.LIVE
static final TypeLive LIVE
Definition: TypeLive.java:55
com.cliffc.aa.util.VBitSet
Definition: VBitSet.java:5
com.cliffc.aa.type.Type< TypeMem >::is_simple
boolean is_simple()
Definition: Type.java:351
com.cliffc.aa.type.TypeObj.str
SB str(SB sb, VBitSet dups, TypeMem mem, boolean debug)
Definition: TypeObj.java:34
com.cliffc.aa.util.SB
Tight/tiny StringBuilder wrapper.
Definition: SB.java:8
com.cliffc.aa.type.Type< TypeMem >::NIL
static final Type NIL
Definition: Type.java:332
com.cliffc.aa.type.TypeMem.aliases
BitsAlias aliases()
Definition: TypeMem.java:152
com.cliffc.aa.type.Type< TypeMem >::TSIMPLE
static final byte TSIMPLE
Definition: Type.java:261
com.cliffc.aa.type.Bits.max
int max()
Definition: Bits.java:284
com.cliffc.aa.AA
an implementation of language AA
Definition: AA.java:9
com.cliffc.aa.type.Type< TypeMem >::oop_deep_impl
Type oop_deep_impl(Type t)
Definition: Type.java:634
com.cliffc.aa.type.Type< TypeMem >::equals
boolean equals(Object o)
Definition: Type.java:112
com.cliffc.aa.type.Type< TypeMem >::SCALAR_PRIMS
static Type[] SCALAR_PRIMS
Definition: Type.java:349
com.cliffc.aa
Definition: AA.java:1
com.cliffc.aa.type.Type< TypeMem >::TCTRL
static final byte TCTRL
Definition: Type.java:241
com.cliffc.aa.type.Type< TypeMem >::TNREAL
static final byte TNREAL
Definition: Type.java:257
com.cliffc.aa.type.Type._uid
int _uid
Definition: Type.java:96
com.cliffc.aa.util.SB.p
SB p(String s)
Definition: SB.java:13
com.cliffc.aa.type.Type._name
String _name
Definition: Type.java:99
com.cliffc.aa.type.Type< TypeMem >::REAL
static final Type REAL
Definition: Type.java:334
com.cliffc.aa.type.Type< TypeMem >::dual
final T dual()
Definition: Type.java:361
com.cliffc.aa.type.Type< TypeMem >::oob
Type oob()
Definition: Type.java:635
com.cliffc.aa.type.TypeMem.sharpen
TypeMemPtr sharpen(TypeMemPtr dull)
Definition: TypeMem.java:402
com.cliffc.aa.type.Type< TypeMem >::XNIL
static final Type XNIL
Definition: Type.java:333
com.cliffc.aa.type.Type< TypeMem >::POOLS
static final Pool[] POOLS
Definition: Type.java:281
com.cliffc.aa.type.Type< TypeMem >::TOBJ
static final byte TOBJ
Definition: Type.java:267
com.cliffc.aa.type.Type< TypeMem >::concat
static void concat(Ary< Type > ts, Type[] ts1)
Definition: Type.java:676
com.cliffc.aa.type.Type< TypeMem >::TNSCALR
static final byte TNSCALR
Definition: Type.java:253
com.cliffc.aa.util.AryInt
Definition: AryInt.java:8
com
com.cliffc.aa.type.Bits.set
B set(int bit)
Definition: Bits.java:264
com.cliffc.aa.type.TypeMem.MEM
static final TypeMem MEM
Definition: TypeMem.java:224
com.cliffc.aa.type.TypeMem.at
TypeObj at(int alias)
Definition: TypeMem.java:135
com.cliffc.aa.util.SB.toString
String toString()
Definition: SB.java:62
com.cliffc.aa.type.Type< TypeMem >::TXNSCALR
static final byte TXNSCALR
Definition: Type.java:254
com.cliffc.aa.type.Type< TypeMem >::hashcons
T hashcons()
Definition: Type.java:165
com.cliffc.aa.type.TypeMem.EMPTY
static final TypeMem EMPTY
Definition: TypeMem.java:223
com.cliffc.aa.type.Type< TypeMem >::TXCTRL
static final byte TXCTRL
Definition: Type.java:242
com.cliffc.aa.type.Type< TypeMem >::TXREAL
static final byte TXREAL
Definition: Type.java:256
com.cliffc.aa.type.Type< TypeMem >::TFLT
static final byte TFLT
Definition: Type.java:264