diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-27 09:08:36 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-27 09:08:36 -0400 |
commit | 341dbf266258dcbdb1e5e9f09c244b8ac271faaf (patch) | |
tree | f071f9a91adeb0c1eb0888ae751c3ee0196bd65d /src/arch/mips/faults.hh | |
parent | deb2200671d5b4856ca27d4286253db0d9e12a32 (diff) | |
download | gem5-341dbf266258dcbdb1e5e9f09c244b8ac271faaf.tar.xz |
arch: Use const StaticInstPtr references where possible
This patch optimises the passing of StaticInstPtr by avoiding copying
the reference-counting pointer. This avoids first incrementing and
then decrementing the reference-counting pointer.
Diffstat (limited to 'src/arch/mips/faults.hh')
-rw-r--r-- | src/arch/mips/faults.hh | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/arch/mips/faults.hh b/src/arch/mips/faults.hh index 98638ac9a..d843acc50 100644 --- a/src/arch/mips/faults.hh +++ b/src/arch/mips/faults.hh @@ -102,8 +102,8 @@ class MipsFaultBase : public FaultBase return base(tc) + offset(tc); } - void invoke(ThreadContext * tc, - StaticInstPtr inst = StaticInst::nullStaticInstPtr); + void invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr); }; template <typename T> @@ -134,23 +134,23 @@ class MachineCheckFault : public MipsFault<MachineCheckFault> class ResetFault : public MipsFault<ResetFault> { public: - void invoke(ThreadContext * tc, - StaticInstPtr inst = StaticInst::nullStaticInstPtr); + void invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr); }; class SoftResetFault : public MipsFault<SoftResetFault> { public: - void invoke(ThreadContext * tc, - StaticInstPtr inst = StaticInst::nullStaticInstPtr); + void invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr); }; class NonMaskableInterrupt : public MipsFault<NonMaskableInterrupt> { public: - void invoke(ThreadContext * tc, - StaticInstPtr inst = StaticInst::nullStaticInstPtr); + void invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr); }; class CoprocessorUnusableFault : public MipsFault<CoprocessorUnusableFault> @@ -162,8 +162,8 @@ class CoprocessorUnusableFault : public MipsFault<CoprocessorUnusableFault> {} void - invoke(ThreadContext * tc, - StaticInstPtr inst = StaticInst::nullStaticInstPtr) + invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr) { MipsFault<CoprocessorUnusableFault>::invoke(tc, inst); if (FullSystem) { @@ -197,8 +197,8 @@ class AddressFault : public MipsFault<T> {} void - invoke(ThreadContext * tc, - StaticInstPtr inst = StaticInst::nullStaticInstPtr) + invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr) { MipsFault<T>::invoke(tc, inst); if (FullSystem) @@ -250,8 +250,8 @@ class TlbFault : public AddressFault<T> } void - invoke(ThreadContext * tc, - StaticInstPtr inst = StaticInst::nullStaticInstPtr) + invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr) { if (FullSystem) { DPRINTF(MipsPRA, "Fault %s encountered.\n", this->name()); |