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/cpu/profile.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/cpu/profile.hh')
-rw-r--r-- | src/cpu/profile.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cpu/profile.hh b/src/cpu/profile.hh index 8fb0e3a8e..9d683959c 100644 --- a/src/cpu/profile.hh +++ b/src/cpu/profile.hh @@ -73,7 +73,7 @@ class FunctionProfile FunctionProfile(const SymbolTable *symtab); ~FunctionProfile(); - ProfileNode *consume(ThreadContext *tc, StaticInstPtr inst); + ProfileNode *consume(ThreadContext *tc, const StaticInstPtr &inst); ProfileNode *consume(const std::vector<Addr> &stack); void clear(); void dump(ThreadContext *tc, std::ostream &out) const; @@ -81,7 +81,7 @@ class FunctionProfile }; inline ProfileNode * -FunctionProfile::consume(ThreadContext *tc, StaticInstPtr inst) +FunctionProfile::consume(ThreadContext *tc, const StaticInstPtr &inst) { if (!trace.trace(tc, inst)) return NULL; |