|
static Ary< Type > | ALL_TYPES () |
|
static boolean | eq (Type[] t0, Type[] t1) |
|
static void | init0 (HashMap< String, Type > types) |
|
static boolean | intern_check () |
|
static TypeFunSig | make (String[] args, TypeTuple formals, TypeTuple ret) |
|
static TypeFunSig | make (TypeTuple ret, Type[] ts) |
|
static TypeFunSig | make (TypeTuple ret, TypeMemPtr disp, Type arg1) |
|
static TypeFunSig | make (TypeTuple ret, TypeMemPtr disp, Type arg1, Type arg2) |
|
static TypeFunSig | make (TypeTuple ret, TypeTuple formals) |
|
Definition at line 10 of file TypeFunSig.java.
◆ [static initializer]()
com.cliffc.aa.type.TypeFunSig.[static initializer] |
|
staticpackage |
◆ _set_name()
Definition at line 558 of file Type.java.
562 return t1.hashcons_free();
◆ _uid()
◆ above()
Definition at line 625 of file Type.java.
625 {
return t !=
this &&
meet(t)==t; }
◆ above_center()
boolean com.cliffc.aa.type.TypeFunSig.above_center |
( |
| ) |
|
◆ ALL_TYPES()
Definition at line 651 of file Type.java.
656 concat(ts,TypeFunPtr.TYPES);
657 concat(ts,TypeFunSig.TYPES);
661 concat(ts,TypeMemPtr.TYPES);
665 concat(ts,TypeStruct.TYPES);
671 for(
int i=0; i<ts.
_len; i++ )
672 for(
int j=i+1; j<ts.
_len; j++ )
◆ arg()
Type com.cliffc.aa.type.TypeFunSig.arg |
( |
int |
idx | ) |
|
Definition at line 88 of file TypeFunSig.java.
References com.cliffc.aa.type.TypeFunSig._formals, and com.cliffc.aa.type.TypeTuple._ts.
Referenced by com.cliffc.aa.node.PrimNode.ConvertTypeName.apply(), com.cliffc.aa.node.MemPrimNode.ReadPrimNode.as_fun(), com.cliffc.aa.node.MemPrimNode.WritePrimNode.as_fun(), com.cliffc.aa.node.NewNode< T extends TypeObj< T >.NewPrimNode< TypeAry >.as_fun(), com.cliffc.aa.type.TypeFunSig.display(), com.cliffc.aa.node.PrimNode.err(), com.cliffc.aa.node.PrimNode.ConvertTypeName.err(), com.cliffc.aa.node.FunNode.formal(), com.cliffc.aa.type.TypeFunSig.make_from_arg(), com.cliffc.aa.type.TypeFunSig.str(), and com.cliffc.aa.node.PrimNode.value().
◆ check_commute()
Definition at line 593 of file Type.java.
594 if( t==
this )
return true;
601 if( mt==nmt2 )
return true;
602 System.out.println(
"Meet not commutative: "+
this+
".meet("+t+
")="+mt+
",\n but "+t+
".meet("+
this+
")="+nmt2);
◆ check_name()
Definition at line 548 of file Type.java.
548 {
return n.isEmpty() || n.charAt(n.length()-1)==
':'; }
◆ check_startup()
Definition at line 684 of file Type.java.
689 for(
Type t1 : ts ) {
692 assert t0.check_symmetric(t1,mt);
699 for(
Type t2 : ts ) {
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);
709 assert errs==0 :
"Found "+errs+
" associative errors";
714 for(
Type t1 : ts ) {
716 for(
Type t2 : ts ) {
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);
728 assert errs==0 :
"Found "+errs+
" non-join-type errors";
731 SCALAR_PRIMS =
new Type[] { TypeInt.INT64, TypeFlt.FLT64, TypeMemPtr.OOP0, TypeFunPtr.GENERIC_FUNPTR, TypeRPC.ALL_CALL };
◆ check_symmetric()
Definition at line 608 of file Type.java.
609 if( t==
this )
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);
◆ clone()
Definition at line 304 of file Type.java.
311 if( t instanceof TypeStruct )
312 ((TypeStruct)t)._cyclic =
false;
315 catch( CloneNotSupportedException cns ) {
throw new RuntimeException(cns); }
◆ compute_hash()
int com.cliffc.aa.type.TypeFunSig.compute_hash |
( |
| ) |
|
|
package |
◆ concat()
Definition at line 676 of file Type.java.
677 for(
Type t1 : ts1 ) {
678 assert !t1.above_center();
680 if( t1!=t1.dual() ) ts.
push(t1.dual());
◆ contains() [1/2]
◆ contains() [2/2]
◆ cross_nil()
◆ cycle_equals()
boolean com.cliffc.aa.type.TypeFunSig.cycle_equals |
( |
Type |
o | ) |
|
◆ display()
Type com.cliffc.aa.type.TypeFunSig.display |
( |
| ) |
|
◆ dual()
◆ eq()
Definition at line 136 of file Type.java.
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++ )
◆ equals()
boolean com.cliffc.aa.type.TypeFunSig.equals |
( |
Object |
o | ) |
|
◆ getd()
◆ getl()
◆ getstr()
◆ has_name()
◆ hashCode()
◆ hashcons()
Definition at line 165 of file Type.java.
167 T t2 = (T)
INTERN.get(
this);
169 assert t2._dual !=
null;
180 d._hash = d.compute_hash();
182 if(
this==d )
return d;
184 assert d._dual==
null;
185 assert
INTERN.get(d)==
null;
◆ hashcons_free()
◆ high()
◆ init() [1/2]
◆ init() [2/2]
Definition at line 18 of file TypeFunSig.java.
20 assert args.length>=formals.len();
21 assert (args[CTL_IDX]==
null || Util.eq(args[CTL_IDX],
" ctl")) && (formals.at(CTL_IDX)==
Type.CTRL || formals.at(CTL_IDX)==
Type.XCTRL);
22 assert (args[MEM_IDX]==
null || Util.eq(args[MEM_IDX],
" mem")) && (formals.at(MEM_IDX) instanceof TypeMem || formals.at(MEM_IDX)==
Type.ALL || formals.at(MEM_IDX)==
Type.ANY);
23 assert (args[DSP_IDX]==
null || Util.eq(args[DSP_IDX],
"^" )) && formals.at(DSP_IDX).is_display_ptr();
24 assert ret.len()==3 && ret.at(MEM_IDX) instanceof TypeMem;
References com.cliffc.aa.type.TypeFunSig._args, com.cliffc.aa.type.TypeFunSig._formals, com.cliffc.aa.type.TypeFunSig._ret, com.cliffc.aa.type.Type< T extends Type< T >.ALL, com.cliffc.aa.type.Type< T extends Type< T >.ANY, com.cliffc.aa.type.TypeTuple.at(), com.cliffc.aa.type.Type< T extends Type< T >.CTRL, com.cliffc.aa.util.Util.eq(), com.cliffc.aa.type.TypeFunSig.init(), com.cliffc.aa.type.Type< T extends Type< T >.is_display_ptr(), com.cliffc.aa.type.TypeTuple.len(), com.cliffc.aa.type.Type< TypeFunSig >.TFUNSIG, and com.cliffc.aa.type.Type< T extends Type< T >.XCTRL.
Referenced by com.cliffc.aa.type.TypeFunSig.init(), com.cliffc.aa.type.TypeFunSig.make(), and com.cliffc.aa.type.TypeFunSig.xdual().
◆ init0()
Definition at line 642 of file Type.java.
643 types.put(
"real",
REAL);
644 types.put(
"scalar",
SCALAR);
645 TypeInt.init1(types);
646 TypeFlt.init1(types);
647 TypeStr.init1(types);
◆ intern_check()
Definition at line 212 of file Type.java.
216 if( !k.intern_check0(v) ) {
217 System.out.println(
"INTERN_CHECK FAIL: "+k._uid+
":"+k+
" vs "+v.
_uid+
":"+v);
◆ intern_check0()
◆ intern_check1()
◆ intern_find()
◆ intern_lookup()
◆ intern_size()
◆ interned()
◆ is_con()
boolean com.cliffc.aa.type.TypeFunSig.is_con |
( |
| ) |
|
◆ is_display()
◆ is_display_ptr()
◆ is_forward_ref()
◆ is_num()
◆ is_ptr()
◆ is_simple()
◆ isa()
◆ isa_scalar()
◆ isBitShape()
byte com.cliffc.aa.type.TypeFunSig.isBitShape |
( |
Type |
t | ) |
|
◆ join()
◆ make() [1/6]
Definition at line 147 of file Type.java.
148 Pool P =
POOLS[type];
149 Type t1 = P.malloc();
150 return t1.
init(type,
"").hashcons_free();
◆ make() [2/6]
Definition at line 71 of file TypeFunSig.java.
73 return t1.init(args,formals,ret).hashcons_free();
References com.cliffc.aa.type.Type< T extends Type< T >.hashcons_free(), com.cliffc.aa.type.TypeFunSig.init(), com.cliffc.aa.type.Type< TypeFunSig >.POOLS, and com.cliffc.aa.type.Type< TypeFunSig >.TFUNSIG.
Referenced by com.cliffc.aa.HM.HM9.Root.add_sig(), com.cliffc.aa.HM.HM.Root.add_sig(), com.cliffc.aa.node.IntrinsicNode.convertTypeName(), com.cliffc.aa.node.IntrinsicNode.convertTypeNameStruct(), com.cliffc.aa.node.FunNode.FunNode(), com.cliffc.aa.type.TypeFunSig.make_from_arg(), com.cliffc.aa.node.FunNode.make_new_fun(), com.cliffc.aa.node.NewNode< T extends TypeObj< T >.NewPrimNode< TypeAry >.NewPrimNode(), com.cliffc.aa.node.PrimNode.PrimNode(), com.cliffc.aa.node.TestNodeSmall.testMemoryArgs(), com.cliffc.aa.node.TestNodeSmall.testRecursiveDisplay(), com.cliffc.aa.HM.TestHM.tfs(), com.cliffc.aa.HM.TestHM9.tfs(), com.cliffc.aa.Parse.type0(), and com.cliffc.aa.type.TypeFunSig.xmeet().
◆ make() [3/6]
◆ make() [4/6]
◆ make() [5/6]
◆ make() [6/6]
◆ make_from()
◆ make_from_arg()
TypeFunSig com.cliffc.aa.type.TypeFunSig.make_from_arg |
( |
int |
idx, |
|
|
Type |
arg |
|
) |
| |
◆ may_be_con()
boolean com.cliffc.aa.type.TypeFunSig.may_be_con |
( |
| ) |
|
◆ may_nil()
boolean com.cliffc.aa.type.TypeFunSig.may_nil |
( |
| ) |
|
◆ meet()
Definition at line 412 of file Type.java.
414 if( t ==
this )
return this;
416 Type mt = Key.get(
this,t);
417 if( mt !=
null )
return mt;
◆ meet_loop()
◆ meet_nil()
Type com.cliffc.aa.type.TypeFunSig.meet_nil |
( |
Type |
nil | ) |
|
◆ mtname()
Definition at line 567 of file Type.java.
568 Type t0 =
this, t1 = t;
569 String s0 = t0.
_name, s1 = t1._name;
571 if(
Util.
eq(s0,s1) )
return s0;
573 if( s0.length() > s1.length() ) { t1=
this; t0=t; s0=t0.
_name; s1=t1._name; }
574 int x = 0, i;
char c;
576 for( i = 0; i < s0.length(); i++ ) {
577 if( (c=s0.charAt(i)) != s1.charAt(i) )
585 String s2 = i==s0.length() ? s0 : s0.substring(0, x).intern();
◆ must_nil()
boolean com.cliffc.aa.type.TypeFunSig.must_nil |
( |
| ) |
|
◆ nargs()
int com.cliffc.aa.type.TypeFunSig.nargs |
( |
| ) |
|
◆ not_nil()
Type com.cliffc.aa.type.TypeFunSig.not_nil |
( |
| ) |
|
|
package |
◆ oob() [1/6]
◆ oob() [2/6]
◆ oob() [3/6]
◆ oob() [4/6]
◆ oob() [5/6]
◆ oob() [6/6]
◆ oob_deep()
◆ oop_deep_impl()
◆ rdual()
◆ remove_name()
◆ repeats_in_cycles()
◆ retern()
◆ set_name()
◆ sharptr()
◆ simple_ptr()
◆ str()
Definition at line 50 of file TypeFunSig.java.
51 if( debug ) sb.p(
'_').p(
_uid);
54 boolean field_sep=
false;
55 for(
int i=0; i<
nargs(); i++ ) {
56 if( !debug && i==CTL_IDX && Util.eq(
_args[CTL_IDX],
" ctl") )
continue;
57 if( !debug && i==MEM_IDX && Util.eq(
_args[MEM_IDX],
" mem") )
continue;
58 if( !debug && i==DSP_IDX && Util.eq(
_args[DSP_IDX],
"^" ) )
continue;
61 arg(i).
str(sb.p(
':'),dups,mem,debug);
62 sb.
p(
" "); field_sep=
true;
64 if( field_sep ) sb.
unchar();
References com.cliffc.aa.type.TypeFunSig._args, com.cliffc.aa.type.Type< TypeFunSig >._name, com.cliffc.aa.type.TypeFunSig._ret, com.cliffc.aa.type.Type< TypeFunSig >._uid, com.cliffc.aa.type.TypeFunSig.arg(), com.cliffc.aa.util.Util.eq(), com.cliffc.aa.type.TypeFunSig.nargs(), com.cliffc.aa.util.SB.p(), com.cliffc.aa.type.Type< T extends Type< T >.SCALAR, com.cliffc.aa.type.TypeTuple.str(), com.cliffc.aa.type.Type< T extends Type< T >.str(), and com.cliffc.aa.util.SB.unchar().
Referenced by com.cliffc.aa.node.FunNode.str().
◆ toString()
◆ typerr()
Definition at line 947 of file Type.java.
948 throw new RuntimeException(
"Should not reach here: internal type system error with "+
this+(t==
null?
"":(
" and "+t)));
◆ untern()
◆ walk()
◆ widen()
◆ xdual()
TypeFunSig com.cliffc.aa.type.TypeFunSig.xdual |
( |
| ) |
|
|
protected |
◆ xmeet()
Type com.cliffc.aa.type.TypeFunSig.xmeet |
( |
Type |
t | ) |
|
|
protected |
Definition at line 92 of file TypeFunSig.java.
111 TypeFunSig tf = (TypeFunSig)t;
References com.cliffc.aa.type.TypeFunSig._formals, com.cliffc.aa.type.TypeFunSig._ret, com.cliffc.aa.type.Type< T extends Type< T >._type, com.cliffc.aa.type.Type< TypeFunSig >.ALL, com.cliffc.aa.type.TypeFunSig.make(), com.cliffc.aa.type.Type< T extends Type< T >.meet(), com.cliffc.aa.type.Type< TypeFunSig >.TARY, com.cliffc.aa.type.Type< TypeFunSig >.TFLT, com.cliffc.aa.type.Type< TypeFunSig >.TFUNPTR, com.cliffc.aa.type.Type< TypeFunSig >.TFUNSIG, com.cliffc.aa.type.Type< TypeFunSig >.TINT, com.cliffc.aa.type.Type< TypeFunSig >.TLIVE, com.cliffc.aa.type.Type< TypeFunSig >.TMEM, com.cliffc.aa.type.Type< TypeFunSig >.TMEMPTR, com.cliffc.aa.type.Type< TypeFunSig >.TOBJ, com.cliffc.aa.type.Type< TypeFunSig >.TRPC, com.cliffc.aa.type.Type< TypeFunSig >.TSTR, com.cliffc.aa.type.Type< TypeFunSig >.TSTRUCT, com.cliffc.aa.type.Type< TypeFunSig >.TTUPLE, and com.cliffc.aa.type.Type< TypeFunSig >.typerr().
◆ xmt_name()
◆ _args
String [] com.cliffc.aa.type.TypeFunSig._args |
Definition at line 14 of file TypeFunSig.java.
Referenced by com.cliffc.aa.node.MemPrimNode.ReadPrimNode.as_fun(), com.cliffc.aa.node.MemPrimNode.WritePrimNode.as_fun(), com.cliffc.aa.node.PrimNode.as_fun(), com.cliffc.aa.node.NewNode< T extends TypeObj< T >.NewPrimNode< TypeAry >.as_fun(), com.cliffc.aa.type.TypeFunSig.compute_hash(), com.cliffc.aa.type.TypeFunSig.equals(), com.cliffc.aa.type.TypeFunSig.init(), com.cliffc.aa.type.TypeFunSig.make_from_arg(), com.cliffc.aa.node.FunNode.make_new_fun(), com.cliffc.aa.type.TypeFunSig.str(), and com.cliffc.aa.type.TypeFunSig.xdual().
◆ _dual
◆ _formals
TypeTuple com.cliffc.aa.type.TypeFunSig._formals |
Definition at line 15 of file TypeFunSig.java.
Referenced by com.cliffc.aa.type.TypeFunSig.above_center(), com.cliffc.aa.type.TypeFunSig.arg(), com.cliffc.aa.node.FunNode.bad_mem_use(), com.cliffc.aa.type.TypeFunSig.compute_hash(), com.cliffc.aa.type.TypeFunSig.equals(), com.cliffc.aa.node.CallNode.err(), com.cliffc.aa.node.CEProjNode.good_call(), com.cliffc.aa.node.FunNode.ideal_inline(), com.cliffc.aa.node.CallEpiNode.ideal_reduce(), com.cliffc.aa.node.FunNode.ideal_reduce(), com.cliffc.aa.type.TypeFunSig.init(), com.cliffc.aa.node.CallNode.least_cost(), com.cliffc.aa.type.TypeFunSig.make_from_arg(), com.cliffc.aa.type.TypeFunSig.nargs(), com.cliffc.aa.node.FunNode.type_special(), com.cliffc.aa.type.TypeFunSig.xdual(), com.cliffc.aa.type.TypeFunSig.xmeet(), and com.cliffc.aa.node.PrimNode.xstr().
◆ _hash
◆ _name
◆ _ret
Definition at line 16 of file TypeFunSig.java.
Referenced by com.cliffc.aa.node.PrimNode.ConvertTypeName.apply(), com.cliffc.aa.type.TypeFunSig.compute_hash(), com.cliffc.aa.type.TypeFunSig.equals(), com.cliffc.aa.node.AssertNode.ideal_grow(), com.cliffc.aa.node.FunNode.ideal_inline(), com.cliffc.aa.type.TypeFunSig.init(), com.cliffc.aa.type.TypeFunSig.make_from_arg(), com.cliffc.aa.node.FunNode.make_new_fun(), com.cliffc.aa.type.TypeFunSig.str(), com.cliffc.aa.node.PrimNode.value(), com.cliffc.aa.type.TypeFunSig.xdual(), and com.cliffc.aa.type.TypeFunSig.xmeet().
◆ _type
◆ _uid
◆ ALL
◆ ALL_TYPES
◆ ANY
◆ CNT
◆ CTRL
◆ func_names
final String [] com.cliffc.aa.type.TypeFunSig.func_names = new String[]{" ctl", " mem", "^" , "arg3", "arg4", "arg5" } |
|
static |
◆ II_I
◆ INTERN
◆ ISA_SCALAR
◆ NIL
◆ NREAL
◆ NSCALR
◆ POOLS
◆ REAL
◆ RECURSIVE_MEET
◆ SCALAR
◆ SCALAR_PRIMS
◆ STRS
◆ TALL
◆ TANY
◆ TARY
◆ TCTRL
◆ TFLD
◆ TFLT
◆ TFUNPTR
◆ TFUNSIG
◆ TINT
◆ TLAST
◆ TLIVE
◆ TMEM
◆ TMEMPTR
◆ TNIL
◆ TNREAL
◆ TNSCALR
◆ TOBJ
◆ TREAL
◆ TRPC
◆ TSCALAR
◆ TSIMPLE
◆ TSTR
◆ TSTRUCT
◆ TTUPLE
◆ TXCTRL
◆ TXNIL
◆ TXNREAL
◆ TXNSCALR
◆ TXREAL
◆ TXSCALAR
◆ TYPES
◆ XCTRL
◆ XNIL
◆ XNREAL
◆ XNSCALR
◆ XREAL
◆ XSCALAR
The documentation for this class was generated from the following file:
static final byte TMEMPTR
E push(E e)
Add element in amortized constant time.
TypeTuple make_from_arg(int idx, Type arg)
RuntimeException typerr(Type t)
static boolean eq(String s0, String s1)
boolean check_commute(Type t, Type mt)
an implementation of language AA
static TypeFunSig make(String[] args, TypeTuple formals, TypeTuple ret)
SB str(SB sb, VBitSet dups, TypeMem mem, boolean debug)
Type xmt_name(Type t, Type mt)
static final String[] func_names
static boolean check_name(String n)
SB str(SB sb, VBitSet dups, TypeMem mem, boolean debug)
static final byte TFUNPTR
static final byte[] ISA_SCALAR
static Ary< Type > ALL_TYPES
static final byte TXNREAL
final T set_name(String name)
static final byte TSTRUCT
static int RECURSIVE_MEET
final boolean contains(Type t)
static final ConcurrentHashMap< Type, Type > INTERN
final String mtname(Type t, Type mt)
T init(byte type, String name)
static final byte TSCALAR
static final Type[] TYPES
static final byte TXSCALAR
Tight/tiny StringBuilder wrapper.
static final byte TSIMPLE
Type oop_deep_impl(Type t)
static Type[] SCALAR_PRIMS
static final Pool[] POOLS
static void concat(Ary< Type > ts, Type[] ts1)
static final byte TNSCALR
static final byte TXNSCALR
static final byte TFUNSIG