Backed out changeset 83f39b3e8b10

This commit is contained in:
Graydon Hoare 2009-07-30 14:23:35 -07:00
parent ab3322269b
commit 73e4acbed0
5 changed files with 19 additions and 18 deletions

View File

@ -645,8 +645,8 @@ PCHash(jsbytecode* pc)
Oracle::Oracle()
{
/* Grow the oracle bitsets to their (fixed) size here, once. */
_stackDontDemote.set(ORACLE_SIZE-1);
_globalDontDemote.set(ORACLE_SIZE-1);
_stackDontDemote.set(&gc, ORACLE_SIZE-1);
_globalDontDemote.set(&gc, ORACLE_SIZE-1);
clear();
}
@ -654,7 +654,7 @@ Oracle::Oracle()
JS_REQUIRES_STACK void
Oracle::markGlobalSlotUndemotable(JSContext* cx, unsigned slot)
{
_globalDontDemote.set(GlobalSlotHash(cx, slot));
_globalDontDemote.set(&gc, GlobalSlotHash(cx, slot));
}
/* Consult with the oracle whether we shouldn't demote a certain global variable. */
@ -668,7 +668,7 @@ Oracle::isGlobalSlotUndemotable(JSContext* cx, unsigned slot) const
JS_REQUIRES_STACK void
Oracle::markStackSlotUndemotable(JSContext* cx, unsigned slot)
{
_stackDontDemote.set(StackSlotHash(cx, slot));
_stackDontDemote.set(&gc, StackSlotHash(cx, slot));
}
/* Consult with the oracle whether we shouldn't demote a certain slot. */
@ -682,7 +682,7 @@ Oracle::isStackSlotUndemotable(JSContext* cx, unsigned slot) const
void
Oracle::markInstructionUndemotable(jsbytecode* pc)
{
_pcDontDemote.set(PCHash(pc));
_pcDontDemote.set(&gc, PCHash(pc));
}
/* Consult with the oracle whether we shouldn't demote a certain bytecode location. */

View File

@ -724,7 +724,7 @@ namespace nanojit
})
// STOREFILTER for sp
StackFilter storefilter1(prev, frag->lirbuf, frag->lirbuf->sp);
StackFilter storefilter1(prev, gc, frag->lirbuf, frag->lirbuf->sp);
prev = &storefilter1;
verbose_only( if (_logc->lcbits & LC_AfterSF_SP) {
@ -734,7 +734,7 @@ namespace nanojit
})
// STOREFILTER for rp
StackFilter storefilter2(prev, frag->lirbuf, frag->lirbuf->rp);
StackFilter storefilter2(prev, gc, frag->lirbuf, frag->lirbuf->rp);
prev = &storefilter2;
verbose_only( if (_logc->lcbits & LC_AfterSF_RP) {

View File

@ -1017,8 +1017,8 @@ namespace nanojit
using namespace avmplus;
StackFilter::StackFilter(LirFilter *in, LirBuffer *lirbuf, LInsp sp)
: LirFilter(in), lirbuf(lirbuf), sp(sp), top(0)
StackFilter::StackFilter(LirFilter *in, GC *gc, LirBuffer *lirbuf, LInsp sp)
: LirFilter(in), gc(gc), lirbuf(lirbuf), sp(sp), top(0)
{}
LInsp StackFilter::read()
@ -1042,8 +1042,8 @@ namespace nanojit
if (stk.get(d) && stk.get(d-1)) {
continue;
} else {
stk.set(d);
stk.set(d-1);
stk.set(gc, d);
stk.set(gc, d-1);
}
}
else {
@ -1051,7 +1051,7 @@ namespace nanojit
if (stk.get(d))
continue;
else
stk.set(d);
stk.set(gc, d);
}
}
}
@ -1520,8 +1520,8 @@ namespace nanojit
LiveTable live(gc);
uint32_t exits = 0;
LirReader br(frag->lastIns);
StackFilter sf(&br, frag->lirbuf, frag->lirbuf->sp);
StackFilter r(&sf, frag->lirbuf, frag->lirbuf->rp);
StackFilter sf(&br, gc, frag->lirbuf, frag->lirbuf->sp);
StackFilter r(&sf, gc, frag->lirbuf, frag->lirbuf->rp);
int total = 0;
if (frag->lirbuf->state)
live.add(frag->lirbuf->state, r.pos());

View File

@ -1192,13 +1192,14 @@ namespace nanojit
class StackFilter: public LirFilter
{
GC *gc;
LirBuffer *lirbuf;
LInsp sp;
avmplus::BitSet stk;
int top;
int getTop(LInsp br);
public:
StackFilter(LirFilter *in, LirBuffer *lirbuf, LInsp sp);
StackFilter(LirFilter *in, GC *gc, LirBuffer *lirbuf, LInsp sp);
virtual ~StackFilter() {}
LInsp read();
};

View File

@ -970,12 +970,12 @@ namespace avmplus {
bits.ar[i] = 0;
}
void set(int bitNbr)
void set(GC *gc, int bitNbr)
{
int index = bitNbr / kUnit;
int bit = bitNbr % kUnit;
if (index >= capacity)
grow(index+1);
grow(gc, index+1);
if (capacity > kDefaultCapacity)
bits.ptr[index] |= (1<<bit);
@ -1013,7 +1013,7 @@ namespace avmplus {
private:
// Grow the array until at least newCapacity big
void grow(int newCapacity)
void grow(GC *gc, int newCapacity)
{
// create vector that is 2x bigger than requested
newCapacity *= 2;