aa
com.cliffc.aa.type.TypeFlds Class Reference
Collaboration diagram for com.cliffc.aa.type.TypeFlds:
[legend]

Classes

class  Key
 

Static Public Member Functions

static TypeFld[] clone (TypeFld[] ts)
 
static TypeFld[] copyOf (TypeFld[] flds, int len)
 
static void free (TypeFld[] ts)
 
static TypeFld[] get (int len)
 
static TypeFld[] hash_cons (TypeFld[] ts)
 
static TypeFld[] ts (TypeFld t0)
 
static TypeFld[] ts (TypeFld t0, TypeFld t1)
 
static TypeFld[] ts (TypeFld t0, TypeFld t1, TypeFld t2)
 
static TypeFld[] ts (TypeFld t0, TypeFld t1, TypeFld t2, TypeFld t3)
 

Private Member Functions

 TypeFlds (int len)
 
boolean check_ (TypeFld[] ts)
 
TypeFld[] get ()
 
TypeFld[] hash_cons_ (TypeFld[] ts)
 

Static Private Member Functions

static TypeFlds tary (int len)
 

Private Attributes

final Ary< TypeFld[]> _free = new Ary<>(new TypeFld[1][],0)
 
final IHashMap _intern = new IHashMap()
 
final int _len
 

Static Private Attributes

static final Key K = new Key(null,0)
 
static final Ary< TypeFldsTYPEARY = new Ary<>(new TypeFlds[1],0)
 

Detailed Description

Definition at line 8 of file TypeFlds.java.

Constructor & Destructor Documentation

◆ TypeFlds()

com.cliffc.aa.type.TypeFlds.TypeFlds ( int  len)
private

Definition at line 48 of file TypeFlds.java.

48 { _len=len; }

References com.cliffc.aa.type.TypeFlds._len.

Referenced by com.cliffc.aa.type.TypeFlds.tary().

Here is the caller graph for this function:

Member Function Documentation

◆ check_()

boolean com.cliffc.aa.type.TypeFlds.check_ ( TypeFld[]  ts)
private

Definition at line 50 of file TypeFlds.java.

50  {
51  K._ts=ts;
52  K._hash = Key.hash(ts);
53  Key k2 = _intern.get(K);
54  return k2._ts==ts;
55  }

References com.cliffc.aa.type.TypeFlds.Key._hash, com.cliffc.aa.type.TypeFlds._intern, com.cliffc.aa.type.TypeFlds.Key._ts, com.cliffc.aa.util.IHashMap.get(), com.cliffc.aa.type.TypeFlds.Key.hash(), com.cliffc.aa.type.TypeFlds.K, and com.cliffc.aa.type.TypeFlds.ts().

Here is the call graph for this function:

◆ clone()

static TypeFld [] com.cliffc.aa.type.TypeFlds.clone ( TypeFld[]  ts)
static

Definition at line 116 of file TypeFlds.java.

116  {
117  TypeFld[] ts2 = tary(ts.length).get();
118  for( int i=0; i<ts.length; i++ )
119  ts2[i] = TypeFld.malloc(ts[i]._fld,ts[i]._t,ts[i]._access,ts[i]._order);
120  return ts2;
121  }

References com.cliffc.aa.type.TypeFld._access, com.cliffc.aa.type.TypeFld._fld, com.cliffc.aa.type.TypeFld._order, com.cliffc.aa.type.TypeFld._t, com.cliffc.aa.type.TypeFlds.get(), com.cliffc.aa.type.TypeFld.malloc(), com.cliffc.aa.type.TypeFlds.tary(), and com.cliffc.aa.type.TypeFlds.ts().

Referenced by com.cliffc.aa.type.TypeStruct._clone(), com.cliffc.aa.type.TypeStruct.ax_impl_struct(), com.cliffc.aa.type.TypeStruct.make_from(), com.cliffc.aa.type.TypeStruct.remove_other_flds(), and com.cliffc.aa.type.TypeStruct.widen().

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

◆ copyOf()

static TypeFld [] com.cliffc.aa.type.TypeFlds.copyOf ( TypeFld[]  flds,
int  len 
)
static

Definition at line 124 of file TypeFlds.java.

124  {
125  TypeFld[] flds2 = tary(len).get();
126  System.arraycopy(flds,0,flds2,0,Math.min(flds.length,len));
127  return flds2;
128  }

References com.cliffc.aa.type.TypeFlds.get(), and com.cliffc.aa.type.TypeFlds.tary().

Referenced by com.cliffc.aa.type.TypeStruct.add_fld(), com.cliffc.aa.type.TypeStruct.set_fld(), and com.cliffc.aa.type.TypeStruct.update().

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

◆ free()

static void com.cliffc.aa.type.TypeFlds.free ( TypeFld[]  ts)
static

Definition at line 80 of file TypeFlds.java.

80 { tary(ts.length)._free.push(ts); }

References com.cliffc.aa.type.TypeFlds._free, com.cliffc.aa.type.TypeFlds.tary(), and com.cliffc.aa.type.TypeFlds.ts().

Here is the call graph for this function:

◆ get() [1/2]

◆ get() [2/2]

static TypeFld [] com.cliffc.aa.type.TypeFlds.get ( int  len)
static

Definition at line 79 of file TypeFlds.java.

79 { return tary(len).get(); }

References com.cliffc.aa.type.TypeFlds.get(), and com.cliffc.aa.type.TypeFlds.tary().

Here is the call graph for this function:

◆ hash_cons()

static TypeFld [] com.cliffc.aa.type.TypeFlds.hash_cons ( TypeFld[]  ts)
static

Definition at line 81 of file TypeFlds.java.

81 { return tary(ts.length).hash_cons_(ts); }

References com.cliffc.aa.type.TypeFlds.hash_cons_(), com.cliffc.aa.type.TypeFlds.tary(), and com.cliffc.aa.type.TypeFlds.ts().

Referenced by com.cliffc.aa.type.TypeStruct.hashcons_freeS(), com.cliffc.aa.type.TypeStruct.mark_cyclic(), com.cliffc.aa.type.TypeStruct.rdual(), and com.cliffc.aa.type.TypeStruct.xdual().

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

◆ hash_cons_()

TypeFld [] com.cliffc.aa.type.TypeFlds.hash_cons_ ( TypeFld[]  ts)
private

Definition at line 65 of file TypeFlds.java.

65  {
66  K._ts=ts;
67  K._hash = Key.hash(ts);
68  Key k2 = _intern.get(K);
69  if( k2 != null ) {
70  if( k2._ts!=ts ) _free.push(ts);
71  return k2._ts;
72  }
73  _intern.put(new Key(ts,K._hash));
74  return ts;
75  }

References com.cliffc.aa.type.TypeFlds._free, com.cliffc.aa.type.TypeFlds.Key._hash, com.cliffc.aa.type.TypeFlds._intern, com.cliffc.aa.type.TypeFlds.Key._ts, com.cliffc.aa.util.IHashMap.get(), com.cliffc.aa.type.TypeFlds.Key.hash(), com.cliffc.aa.type.TypeFlds.K, com.cliffc.aa.util.IHashMap.put(), and com.cliffc.aa.type.TypeFlds.ts().

Referenced by com.cliffc.aa.type.TypeFlds.hash_cons().

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

◆ tary()

static TypeFlds com.cliffc.aa.type.TypeFlds.tary ( int  len)
staticprivate

Definition at line 13 of file TypeFlds.java.

13  {
14  TypeFlds tary = TYPEARY.atX(len);
15  return tary==null ? TYPEARY.setX(len,new TypeFlds(len)) : tary;
16  }

References com.cliffc.aa.type.TypeFlds.TYPEARY, and com.cliffc.aa.type.TypeFlds.TypeFlds().

Referenced by com.cliffc.aa.type.TypeFlds.clone(), com.cliffc.aa.type.TypeFlds.copyOf(), com.cliffc.aa.type.TypeFlds.free(), com.cliffc.aa.type.TypeFlds.get(), com.cliffc.aa.type.TypeFlds.hash_cons(), and com.cliffc.aa.type.TypeFlds.ts().

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

◆ ts() [1/4]

◆ ts() [2/4]

static TypeFld [] com.cliffc.aa.type.TypeFlds.ts ( TypeFld  t0,
TypeFld  t1 
)
static

Definition at line 88 of file TypeFlds.java.

88  {
89  TypeFlds t2 = tary(2);
90  TypeFld[] ts = t2.get();
91  ts[0] = t0;
92  ts[1] = t1;
93  return ts;
94  }

References com.cliffc.aa.type.TypeFlds.get(), com.cliffc.aa.type.TypeFlds.tary(), and com.cliffc.aa.type.TypeFlds.ts().

Here is the call graph for this function:

◆ ts() [3/4]

static TypeFld [] com.cliffc.aa.type.TypeFlds.ts ( TypeFld  t0,
TypeFld  t1,
TypeFld  t2 
)
static

Definition at line 95 of file TypeFlds.java.

95  {
96  TypeFlds t3 = tary(3);
97  TypeFld[] ts = t3.get();
98  ts[0] = t0;
99  ts[1] = t1;
100  ts[2] = t2;
101  return ts;
102  }

References com.cliffc.aa.type.TypeFlds.get(), com.cliffc.aa.type.TypeFlds.tary(), and com.cliffc.aa.type.TypeFlds.ts().

Here is the call graph for this function:

◆ ts() [4/4]

static TypeFld [] com.cliffc.aa.type.TypeFlds.ts ( TypeFld  t0,
TypeFld  t1,
TypeFld  t2,
TypeFld  t3 
)
static

Definition at line 103 of file TypeFlds.java.

103  {
104  TypeFlds t4 = tary(4);
105  TypeFld[] ts = t4.get();
106  ts[0] = t0;
107  ts[1] = t1;
108  ts[2] = t2;
109  ts[3] = t3;
110  return ts;
111  }

References com.cliffc.aa.type.TypeFlds.get(), com.cliffc.aa.type.TypeFlds.tary(), and com.cliffc.aa.type.TypeFlds.ts().

Here is the call graph for this function:

Member Data Documentation

◆ _free

final Ary<TypeFld[]> com.cliffc.aa.type.TypeFlds._free = new Ary<>(new TypeFld[1][],0)
private

◆ _intern

final IHashMap com.cliffc.aa.type.TypeFlds._intern = new IHashMap()
private

◆ _len

final int com.cliffc.aa.type.TypeFlds._len
private

◆ K

final Key com.cliffc.aa.type.TypeFlds.K = new Key(null,0)
staticprivate

◆ TYPEARY

final Ary<TypeFlds> com.cliffc.aa.type.TypeFlds.TYPEARY = new Ary<>(new TypeFlds[1],0)
staticprivate

Definition at line 10 of file TypeFlds.java.

Referenced by com.cliffc.aa.type.TypeFlds.tary().


The documentation for this class was generated from the following file:
com.cliffc.aa.type.TypeFlds.get
TypeFld[] get()
Definition: TypeFlds.java:59
com.cliffc.aa.util.IHashMap.get
public< T > T get(T key)
Definition: IHashMap.java:11
com.cliffc.aa.type.TypeFlds.TypeFlds
TypeFlds(int len)
Definition: TypeFlds.java:48
com.cliffc.aa.type.TypeFld._order
int _order
Definition: TypeFld.java:18
com.cliffc.aa.type.TypeFlds._free
final Ary< TypeFld[]> _free
Definition: TypeFlds.java:47
com.cliffc.aa.type.TypeFlds.K
static final Key K
Definition: TypeFlds.java:18
com.cliffc.aa.type.TypeFlds.Key._ts
TypeFld[] _ts
Definition: TypeFlds.java:22
com.cliffc.aa.type.TypeFlds.Key._hash
int _hash
Definition: TypeFlds.java:23
com.cliffc.aa.type.TypeFlds.TYPEARY
static final Ary< TypeFlds > TYPEARY
Definition: TypeFlds.java:10
com.cliffc.aa.type.TypeFlds.hash_cons_
TypeFld[] hash_cons_(TypeFld[] ts)
Definition: TypeFlds.java:65
com.cliffc.aa.type.TypeFld._access
Access _access
Definition: TypeFld.java:17
com.cliffc.aa.type.TypeFld._fld
String _fld
Definition: TypeFld.java:15
com.cliffc.aa.type.TypeFld.malloc
static TypeFld malloc(String fld, Type t, Access access, int order)
Definition: TypeFld.java:53
com.cliffc.aa.type.TypeFlds.tary
static TypeFlds tary(int len)
Definition: TypeFlds.java:13
com.cliffc.aa.type.TypeFlds._intern
final IHashMap _intern
Definition: TypeFlds.java:46
com.cliffc.aa.type.TypeFld._t
Type _t
Definition: TypeFld.java:16
com.cliffc.aa.type.TypeFlds._len
final int _len
Definition: TypeFlds.java:45
com.cliffc.aa.util.IHashMap.put
public< T > T put(T kv)
Definition: IHashMap.java:9
com.cliffc.aa.type.TypeFlds.ts
static TypeFld[] ts(TypeFld t0)
Definition: TypeFlds.java:82