More infotable cleanups: zap the debugging table of info table names.
This can be cleanly done by looking at the .itbl field on Names and Tycons.
* included in the distribution.
*
* $RCSfile: codegen.c,v $
- * $Revision: 1.21 $
- * $Date: 2000/04/05 10:25:08 $
+ * $Revision: 1.22 $
+ * $Date: 2000/04/12 09:37:19 $
* ------------------------------------------------------------------------*/
#include "hugsbasictypes.h"
}
}
-#define M_ITBLNAMES 35000
-
-void* itblNames[M_ITBLNAMES];
-int nItblNames = 0;
-
/* allocate space for top level variable
* any change requires a corresponding change in 'build'.
*/
pushAtom(bco,hd(args));
setPos(v,asmBox(bco,boxingConRep(con)));
} else {
-
- void* vv = stgConInfo(con);
- if (!(nItblNames < (M_ITBLNAMES-2)))
- internal("alloc -- M_ITBLNAMES too small");
- if (isName(con)) {
- itblNames[nItblNames++] = vv;
- itblNames[nItblNames++] = textToStr(name(con).text);
- } else
- if (isTuple(con)) {
- itblNames[nItblNames++] = vv;
- itblNames[nItblNames++] = textToStr(ghcTupleText(con));
- } else
- assert ( /* cant identify constructor name */ 0 );
- setPos(v,asmAllocCONSTR(bco, vv));
+ setPos(v,asmAllocCONSTR(bco,stgConInfo(con)));
}
break;
}
}
}
setPos(v,asmAllocAP(bco,totSizeW));
- //ORIGINALLY:setPos(v,asmAllocAP(bco,length(stgAppArgs(rhs))));
break;
}
case LAMBDA: /* optimisation */
* included in the distribution.
*
* $RCSfile: storage.c,v $
- * $Revision: 1.69 $
- * $Date: 2000/04/11 16:36:53 $
+ * $Revision: 1.70 $
+ * $Date: 2000/04/12 09:37:19 $
* ------------------------------------------------------------------------*/
#include "hugsbasictypes.h"
* debugging support
* ------------------------------------------------------------------------*/
+/* Given the address of an info table, find the constructor/tuple
+ that it belongs to, and return the name. Only needed for debugging.
+*/
+char* lookupHugsItblName ( void* v )
+{
+ int i;
+ for (i = TYCON_BASE_ADDR;
+ i < TYCON_BASE_ADDR+tabTyconSz; ++i) {
+ if (tabTycon[i-TYCON_BASE_ADDR].inUse
+ && tycon(i).itbl == v)
+ return textToStr(tycon(i).text);
+ }
+ for (i = NAME_BASE_ADDR;
+ i < NAME_BASE_ADDR+tabNameSz; ++i) {
+ if (tabName[i-NAME_BASE_ADDR].inUse
+ && name(i).itbl == v)
+ return textToStr(name(i).text);
+ }
+ return NULL;
+}
+
static String maybeModuleStr ( Module m )
{
if (isModule(m)) return textToStr(module(m).text); else return "??";
/* -----------------------------------------------------------------------------
- * $Id: Printer.c,v 1.23 2000/03/31 03:09:36 hwloidl Exp $
+ * $Id: Printer.c,v 1.24 2000/04/12 09:37:19 sewardj Exp $
*
* (c) The GHC Team, 1994-2000.
*
* Printer
* ------------------------------------------------------------------------*/
-
#ifdef INTERPRETER
-extern void* itblNames[];
-extern int nItblNames;
-char* lookupHugsItblName ( void* v )
-{
- int i;
- for (i = 0; i < nItblNames; i += 2)
- if (itblNames[i] == v) return itblNames[i+1];
- return NULL;
-}
+char* lookupHugsItblName ( void* itbl );
#endif
void printPtr( StgPtr p )