Skip to content

Commit

Permalink
Remove Jupiter operators
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Aug 28, 2015
1 parent 9c7d9e4 commit 0cbe52a
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 190 deletions.
4 changes: 0 additions & 4 deletions src/backend/blockopt.c
Expand Up @@ -2156,10 +2156,6 @@ STATIC int funcsideeffect_walk(elem *e)
break;
goto Lside;

case OParray:
case OPfield:
goto Lside; // these can throw exceptions

// Note: we should allow assignments to local variables as
// not being a 'side effect'.

Expand Down
2 changes: 1 addition & 1 deletion src/backend/cgcs.c
Expand Up @@ -367,7 +367,7 @@ STATIC void ecom(elem **pe)
case OPd_s64: case OPs64_d: case OPd_u64: case OPu64_d:
case OPstrctor: case OPu16_d: case OPd_u16:
case OParrow:
case OPvoid: case OPnullcheck:
case OPvoid:
case OPbsf: case OPbsr: case OPbswap: case OPpopcnt: case OPvector:
case OPld_u64:
#if TX86
Expand Down
84 changes: 1 addition & 83 deletions src/backend/cgelem.c
Expand Up @@ -30,7 +30,6 @@ static char __file__[] = __FILE__; /* for tassert.h */
extern void error(const char *filename, unsigned linnum, unsigned charnum, const char *format, ...);

STATIC elem * optelem(elem *,goal_t);
STATIC elem * elarray(elem *e);
STATIC elem * eldiv(elem *, goal_t goal);

extern elem * evalu8(elem *, goal_t goal);
Expand Down Expand Up @@ -4825,23 +4824,6 @@ STATIC elem * elinfo(elem *e, goal_t goal)
return e;
}

/********************************************
*/

STATIC elem * elhstring(elem *e, goal_t goal)
{
return e;
}

/********************************************
*/

STATIC elem * elnullcheck(elem *e, goal_t goal)
{
return e;
}


/********************************************
*/

Expand All @@ -4850,54 +4832,6 @@ STATIC elem * elclassinit(elem *e, goal_t goal)
return e;
}

/********************************************
*/

STATIC elem * elnewarray(elem *e, goal_t goal)
{
return e;
}

/********************************************
*/

STATIC elem * elmultinewarray(elem *e, goal_t goal)
{
return e;
}

/********************************************
*/

STATIC elem * elinstanceof(elem *e, goal_t goal)
{
return e;
}

/********************************************
*/

STATIC elem * elfinalinstanceof(elem *e, goal_t goal)
{
return e;
}

/********************************************
*/

STATIC elem * elcheckcast(elem *e, goal_t goal)
{
return e;
}

/********************************************
*/

STATIC elem * elarraylength(elem *e, goal_t goal)
{
return e;
}

/********************************************
*/

Expand Down Expand Up @@ -4972,22 +4906,6 @@ STATIC elem * elvalist(elem *e, goal_t goal)
}
#endif

/********************************************
*/

STATIC elem * elarray(elem *e, goal_t goal)
{
return e;
}

/********************************************
*/

STATIC elem * elfield(elem *e, goal_t goal)
{
return e;
}

/******************************************
* OPparam
*/
Expand Down Expand Up @@ -5419,7 +5337,7 @@ STATIC elem * optelem(elem *e, goal_t goal)
}
else /* unary operator */
{
assert(!e->E2 || op == OPinfo || op == OParraylength || op == OPddtor);
assert(!e->E2 || op == OPinfo || op == OPddtor);
if (!goal && !OTsideff(op) && !(e->Ety & mTYvolatile))
{
tym_t tym = e->E1->Ety;
Expand Down
23 changes: 0 additions & 23 deletions src/backend/cod2.c
Expand Up @@ -5246,27 +5246,4 @@ code *cdhalt(elem *e,regm_t *pretregs)
return gen1(NULL, 0xF4); // HLT
}

/****************************************
* Check to see if pointer is NULL.
*/

code *cdnullcheck(elem *e,regm_t *pretregs)
{ regm_t retregs;
regm_t scratch;
unsigned reg;
code *c;
code *cs;

assert(!I16);
retregs = *pretregs;
if ((retregs & allregs) == 0)
retregs |= allregs;
c = codelem(e->E1,&retregs,FALSE);
scratch = allregs & ~retregs;
cs = allocreg(&scratch,&reg,TYint);
unsigned rex = I64 ? REX_W : 0;
cs = genc1(cs,0x8B,(rex << 16) | buildModregrm(2,reg,findreg(retregs)),FLconst,0); // MOV reg,0[e]
return cat3(c,cs,fixresult(e,retregs,pretregs));
}

#endif // !SPP
1 change: 0 additions & 1 deletion src/backend/code.h
Expand Up @@ -329,7 +329,6 @@ cd_t cdddtor;
cd_t cdctor;
cd_t cddtor;
cd_t cdmark;
cd_t cdnullcheck;
cd_t cdclassinit;

/* cod3.c */
Expand Down
2 changes: 0 additions & 2 deletions src/backend/el.c
Expand Up @@ -2651,7 +2651,6 @@ int el_match(elem *n1,elem *n2)
break;
case OPasm:
case OPstring:
case OPhstring:
if (n1->EV.ss.Vstrlen != (n = n2->EV.ss.Vstrlen) ||
n1->EV.ss.Voffset != n2->EV.ss.Voffset ||
memcmp(n1->EV.ss.Vstring,n2->EV.ss.Vstring,n))
Expand Down Expand Up @@ -3110,7 +3109,6 @@ void elem_print(elem *e)
break;
case OPasm:
case OPstring:
case OPhstring:
dbg_printf(" '%s',%lld\n",e->EV.ss.Vstring,(unsigned long long)e->EV.ss.Voffset);
break;
case OPconst:
Expand Down
14 changes: 1 addition & 13 deletions src/backend/gflow.c
Expand Up @@ -1329,12 +1329,6 @@ STATIC void accumlv(vec_t GEN,vec_t KILL,elem *n)
vec_subass(GEN,KILL);
break;

case OPnewarray:
case OPmultinewarray:
accumlv(GEN,KILL,n->E1);
accumlv(GEN,KILL,n->E2);
goto L1;

case OPcall:
case OPcallns:
case OPstrcpy:
Expand Down Expand Up @@ -1572,12 +1566,6 @@ STATIC void accumvbe(vec_t GEN,vec_t KILL,elem *n)
}
break;

case OPnewarray:
case OPmultinewarray:
accumvbe(GEN,KILL,n->E1);
accumvbe(GEN,KILL,n->E2);
break;

case OPcall:
case OPcallns:
accumvbe(GEN,KILL,n->E2);
Expand Down Expand Up @@ -1703,7 +1691,7 @@ STATIC void accumvbe(vec_t GEN,vec_t KILL,elem *n)
{ if (!vec_testbit(e->E1->Eexp,KILL))
continue;
}
else /* OPconst or OPrelconst or OPstring or OPhstring */
else /* OPconst or OPrelconst or OPstring */
continue;

vec_setbit(i,KILL); // KILL it
Expand Down
12 changes: 0 additions & 12 deletions src/backend/glocal.c
Expand Up @@ -274,17 +274,9 @@ STATIC void local_exp(elem *e,int goal)
local_ambigref();
break;

case OPnewarray:
case OPmultinewarray:
local_exp(e->E1,1);
local_exp(e->E2,1);
goto Lrd;

case OPstrcmp:
case OPmemcmp:
case OPbt:
case OParray:
case OPfield:
local_exp(e->E1,1);
local_exp(e->E2,1);
local_ambigref();
Expand Down Expand Up @@ -584,8 +576,6 @@ STATIC int local_getflags(elem *e,symbol *s)
case OPucallns:
case OPcall:
case OPcallns:
case OPnewarray:
case OPmultinewarray:
case OPstrcat:
case OPstrcpy:
case OPmemcpy:
Expand All @@ -608,8 +598,6 @@ STATIC int local_getflags(elem *e,symbol *s)
break;

case OPind:
case OParray:
case OPfield:
case OPstrlen:
case OPstrcmp:
case OPmemcmp:
Expand Down
6 changes: 0 additions & 6 deletions src/backend/gloop.c
Expand Up @@ -1030,8 +1030,6 @@ STATIC void markinvar(elem *n,vec_t rd)
case OPld_d: case OPd_ld:
case OPld_u64:
case OPc_r: case OPc_i:
case OParraylength:
case OPnullcheck:
case OPu16_32:
case OPu16_d: case OPd_u16:
case OPs8_16: case OP16_8:
Expand Down Expand Up @@ -1111,9 +1109,6 @@ STATIC void markinvar(elem *n,vec_t rd)
case OPord: case OPnlg: case OPnleg: case OPnule:
case OPnul: case OPnuge: case OPnug: case OPnue:

case OPinstanceof:
case OPfinalinstanceof:
case OPcheckcast:
case OPcomma:
case OPpair:
case OPrpair:
Expand Down Expand Up @@ -1210,7 +1205,6 @@ STATIC void markinvar(elem *n,vec_t rd)
case OPstring:
case OPrelconst:
case OPconst: /* constants are always LI */
case OPhstring:
case OPframeptr:
makeLI(n);
break;
Expand Down
4 changes: 0 additions & 4 deletions src/backend/gother.c
Expand Up @@ -1402,10 +1402,6 @@ STATIC void accumda(elem *n,vec_t DEAD, vec_t POSS)
// of possibly dead ones
break;

case OPnewarray:
case OPmultinewarray:
case OParray:
case OPfield:
case OPstrcat:
case OPstrcmp:
case OPmemcmp:
Expand Down
13 changes: 0 additions & 13 deletions src/backend/oper.h
Expand Up @@ -232,19 +232,6 @@ enum OPER
OPvector, // SIMD vector operations
OPvecsto, // SIMD vector store operations

// Jupiter operators
OParray, // access Jupiter array, left is handle, right is index
OParraylength, // evaluates array handle into array length
OPfield, // access Jupiter object field, left is handle, right is offset
OPnewarray, // allocate Jupiter array, left is dimension, right is type
OPmultinewarray, // allocate multidimensional Jupiter array
// left is dimensions, right is (numdims,type signature)
OPinstanceof, // left is class id, right is handle
OPfinalinstanceof, // left is class id, right is handle
OPcheckcast, // left is class id, right is handle
OPhstring, // handle to static string
OPnullcheck, // check if pointer is null

#if TX86
OPinp, /* input from I/O port */
OPoutp, /* output to I/O port */
Expand Down

0 comments on commit 0cbe52a

Please sign in to comment.