don't use (*activeThreads).begin(), use activeThreads->blah().

Also don't call (*activeThreads).end() over and over.  Just
call activeThreads->end() once and save the result.
Make sure we always check that there are elements in the list
before we grab the first one.

--HG--
extra : convert_revision : d769d8ed52da99532d57a9bbc93e92ddf22b7e58
This commit is contained in:
Nathan Binkert
2006-12-20 22:20:11 -08:00
parent 4b3538b609
commit 9aecfb3e3b
10 changed files with 226 additions and 154 deletions

View File

@@ -424,10 +424,12 @@ template<class Impl>
bool
DefaultDecode<Impl>::skidsEmpty()
{
std::list<unsigned>::iterator threads = (*activeThreads).begin();
std::list<unsigned>::iterator threads = activeThreads->begin();
std::list<unsigned>::iterator end = activeThreads->end();
while (threads != (*activeThreads).end()) {
if (!skidBuffer[*threads++].empty())
while (threads != end) {
unsigned tid = *threads++;
if (!skidBuffer[tid].empty())
return false;
}
@@ -440,11 +442,10 @@ DefaultDecode<Impl>::updateStatus()
{
bool any_unblocking = false;
std::list<unsigned>::iterator threads = (*activeThreads).begin();
std::list<unsigned>::iterator threads = activeThreads->begin();
std::list<unsigned>::iterator end = activeThreads->end();
threads = (*activeThreads).begin();
while (threads != (*activeThreads).end()) {
while (threads != end) {
unsigned tid = *threads++;
if (decodeStatus[tid] == Unblocking) {
@@ -597,13 +598,14 @@ DefaultDecode<Impl>::tick()
toRenameIndex = 0;
std::list<unsigned>::iterator threads = (*activeThreads).begin();
std::list<unsigned>::iterator threads = activeThreads->begin();
std::list<unsigned>::iterator end = activeThreads->end();
sortInsts();
//Check stall and squash signals.
while (threads != (*activeThreads).end()) {
unsigned tid = *threads++;
while (threads != end) {
unsigned tid = *threads++;
DPRINTF(Decode,"Processing [tid:%i]\n",tid);
status_change = checkSignalsAndUpdate(tid) || status_change;