cpu: Don't construct and then copy the decoder in SimpleThread.

The SimpleThread constructor was constructing a temporary copy of the
decoder, and then copying it into it's local version. This copy is a
waste, and also requires there to be a copy operator for the Decoder.

Change-Id: I1123b4ec767e08ceb2f108b3a6b19ca18d7c677c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32900
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2020-08-18 20:46:45 -07:00
parent 65c8b246ba
commit 6add4fbc12

View File

@@ -72,7 +72,7 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
isa(dynamic_cast<TheISA::ISA *>(_isa)),
predicate(true), memAccPredicate(true),
comInstEventQueue("instruction-based event queue"),
system(_sys), itb(_itb), dtb(_dtb), decoder(TheISA::Decoder(isa))
system(_sys), itb(_itb), dtb(_dtb), decoder(isa)
{
assert(isa);
clearArchRegs();
@@ -84,7 +84,7 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
isa(dynamic_cast<TheISA::ISA *>(_isa)),
predicate(true), memAccPredicate(true),
comInstEventQueue("instruction-based event queue"),
system(_sys), itb(_itb), dtb(_dtb), decoder(TheISA::Decoder(isa))
system(_sys), itb(_itb), dtb(_dtb), decoder(isa)
{
assert(isa);