зеркало из https://github.com/mozilla/gecko-dev.git
Bug 492490 - nanojit: move Assembler::findVictim() from RegAlloc.cpp to Assembler.cpp
This commit is contained in:
Родитель
55f1ebda7d
Коммит
c6c72b27f7
|
@ -1795,6 +1795,28 @@ namespace nanojit
|
|||
debug_only(saved.used = 0); // marker that we are no longer in exit path
|
||||
}
|
||||
|
||||
// scan table for instruction with the lowest priority, meaning it is used
|
||||
// furthest in the future.
|
||||
LIns* Assembler::findVictim(RegAlloc ®s, RegisterMask allow)
|
||||
{
|
||||
NanoAssert(allow != 0);
|
||||
LIns *i, *a=0;
|
||||
int allow_pri = 0x7fffffff;
|
||||
for (Register r=FirstReg; r <= LastReg; r = nextreg(r))
|
||||
{
|
||||
if ((allow & rmask(r)) && (i = regs.getActive(r)) != 0)
|
||||
{
|
||||
int pri = canRemat(i) ? 0 : regs.getPriority(r);
|
||||
if (!a || pri < allow_pri) {
|
||||
a = i;
|
||||
allow_pri = pri;
|
||||
}
|
||||
}
|
||||
}
|
||||
NanoAssert(a != 0);
|
||||
return a;
|
||||
}
|
||||
|
||||
#ifdef NJ_VERBOSE
|
||||
char Assembler::outline[8192];
|
||||
char Assembler::outlineEOL[512];
|
||||
|
|
|
@ -96,28 +96,6 @@ namespace nanojit
|
|||
free |= rmask(r);
|
||||
}
|
||||
|
||||
// scan table for instruction with the lowest priority, meaning it is used
|
||||
// furthest in the future.
|
||||
LIns* Assembler::findVictim(RegAlloc ®s, RegisterMask allow)
|
||||
{
|
||||
NanoAssert(allow != 0);
|
||||
LIns *i, *a=0;
|
||||
int allow_pri = 0x7fffffff;
|
||||
for (Register r=FirstReg; r <= LastReg; r = nextreg(r))
|
||||
{
|
||||
if ((allow & rmask(r)) && (i = regs.getActive(r)) != 0)
|
||||
{
|
||||
int pri = canRemat(i) ? 0 : regs.getPriority(r);
|
||||
if (!a || pri < allow_pri) {
|
||||
a = i;
|
||||
allow_pri = pri;
|
||||
}
|
||||
}
|
||||
}
|
||||
NanoAssert(a != 0);
|
||||
return a;
|
||||
}
|
||||
|
||||
#ifdef NJ_VERBOSE
|
||||
/* static */ void RegAlloc::formatRegisters(RegAlloc& regs, char* s, Fragment *frag)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче