Bug 477052 - Make some nanojit classes initialize their members. r=edwsmith,gal.

--HG--
extra : rebase_source : 2f2c77ab6f4d4e373466ef766f0532450af5d370
This commit is contained in:
Jason Orendorff 2009-02-11 18:40:54 -06:00
parent 1a2fc33b02
commit ca34fe130e
2 changed files with 59 additions and 7 deletions

View File

@ -58,11 +58,18 @@ namespace nanojit
* This is the main control center for creating and managing fragments.
*/
Fragmento::Fragmento(AvmCore* core, uint32_t cacheSizeLog2)
: _frags(core->GetGC()),
_freePages(core->GetGC(), 1024),
:
#ifdef NJ_VERBOSE
enterCounts(NULL),
mergeCounts(NULL),
labels(NULL),
#endif
_frags(core->GetGC()),
_freePages(core->GetGC(), 1024),
_allocList(core->GetGC()),
_max_pages(1 << (calcSaneCacheSize(cacheSizeLog2) - NJ_LOG2_PAGE_SIZE)),
_pagesGrowth(1)
_gcHeap(NULL),
_max_pages(1 << (calcSaneCacheSize(cacheSizeLog2) - NJ_LOG2_PAGE_SIZE)),
_pagesGrowth(1)
{
#ifdef _DEBUG
{
@ -95,6 +102,8 @@ namespace nanojit
_assm = NJ_NEW(gc, nanojit::Assembler)(this);
verbose_only( enterCounts = NJ_NEW(gc, BlockHist)(gc); )
verbose_only( mergeCounts = NJ_NEW(gc, BlockHist)(gc); )
memset(&_stats, 0, sizeof(_stats));
}
Fragmento::~Fragmento()
@ -516,9 +525,46 @@ namespace nanojit
//
// Fragment
//
Fragment::Fragment(const void* _ip) : ip(_ip)
Fragment::Fragment(const void* _ip)
:
#ifdef NJ_VERBOSE
_called(0),
_native(0),
_exitNative(0),
_lir(0),
_lirbytes(0),
_token(NULL),
traceTicks(0),
interpTicks(0),
eot_target(NULL),
sid(0),
compileNbr(0),
#endif
treeBranches(NULL),
branches(NULL),
nextbranch(NULL),
anchor(NULL),
root(NULL),
parent(NULL),
first(NULL),
peer(NULL),
lirbuf(NULL),
lastIns(NULL),
spawnedFrom(NULL),
kind(LoopTrace),
ip(_ip),
guardCount(0),
xjumpCount(0),
recordAttempts(0),
blacklistLevel(0),
fragEntry(NULL),
loopEntry(NULL),
vmprivate(NULL),
_code(NULL),
_links(NULL),
_hits(0),
_pages(NULL)
{
// Fragment is a gc object which is zero'd by the GC, no need to clear fields
}
Fragment::~Fragment()

View File

@ -88,7 +88,13 @@ namespace nanojit
// LCompressedBuffer
LirBuffer::LirBuffer(Fragmento* frago, const CallInfo* functions)
: _frago(frago), _functions(functions), abi(ABI_FASTCALL), _pages(frago->core()->GetGC())
: _frago(frago),
#ifdef NJ_VERBOSE
names(NULL),
#endif
_functions(functions), abi(ABI_FASTCALL),
state(NULL), param1(NULL), sp(NULL), rp(NULL),
_pages(frago->core()->GetGC())
{
rewind();
}