Go to the documentation of this file. 1 package com.cliffc.aa.type;
23 private static int rot(
int x,
int k) {
return (x<<k) | (x>>(32-k)); }
24 @SuppressWarnings(
"fallthrough")
29 a = b = c = 0xdeadbeef + (
_ts.length<<2) + hash;
30 for( i=0; i+2<
_ts.length; i+=3 ) {
34 a -= c; a ^=
rot(c, 4); c += b;
35 b -= a; b ^=
rot(a, 6); a += c;
36 c -= b; c ^=
rot(b, 8); b += a;
37 a -= c; a ^=
rot(c,16); c += b;
38 b -= a; b ^=
rot(a,19); a += c;
39 c -= b; c ^=
rot(b, 4); b += a;
41 switch(
_ts.length-i) {
45 c ^= b; c -=
rot(b,14);
46 a ^= c; a -=
rot(c,11);
47 b ^= a; b -=
rot(a,25);
48 c ^= b; c -=
rot(b,16);
49 a ^= c; a -=
rot(c, 4);
50 b ^= a; b -=
rot(a,14);
51 c ^= b; c -=
rot(b,24);
57 @Override
public boolean equals( Object o ) {
58 if(
this==o )
return true;
59 if( !(o instanceof
TypeTuple) )
return false;
68 if(
_ts!=
null &&
_ts.length>0 ) {
71 for( j--; j>0; j-- )
if(
_ts[j] != last )
break;
72 _ts[0].
str(sb,dups,mem,debug);
73 for(
int i=1; i<=j+1; i++ )
74 _ts[i].
str(sb.
p(
','),dups,mem,debug);
75 if( j+2<
_ts.length-1 ) sb.
p(
"...");
76 if(
_ts.length> j+2 ) last.
str(sb.
p(
','),dups,mem,debug);
94 public static TypeTuple make(
Type t0,
Type t1,
Type t2,
Type t3,
Type t4,
Type t5 ) {
return make0(
false,
Types.
ts(t0,t1,t2,t3,t4,t5)); }
102 for(
int i=0; i<ts.
len(); i++ )
103 ts2[DSP_IDX+i] = ts.
at(i);
157 for(
int i=0; i<
_ts.length; i++ ) ts[i] =
_ts[i].
dual();
176 for(
int i=0; i<
_ts.length; i++ ) ts[i] =
_ts[i].
meet(tmax.
_ts[i]);
196 for(
Type _t :
_ts )
if( !_t.may_be_con() )
return false;
201 for(
Type _t :
_ts )
if( !_t.is_con() )
return false;
204 @Override
public boolean must_nil() {
return false; }
210 for(
int i=0; i<ts.length; i++ )
216 for(
int i=0; i<ts.length; i++ )
223 for(
int i=0; i<ts.length; i++ )
230 if(
isa(t) )
return 0;
233 if( tt.
_ts.length !=
_ts.length )
return 99;
235 for(
int i=0; i<
_ts.length; i++ )
static TypeTuple make(Type t0, Type t1, Type t2, Type t3, Type t4)
static TypeTuple make_args(Type[] ts)
TypeTuple make_from_arg(int idx, Type arg)
Memory type; the state of all of memory; memory edges order memory ops.
static TypeTuple make_ret(Type trez)
static TypeTuple make(Type t0, Type t1, Type t2, Type t3, Type t4, Type t5)
static final TypeTuple START_STATE
static final TypeTuple LVAL_RD
static boolean eq(Type[] ts0, Type[] ts1)
static TypeTuple make_args()
static final TypeFunPtr GENERIC_FUNPTR
an implementation of language AA
static final TypeTuple LVAL_WR
SB str(SB sb, VBitSet dups, TypeMem mem, boolean debug)
TypeTuple sharptr(TypeMem mem)
static final TypeMem ALLMEM
static Type[] hash_cons(Type[] ts)
A memory-based collection of optionally named fields.
SB str(SB sb, VBitSet dups, TypeMem mem, boolean debug)
static final TypeTuple IF_TRUE
static final TypeMem ANYMEM
static Type[] ts(Type t0)
static final TypeTuple IF_ANY
static final TypeTuple SCALAR1
static final TypeTuple[] TYPES
static final TypeInt INT64
TypeTuple xmeet1(TypeTuple tmax)
static Type[] clone(Type[] ts)
static final TypeTuple RET
TypeTuple init(boolean any, Type[] ts)
static TypeTuple make0(boolean any, Type[] ts)
static TypeTuple make(boolean any, Type[] ts)
static final TypeTuple FLT64
static final TypeMemPtr ARYPTR
static final TypeTuple IF_ALL
static TypeTuple make(Type t0, Type t1, Type t2, Type t3)
static TypeTuple make_args(Type t2, Type t3)
static TypeTuple make(Type[] ts)
static TypeTuple make(TypeStruct ts)
Tight/tiny StringBuilder wrapper.
static final TypeTuple LVAL_LEN
an implementation of language AA
static final TypeTuple STRPTR
static final TypeTuple INT64_INT64
static TypeTuple make_args(Type t2)
static final TypeTuple CALLE
static final TypeTuple OOP_OOP
static final Pool[] POOLS
boolean cycle_equals(Type o)
static final TypeTuple FLT64_FLT64
static TypeTuple make(Type t0, Type t1, Type t2)
static final TypeMemPtr STRPTR
static TypeTuple make_args(Type t2, Type t3, Type t4)
static final TypeTuple INT64
static int rot(int x, int k)
static final TypeTuple NO_ARGS
static final TypeTuple IF_FALSE
static final TypeMem EMPTY
static final TypeFlt FLT64
static TypeTuple make(Type t0, Type t1)
static final TypeTuple TEST1
static final TypeMemPtr ISUSED0
static final TypeTuple TEST0