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/power | |
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/power')
-rw-r--r-- | src/arch/power/stacktrace.cc | 2 | ||||
-rw-r--r-- | src/arch/power/stacktrace.hh | 6 | ||||
-rw-r--r-- | src/arch/power/utility.hh | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/arch/power/stacktrace.cc b/src/arch/power/stacktrace.cc index 315cf0ae5..f241dfecb 100644 --- a/src/arch/power/stacktrace.cc +++ b/src/arch/power/stacktrace.cc @@ -69,7 +69,7 @@ StackTrace::StackTrace() panic("StackTrace constructor not implemented.\n"); } -StackTrace::StackTrace(ThreadContext *_tc, StaticInstPtr inst) +StackTrace::StackTrace(ThreadContext *_tc, const StaticInstPtr &inst) : tc(0), stack(64) { panic("StackTrace constructor not implemented.\n"); diff --git a/src/arch/power/stacktrace.hh b/src/arch/power/stacktrace.hh index 65badad24..aec91837c 100644 --- a/src/arch/power/stacktrace.hh +++ b/src/arch/power/stacktrace.hh @@ -73,7 +73,7 @@ class StackTrace public: StackTrace(); - StackTrace(ThreadContext *tc, StaticInstPtr inst); + StackTrace(ThreadContext *tc, const StaticInstPtr &inst); ~StackTrace(); void @@ -89,7 +89,7 @@ class StackTrace return tc != NULL; } - bool trace(ThreadContext *tc, StaticInstPtr inst); + bool trace(ThreadContext *tc, const StaticInstPtr &inst); public: const std::vector<Addr> & @@ -123,7 +123,7 @@ class StackTrace }; inline bool -StackTrace::trace(ThreadContext *tc, StaticInstPtr inst) +StackTrace::trace(ThreadContext *tc, const StaticInstPtr &inst) { if (!inst->isCall() && !inst->isReturn()) return false; diff --git a/src/arch/power/utility.hh b/src/arch/power/utility.hh index 907e451b9..1a13d1e40 100644 --- a/src/arch/power/utility.hh +++ b/src/arch/power/utility.hh @@ -73,7 +73,7 @@ copyMiscRegs(ThreadContext *src, ThreadContext *dest) void skipFunction(ThreadContext *tc); inline void -advancePC(PCState &pc, const StaticInstPtr inst) +advancePC(PCState &pc, const StaticInstPtr &inst) { pc.advance(); } |