Bug 634711 - Use nanojit::BitSet instead of avmplus::BitSet. r=nnethercote.

This commit is contained in:
Paul Biggar 2011-05-25 22:47:49 -07:00
parent 0a71cf8b26
commit a860fb2d95
2 changed files with 22 additions and 12 deletions

View File

@ -1285,7 +1285,11 @@ PCHash(jsbytecode* pc)
return int(uintptr_t(pc) & ORACLE_MASK);
}
Oracle::Oracle()
Oracle::Oracle(VMAllocator* allocator)
: _stackDontDemote(*allocator),
_globalDontDemote(*allocator),
_pcDontDemote(*allocator),
_pcSlowZeroTest(*allocator)
{
/* Grow the oracle bitsets to their (fixed) size here, once. */
_stackDontDemote.set(ORACLE_SIZE-1);
@ -1364,10 +1368,10 @@ Oracle::isInstructionSlowZeroTest(jsbytecode* pc) const
void
Oracle::clearDemotability()
{
_stackDontDemote.reset();
_globalDontDemote.reset();
_pcDontDemote.reset();
_pcSlowZeroTest.reset();
_stackDontDemote.resetAndAlloc();
_globalDontDemote.resetAndAlloc();
_pcDontDemote.resetAndAlloc();
_pcSlowZeroTest.resetAndAlloc();
}
JS_REQUIRES_STACK void
@ -7639,8 +7643,10 @@ TraceMonitor::~TraceMonitor ()
#endif
Foreground::delete_(recordAttempts);
recordAttempts = NULL;
Foreground::delete_(loopProfiles);
Foreground::delete_(oracle);
loopProfiles = NULL;
PodArrayZero(vmfragments);
@ -7664,6 +7670,9 @@ TraceMonitor::~TraceMonitor ()
Foreground::delete_(cachedTempTypeMap);
cachedTempTypeMap = NULL;
Foreground::delete_(oracle);
oracle = NULL;
}
bool
@ -7681,7 +7690,6 @@ TraceMonitor::init(JSRuntime* rt)
CHECK_NEW(profAlloc, VMAllocator, (rt, (char*)NULL, 0));
CHECK_ALLOC(profTab, new (*profAlloc) FragStatsMap(*profAlloc));
#endif /* defined JS_JIT_SPEW */
CHECK_NEW(oracle, Oracle, ());
CHECK_NEW(recordAttempts, RecordAttemptMap, ());
if (!recordAttempts->init(PC_HASH_COUNT))
@ -7704,6 +7712,8 @@ TraceMonitor::init(JSRuntime* rt)
CHECK_NEW(cachedTempTypeMap, TypeMap, ((Allocator*)NULL, oracle));
verbose_only( branches = NULL; )
CHECK_NEW(oracle, Oracle, (dataAlloc));
if (!tracedScripts.init())
return false;

View File

@ -280,12 +280,12 @@ extern void FragProfiling_FragFinalizer(nanojit::Fragment* f, TraceMonitor*);
#define ORACLE_SIZE 4096
class Oracle {
avmplus::BitSet _stackDontDemote;
avmplus::BitSet _globalDontDemote;
avmplus::BitSet _pcDontDemote;
avmplus::BitSet _pcSlowZeroTest;
nanojit::BitSet _stackDontDemote;
nanojit::BitSet _globalDontDemote;
nanojit::BitSet _pcDontDemote;
nanojit::BitSet _pcSlowZeroTest;
public:
Oracle();
Oracle(VMAllocator* allocator);
JS_REQUIRES_STACK void markGlobalSlotUndemotable(JSContext* cx, unsigned slot);
JS_REQUIRES_STACK bool isGlobalSlotUndemotable(JSContext* cx, unsigned slot) const;