Add a way to clear the oracle.

This commit is contained in:
Andreas Gal 2008-08-20 15:18:43 -07:00
parent 0954618ab1
commit 98f67af6d0
2 changed files with 8 additions and 0 deletions

View File

@ -268,6 +268,13 @@ Oracle::isStackSlotUndemotable(JSScript* script, jsbytecode* ip, unsigned slot)
return _dontDemote.get(hash); return _dontDemote.get(hash);
} }
/* Clear the oracle. */
void
Oracle::clear()
{
_dontDemote.reset();
}
static LIns* demote(LirWriter *out, LInsp i) static LIns* demote(LirWriter *out, LInsp i)
{ {
if (i->isCall()) if (i->isCall())

View File

@ -165,6 +165,7 @@ public:
bool isGlobalSlotUndemotable(JSScript* script, unsigned slot) const; bool isGlobalSlotUndemotable(JSScript* script, unsigned slot) const;
void markStackSlotUndemotable(JSScript* script, jsbytecode* ip, unsigned slot); void markStackSlotUndemotable(JSScript* script, jsbytecode* ip, unsigned slot);
bool isStackSlotUndemotable(JSScript* script, jsbytecode* ip, unsigned slot) const; bool isStackSlotUndemotable(JSScript* script, jsbytecode* ip, unsigned slot) const;
void clear();
}; };
typedef Queue<uint16> SlotList; typedef Queue<uint16> SlotList;