MCPcopy Create free account
hub / github.com/devosoft/avida / ReadLabel

Method ReadLabel

avida-core/source/cpu/cHardwareCPU.cc:1484–1502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1482// instruction pointer is left on the last line of the label found.
1483
1484void cHardwareCPU::ReadLabel(int max_size)
1485{
1486 int count = 0;
1487 cHeadCPU * inst_ptr = &( getIP() );
1488
1489 GetLabel().Clear();
1490
1491 while (m_inst_set->IsNop(inst_ptr->GetNextInst()) &&
1492 (count < max_size)) {
1493 count++;
1494 inst_ptr->Advance();
1495 GetLabel().AddNop(m_inst_set->GetNopMod(inst_ptr->GetInst()));
1496
1497 // If this is the first line of the template, mark it executed.
1498 if (GetLabel().GetSize() <= m_world->GetConfig().MAX_LABEL_EXE_SIZE.Get()) {
1499 inst_ptr->SetFlagExecuted();
1500 }
1501 }
1502}
1503
1504
1505bool cHardwareCPU::ForkThread()

Callers

nothing calls this directly

Calls 11

GetNextInstMethod · 0.80
AddNopMethod · 0.80
GetConfigMethod · 0.80
ClearMethod · 0.45
IsNopMethod · 0.45
AdvanceMethod · 0.45
GetNopModMethod · 0.45
GetInstMethod · 0.45
GetSizeMethod · 0.45
GetMethod · 0.45
SetFlagExecutedMethod · 0.45

Tested by

no test coverage detected