From 1a33faa2632f676a9d24a3d6ecfc050aec1aa4a1 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 18 May 2009 01:45:46 -0400 Subject: [PATCH] Bug 492301 - nanojit: remove some dead code. r=edwsmith --- js/src/jsregexp.cpp | 2 +- js/src/jstracer.cpp | 2 +- js/src/nanojit/Assembler.cpp | 5 ----- js/src/nanojit/Assembler.h | 4 ---- js/src/nanojit/Fragmento.cpp | 37 ------------------------------------ js/src/nanojit/Fragmento.h | 5 ----- js/src/nanojit/LIR.h | 5 +---- js/src/nanojit/RegAlloc.cpp | 6 ------ js/src/nanojit/RegAlloc.h | 1 - 9 files changed, 3 insertions(+), 64 deletions(-) diff --git a/js/src/jsregexp.cpp b/js/src/jsregexp.cpp index 28c29821633..8e37705a13e 100644 --- a/js/src/jsregexp.cpp +++ b/js/src/jsregexp.cpp @@ -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 diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index bd101f2bd68..0c944edbf7a 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -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; diff --git a/js/src/nanojit/Assembler.cpp b/js/src/nanojit/Assembler.cpp index 079ca26f414..a0f2449e67c 100644 --- a/js/src/nanojit/Assembler.cpp +++ b/js/src/nanojit/Assembler.cpp @@ -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]; diff --git a/js/src/nanojit/Assembler.h b/js/src/nanojit/Assembler.h index 5408f6ee121..58c8ae4eeea 100644 --- a/js/src/nanojit/Assembler.h +++ b/js/src/nanojit/Assembler.h @@ -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); diff --git a/js/src/nanojit/Fragmento.cpp b/js/src/nanojit/Fragmento.cpp index 32170cb6b46..b70f698913f 100644 --- a/js/src/nanojit/Fragmento.cpp +++ b/js/src/nanojit/Fragmento.cpp @@ -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++; diff --git a/js/src/nanojit/Fragmento.h b/js/src/nanojit/Fragmento.h index 695100ea53f..aab9d063e9f 100644 --- a/js/src/nanojit/Fragmento.h +++ b/js/src/nanojit/Fragmento.h @@ -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); diff --git a/js/src/nanojit/LIR.h b/js/src/nanojit/LIR.h index cdab4c675e8..35dc2697d18 100644 --- a/js/src/nanojit/LIR.h +++ b/js/src/nanojit/LIR.h @@ -499,16 +499,14 @@ namespace nanojit DRCWB(avmplus::String*) name; }; avmplus::SortedMap 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) diff --git a/js/src/nanojit/RegAlloc.cpp b/js/src/nanojit/RegAlloc.cpp index b5c20ddf222..dbc6bc0fa81 100644 --- a/js/src/nanojit/RegAlloc.cpp +++ b/js/src/nanojit/RegAlloc.cpp @@ -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++; diff --git a/js/src/nanojit/RegAlloc.h b/js/src/nanojit/RegAlloc.h index 61c76760f33..c7a9837bfd3 100644 --- a/js/src/nanojit/RegAlloc.h +++ b/js/src/nanojit/RegAlloc.h @@ -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);