cpu: Don't construct and then copy the decoder in SimpleThread.
authorGabe Black <gabeblack@google.com>
Wed, 19 Aug 2020 03:46:45 +0000 (20:46 -0700)
committerGabe Black <gabeblack@google.com>
Thu, 20 Aug 2020 01:08:25 +0000 (01:08 +0000)
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>
src/cpu/simple_thread.cc

index 1d2c0b83746dfbe91a841ce8f29d79066a6d0e8c..7ed2e827967ff523862a33812126faef61f3c7b0 100644 (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);