rename trace ilen to tlen
This commit is contained in:
parent
f227349fa6
commit
11b7f83a93
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: cpu.cc,v 1.302 2010-01-24 12:48:42 sshwarts Exp $
|
||||
// $Id: cpu.cc,v 1.303 2010-02-13 09:41:51 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001-2009 The Bochs Project
|
||||
@ -147,7 +147,7 @@ no_async_event:
|
||||
}
|
||||
|
||||
#if BX_SUPPORT_TRACE_CACHE
|
||||
bxInstruction_c *last = i + (entry->ilen);
|
||||
bxInstruction_c *last = i + (entry->tlen);
|
||||
|
||||
for(;;) {
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: icache.cc,v 1.30 2009-12-21 13:38:06 sshwarts Exp $
|
||||
// $Id: icache.cc,v 1.31 2010-02-13 09:41:51 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2007-2009 Stanislav Shwartsman
|
||||
@ -90,14 +90,14 @@ void BX_CPU_C::serveICacheMiss(bxICacheEntry_c *entry, Bit32u eipBiased, bx_phy_
|
||||
// First instruction is boundary fetch, leave the trace cache entry
|
||||
// invalid and do not cache the instruction.
|
||||
entry->writeStamp = ICacheWriteStampInvalid;
|
||||
entry->ilen = 1;
|
||||
entry->tlen = 1;
|
||||
boundaryFetch(fetchPtr, remainingInPage, i);
|
||||
return;
|
||||
}
|
||||
|
||||
// add instruction to the trace
|
||||
unsigned iLen = i->ilen();
|
||||
entry->ilen++;
|
||||
entry->tlen++;
|
||||
|
||||
// continue to the next instruction
|
||||
remainingInPage -= iLen;
|
||||
@ -110,7 +110,7 @@ void BX_CPU_C::serveICacheMiss(bxICacheEntry_c *entry, Bit32u eipBiased, bx_phy_
|
||||
if (mergeTraces(entry, i, pAddr)) break;
|
||||
}
|
||||
|
||||
BX_CPU_THIS_PTR iCache.commit_trace(entry->ilen);
|
||||
BX_CPU_THIS_PTR iCache.commit_trace(entry->tlen);
|
||||
}
|
||||
|
||||
bx_bool BX_CPU_C::mergeTraces(bxICacheEntry_c *entry, bxInstruction_c *i, bx_phy_address pAddr)
|
||||
@ -120,14 +120,14 @@ bx_bool BX_CPU_C::mergeTraces(bxICacheEntry_c *entry, bxInstruction_c *i, bx_phy
|
||||
if ((e->pAddr == pAddr) && (e->writeStamp == entry->writeStamp))
|
||||
{
|
||||
// determine max amount of instruction to take from another entry
|
||||
unsigned max_length = e->ilen;
|
||||
if (max_length + entry->ilen > BX_MAX_TRACE_LENGTH)
|
||||
max_length = BX_MAX_TRACE_LENGTH - entry->ilen;
|
||||
unsigned max_length = e->tlen;
|
||||
if (max_length + entry->tlen > BX_MAX_TRACE_LENGTH)
|
||||
max_length = BX_MAX_TRACE_LENGTH - entry->tlen;
|
||||
if(max_length == 0) return 0;
|
||||
|
||||
memcpy(i, e->i, sizeof(bxInstruction_c)*max_length);
|
||||
entry->ilen += max_length;
|
||||
BX_ASSERT(entry->ilen <= BX_MAX_TRACE_LENGTH);
|
||||
entry->tlen += max_length;
|
||||
BX_ASSERT(entry->tlen <= BX_MAX_TRACE_LENGTH);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: icache.h,v 1.50 2009-10-15 20:50:33 sshwarts Exp $
|
||||
// $Id: icache.h,v 1.51 2010-02-13 09:41:51 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2007-2009 Stanislav Shwartsman
|
||||
@ -117,7 +117,7 @@ struct bxICacheEntry_c
|
||||
Bit32u writeStamp; // Generation ID. Each write to a physical page
|
||||
// decrements this value
|
||||
#if BX_SUPPORT_TRACE_CACHE
|
||||
Bit32u ilen; // Trace length in instructions
|
||||
Bit32u tlen; // Trace length in instructions
|
||||
bxInstruction_c *i;
|
||||
#else
|
||||
// ... define as array of 1 to simplify merge with trace cache code
|
||||
@ -149,7 +149,7 @@ public:
|
||||
flushICacheEntries();
|
||||
}
|
||||
e->i = &mpool[mpindex];
|
||||
e->ilen = 0;
|
||||
e->tlen = 0;
|
||||
}
|
||||
|
||||
BX_CPP_INLINE void commit_trace(unsigned len) { mpindex += len; }
|
||||
|
Loading…
Reference in New Issue
Block a user