1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-14 23:46:14 +00:00

Remove dead stores. (#240)

This commit is contained in:
Bruce Mitchener 2021-01-20 12:23:26 +07:00 committed by GitHub
parent 0a057dec6b
commit 6f7ec059bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 14 additions and 48 deletions

View File

@ -471,12 +471,11 @@ ConsCell *find_close_prior_cell(struct conspage *page, LispPTR oldcell) {
unsigned oldoffset = oldcell & 0xFF;
unsigned offset = page->next_cell;
unsigned prior = 0;
unsigned noffset, poffset;
unsigned noffset;
ConsCell *cell;
while (offset) {
if ((offset < oldoffset) && (offset >= (oldoffset - 14))) {
poffset = offset;
noffset = FREECONS(page, offset)->next_free;
while ((noffset > offset) && (noffset < oldoffset)) {
prior = offset;

View File

@ -193,11 +193,11 @@ ex:
static ConsCell *find_pair_in_page(struct conspage *pg, LispPTR cdrval) {
ConsCell *carcell, *cdrcell;
unsigned int offset, prior, priorprior, ppriorprior, noffset, nprior, poffset;
unsigned int offset, prior, priorprior, noffset, nprior, poffset;
if (pg->count < 2) return ((ConsCell *)0);
ppriorprior = priorprior = prior = nprior = 0;
priorprior = prior = nprior = 0;
for (offset = pg->next_cell; offset; offset = FREECONS(pg, offset)->next_free) {
if (prior) {
@ -243,7 +243,6 @@ static ConsCell *find_pair_in_page(struct conspage *pg, LispPTR cdrval) {
return (carcell);
}
}
ppriorprior = priorprior;
priorprior = prior;
prior = offset;
}

View File

@ -315,7 +315,6 @@ int sf(struct frameex1 *fx_addr68k) {
ptr = Addr68k_from_LADDR(STK_OFFSET + bf->ivar);
i = 0;
while (ptr != (DLword *)bf) {
ptrhi = ptr;
ptrlo = ptr + 1;
printf(" %6x : 0x%4x 0x%4x ", LADDR_from_68k(ptr), GETWORD(ptr), GETWORD(ptrlo));
ivarindex = get_ivar_name(fx_addr68k, i++, &localivar);

View File

@ -79,7 +79,6 @@ void nnewframe(register struct frameex1 *newpfra2, register DLword *achain, regi
register UNSIGNED i; /* temp for control */
register int nametablesize; /* NameTable size of current function header. */
register int ph; /* alink temp, also phase */
struct frameex1 *onewpfra2, *oonewpfra2, *ooonewpfra2;
newframe:
#ifdef SUN3_OS3_OR_OS4_IL
@ -123,9 +122,6 @@ newframe:
}
ph &= 0xFFFE; /* to mask off SLOW bit */
ooonewpfra2 = oonewpfra2;
oonewpfra2 = onewpfra2;
onewpfra2 = newpfra2;
newpfra2 = (struct frameex1 *)(-FRAMESIZE + Stackspace + ph);
{ /* open new block to try and conserve address register */
@ -433,7 +429,6 @@ LispPTR native_newframe(int slot)
register DLword *achain; /* pointer to 1st word of the searching
FVAR slot in CurrentFrameExtension */
register int name; /* Atom# of target FVAR slot. */
struct frameex2 *onewpfra2, *oonewpfra2, *ooonewpfra2;
{ /* LOCAL temp regs */
register int rslot = slot;
@ -470,9 +465,6 @@ LispPTR native_newframe(int slot)
name, VALS_HI_RET(name)); */
return (*((LispPTR *)achain) = VALS_HI_RET(name));
}
ooonewpfra2 = oonewpfra2;
oonewpfra2 = onewpfra2;
onewpfra2 = newpfra2;
newpfra2 = (struct frameex2 *)(-FRAMESIZE + Stackspace + (alink & 0xFFFE));
{ /* open new block to try and conserve address register */

View File

@ -516,7 +516,6 @@ LispPTR reclaimstackp(LispPTR ptr) /* This is the entry function */
void printarrayblock(LispPTR base) {
struct arrayblock *bbase, *btrailer, *ptrailer;
struct arrayblock *bfwd, *bbwd;
LispPTR *addr;
LispPTR pbase, nbase;
@ -524,8 +523,6 @@ void printarrayblock(LispPTR base) {
bbase = (struct arrayblock *)Addr68k_from_LADDR(base);
btrailer = (struct arrayblock *)Addr68k_from_LADDR(Trailer(base, bbase));
ptrailer = (struct arrayblock *)Addr68k_from_LADDR(base - ARRAYBLOCKTRAILERWORDS);
bfwd = (struct arrayblock *)Addr68k_from_LADDR(bbase->fwd);
bbwd = (struct arrayblock *)Addr68k_from_LADDR(bbase->bkwd);
nbase = base + 2 * bbase->arlen;
pbase = base - 2 * ptrailer->arlen;

View File

@ -300,25 +300,23 @@ returNIL: \n\
LispPTR gcmapscan(void) {
register GCENTRY probe;
register GCENTRY *entry;
GCENTRY offset, dbgentry, dbgcontents;
GCENTRY offset, dbgcontents;
register LispPTR ptr;
probe = HTMAIN_ENTRY_COUNT;
nextentry:
while ((probe = gcscan1(probe)) != NIL) {
entry = (GCENTRY *)HTmain + probe;
dbgentry = GETGC(entry);
retry:
if (HENTRY->collision) {
register GCENTRY *prev;
register GCENTRY *link;
LispPTR content, dbgfree;
LispPTR content;
prev = (GCENTRY *)0;
link = (GCENTRY *)HTcoll + GetLinkptr((content = HTLPTR->contents));
linkloop:
offset = ((struct htcoll *)link)->free_ptr;
dbgfree = ((struct htcoll *)link)->next_free;
if (StkCntIsZero(offset)) {
/* Reclaimable object */
ptr = VAG2(GetSegnuminColl(offset), (probe << 1));
@ -417,7 +415,6 @@ LispPTR gcscanstack(void) {
register struct frameex1 *frameex;
register struct fnhead *fnheader;
frameex = (struct frameex1 *)basicframe;
scanptr = LADDR_from_68k(frameex);
{
register LispPTR fn_head;
#ifdef BIGVM

View File

@ -79,13 +79,10 @@ int sysout_loader(const char * sysout_file_name, int sys_size)
struct stat stat_buf; /* file stat buf */
int i, vp;
int machinetype;
char errmsg[255];
int j = 0;
machinetype = 0;
/* Checks for specifying the process size (phase I) */
/* If sys_size == 0 figure out the proper size later */
if ((sys_size != 0) && (sys_size < DEFAULT_PRIME_SYSOUTSIZE)) {
@ -222,8 +219,6 @@ int sysout_loader(const char * sysout_file_name, int sys_size)
exit(1);
}
machinetype = ifpage.machinetype;
if ((stat_buf.st_size & (BYTESPER_PAGE - 1)) != 0)
printf("CAUTION::not an integral number of pages. sysout & 0x1ff = 0x%x\n",
(int)(stat_buf.st_size & (BYTESPER_PAGE - 1)));

View File

@ -296,8 +296,6 @@ DLword *freestackblock(DLword n, StackWord *start68k, int align)
{
register int wantedsize;
register StackWord *scanptr68k;
StackWord *ooscan, *oscan;
register StackWord *orig68k;
register STKBLK *freeptr68k;
register StackWord *easp68k;
register DLword freesize;
@ -338,8 +336,9 @@ SCAN:
scanptr68k = (StackWord *)Addr68k_from_StkOffset(((FX *)scanptr68k)->nextblock);
break;
default:
orig68k = scanptr68k;
#ifdef STACKCHECK
StackWord *orig68k = scanptr68k;
#endif
while (STKWORD(scanptr68k)->flags != STK_BF) {
S_WARN(STKWORD(scanptr68k)->flags == STK_NOTFLG, "NOTFLG not on", scanptr68k);
scanptr68k = (StackWord *)(((DLword *)scanptr68k) + DLWORDSPER_CELL);
@ -382,8 +381,6 @@ FREESCAN:
freeptr68k = (STKBLK *)scanptr68k;
freesize = FSB_size(freeptr68k);
FREE:
ooscan = oscan;
oscan = scanptr68k;
scanptr68k = (StackWord *)(((DLword *)freeptr68k) + freesize);
if (freesize == 0) error("FREESIZE = 0");

View File

@ -271,10 +271,7 @@ LispPTR make_value_list(int argcount, LispPTR *argarray) {
void simulate_unbind(FX2 *frame, int unbind_count, FX2 *returner) {
int unbind;
LispPTR *stackptr;
DLword *nextblock;
stackptr = (LispPTR *)(Stackspace + frame->nextblock);
nextblock = (DLword *)stackptr;
LispPTR *stackptr = (LispPTR *)(Stackspace + frame->nextblock);
for (unbind = 0; unbind < unbind_count; unbind++) {
register int value;
register LispPTR *lastpvar;

View File

@ -65,7 +65,7 @@ LispPTR rpc(LispPTR *args)
register int s, msec_until_timeout, msec_between_tries, out_length;
register int received;
register int port;
int dontblock, dest;
int dest;
unsigned fromlen;
fd_set read_descriptors;
struct timeval pertry_timeout, total_timeout, time_waited;
@ -111,8 +111,6 @@ LispPTR rpc(LispPTR *args)
/* Open the socket; Might want to make this non-blocking */
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) goto handle_error;
dontblock = 1;
/* The sockets that rpc controls don't block */
fcntl(s, F_SETFL, fcntl(s, F_GETFL, 0) | O_NONBLOCK);

View File

@ -41,18 +41,17 @@ LispPTR N_OP_rplcons(register LispPTR list, register LispPTR item) {
#ifndef NEWCDRCODING
register struct conspage *conspage;
register ConsCell *new_cell;
#endif
register ConsCell *list68k;
LispPTR register page;
#endif
if (!Listp(list)) ERROR_EXIT(item);
/* There are some rest Cell and "list" must be ONPAGE cdr_coded */
#ifndef NEWCDRCODING
page = POINTER_PAGE(list);
list68k = (ConsCell *)Addr68k_from_LADDR(list);
/* There are some rest Cell and "list" must be ONPAGE cdr_coded */
#ifndef NEWCDRCODING
if ((GetCONSCount(page) != 0) && (list68k->cdr_code > CDR_MAXINDIRECT)) {
GCLOOKUP(item, ADDREF);
GCLOOKUP(cdr(list), DELREF);

View File

@ -1148,7 +1148,7 @@ void all_stack_dump(DLword start, DLword end, DLword silent)
{
STKH *stkptr;
DLword *start68k, *end68k, *orig68k;
DLword size, dummy;
DLword size;
int sdlines = 0;
extern IFPAGE *InterfacePage;
@ -1165,7 +1165,6 @@ void all_stack_dump(DLword start, DLword end, DLword silent)
stkptr = (STKH *)start68k;
while (((DLword *)stkptr) < end68k) {
dummy = LADDR_from_68k(stkptr);
switch (STKHPTR(stkptr)->flags1) {
case STK_GUARD:
case STK_FSB:

View File

@ -197,7 +197,6 @@ void set_Xcursor(DspInterface dsp, const uint8_t *bitmap, int hotspot_x, int hot
unsigned char image[32];
int i;
Pixmap Cursor_src, Cursor_msk;
Screen *screen;
#ifdef BYTESWAP
if (from_lisp)
@ -209,7 +208,6 @@ void set_Xcursor(DspInterface dsp, const uint8_t *bitmap, int hotspot_x, int hot
#endif /* BYTESWAP */
XLOCK;
screen = ScreenOfDisplay(dsp->display_id, DefaultScreen(dsp->display_id));
Cursor_src = XCreatePixmapFromBitmapData(dsp->display_id, dsp->DisplayWindow, (char *)image,
16, 16, 1, 0, 1); /* Has to have a depth of 1! */
Cursor_msk = XCreatePixmapFromBitmapData(dsp->display_id, dsp->DisplayWindow, (char *)image,