Bug 492301 - nanojit: remove some dead code. r=edwsmith

This commit is contained in:
Nicholas Nethercote 2009-05-18 01:45:46 -04:00
parent 9581ac0331
commit 1a33faa263
9 changed files with 3 additions and 64 deletions

View File

@ -2401,7 +2401,7 @@ class RegExpNativeCompiler {
/* FIXME Use bug 463260 smart pointer when available. */
#ifdef NJ_VERBOSE
debug_only_v(fragment->lirbuf->names = new (&gc) LirNameMap(&gc, NULL, fragmento->labels);)
debug_only_v(fragment->lirbuf->names = new (&gc) LirNameMap(&gc, fragmento->labels);)
#endif
/* FIXME Use bug 463260 smart pointer when available. */
#ifdef NJ_VERBOSE

View File

@ -5164,7 +5164,7 @@ js_InitJIT(JSTraceMonitor *tm)
tm->fragmento = fragmento;
tm->lirbuf = new (&gc) LirBuffer(fragmento, NULL);
#ifdef DEBUG
tm->lirbuf->names = new (&gc) LirNameMap(&gc, NULL, tm->fragmento->labels);
tm->lirbuf->names = new (&gc) LirNameMap(&gc, tm->fragmento->labels);
#endif
for (size_t i = 0; i < MONITOR_N_GLOBAL_STATES; ++i) {
tm->globalStates[i].globalShape = -1;

View File

@ -1856,11 +1856,6 @@ namespace nanojit
debug_only(saved.used = 0); // marker that we are no longer in exit path
}
void Assembler::setCallTable(const CallInfo* functions)
{
_functions = functions;
}
#ifdef NJ_VERBOSE
char Assembler::outline[8192];
char Assembler::outlineEOL[512];

View File

@ -162,7 +162,6 @@ namespace nanojit
*/
class Assembler MMGC_SUBCLASS_DECL
{
friend class DeadCodeFilter;
friend class VerboseBlockReader;
public:
#ifdef NJ_VERBOSE
@ -262,8 +261,6 @@ namespace nanojit
DWB(Fragment*) _thisfrag;
RegAllocMap* _branchStateMap;
const CallInfo *_functions;
NIns* _nIns; // current native instruction
NIns* _nExitIns; // current instruction in exit fragment page
NIns* _startingIns; // starting location of code compilation for error handling
@ -341,7 +338,6 @@ namespace nanojit
Register nRegisterAllocFromSet(int32_t set);
void nRegisterResetAll(RegAlloc& a);
void nMarkExecute(Page* page, int flags);
void nFrameRestore(RegisterMask rmask);
NIns* nPatchBranch(NIns* branch, NIns* location);
void nFragExit(LIns* guard);

View File

@ -226,13 +226,6 @@ namespace nanojit
NJ_DELETE(f);
}
void Fragmento::clearFrag(const void* ip)
{
if (_frags.containsKey(ip)) {
clearFragment(_frags.remove(ip));
}
}
void Fragmento::clearFrags()
{
// reclaim any dangling native pages
@ -295,29 +288,6 @@ namespace nanojit
}
#endif
Fragment *Fragmento::getMerge(GuardRecord *lr, const void* ip)
{
Fragment *anchor = lr->exit->from->anchor;
for (Fragment *f = anchor->branches; f != 0; f = f->nextbranch) {
if (f->kind == MergeTrace && f->ip == ip /*&& f->calldepth == lr->calldepth*/) {
// found existing shared branch on anchor
return f;
}
}
Fragment *f = newBranch(anchor, ip);
f->root = f;
f->kind = MergeTrace;
verbose_only(
int mergeid = 1;
for (Fragment *g = anchor->branches; g != 0; g = g->nextbranch)
if (g->kind == MergeTrace)
mergeid++;
addLabel(f, "M", mergeid);
)
return f;
}
Fragment *Fragmento::createBranch(SideExit* exit, const void* ip)
{
Fragment *f = newBranch(exit->from, ip);
@ -561,7 +531,6 @@ namespace nanojit
loopEntry(NULL),
vmprivate(NULL),
_code(NULL),
_links(NULL),
_hits(0),
_pages(NULL)
{
@ -573,12 +542,6 @@ namespace nanojit
NanoAssert(_pages == 0);
}
void Fragment::resetHits()
{
blacklistLevel >>= 1;
_hits = 0;
}
void Fragment::blacklist()
{
blacklistLevel++;

View File

@ -107,9 +107,7 @@ namespace nanojit
// that this does not destroy any resources shared with other
// fragments (such as a LirBuffer or this fragment itself as a
// jump target).
void clearFrag(const void* ip);
void clearFrags(); // clear all fragments from the cache
Fragment* getMerge(GuardRecord *lr, const void* ip);
Fragment* createBranch(SideExit *exit, const void* ip);
Fragment* newFrag(const void* ip);
Fragment* newBranch(Fragment *from, const void* ip);
@ -180,12 +178,9 @@ namespace nanojit
NIns* code() { return _code; }
void setCode(NIns* codee, Page* pages) { _code = codee; _pages = pages; }
GuardRecord* links() { return _links; }
int32_t& hits() { return _hits; }
void resetHits();
void blacklist();
bool isBlacklisted() { return _hits < 0; }
debug_only( bool hasOnlyTreeLinks(); )
void releaseLirBuffer();
void releaseCode(Fragmento* frago);
void releaseTreeMem(Fragmento* frago);

View File

@ -499,16 +499,14 @@ namespace nanojit
DRCWB(avmplus::String*) name;
};
avmplus::SortedMap<LInsp, Entry*, avmplus::LIST_GCObjects> names;
const CallInfo *_functions;
LabelMap *labels;
void formatImm(int32_t c, char *buf);
public:
LirNameMap(avmplus::GC *gc, const CallInfo *_functions, LabelMap *r)
LirNameMap(avmplus::GC *gc, LabelMap *r)
: lircounts(gc),
funccounts(gc),
names(gc),
_functions(_functions),
labels(r)
{}
~LirNameMap();
@ -708,7 +706,6 @@ namespace nanojit
class LirBufWriter : public LirWriter
{
DWB(LirBuffer*) _buf; // underlying buffer housing the instructions
LInsp spref, rpref;
public:
LirBufWriter(LirBuffer* buf)

View File

@ -64,12 +64,6 @@ namespace nanojit
free |= rmask(r);
}
void RegAlloc::removeFree(Register r)
{
NanoAssert(isFree(r));
free &= ~rmask(r);
}
void RegAlloc::addActive(Register r, LIns* v)
{
// Count++;

View File

@ -55,7 +55,6 @@ namespace nanojit
void clear();
bool isFree(Register r);
void addFree(Register r);
void removeFree(Register r);
void addActive(Register r, LIns* ins);
void useActive(Register r);
void removeActive(Register r);