summaryrefslogtreecommitdiff
path: root/libdexfile/dex/dex_file.h
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2024-02-07 17:15:16 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2024-02-09 08:56:51 +0000
commit554d48465f31b0e073f2c53a09ed9851f8b3e692 (patch)
tree64b15c98af9470921939b36f6b02fc7e81e18af4 /libdexfile/dex/dex_file.h
parent158c3ff1fd1b7e283cfc568150e8249e639e6788 (diff)
Pass functors as rvalues when possible
On local compiles I saw that DeleteAllImpureWhich was the third most time consuming method, using pprofs sorting in bottom-up. By passing the functor it uses as rvalue, the method speeds up ~10% and it drops from the third most time consuming to the fourth. The other modified methods in the CL are not showing up in the pprof profile that I took, but changing them to use rvalues shouldn't affect them negatively. Test: Locally compile, take a trace, and observe time spent Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I6c363d5601fd4865f4e7881e64b883bd6bbedb69
Diffstat (limited to 'libdexfile/dex/dex_file.h')
-rw-r--r--libdexfile/dex/dex_file.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdexfile/dex/dex_file.h b/libdexfile/dex/dex_file.h
index a7d288120d..8bcf1d803a 100644
--- a/libdexfile/dex/dex_file.h
+++ b/libdexfile/dex/dex_file.h
@@ -787,8 +787,8 @@ class DexFile {
// Returns false if there is no debugging information or if it cannot be decoded.
template<typename DexDebugNewPosition, typename IndexToStringData>
static bool DecodeDebugPositionInfo(const uint8_t* stream,
- const IndexToStringData& index_to_string_data,
- const DexDebugNewPosition& position_functor);
+ IndexToStringData&& index_to_string_data,
+ DexDebugNewPosition&& position_functor);
const char* GetSourceFile(const dex::ClassDef& class_def) const {
if (!class_def.source_file_idx_.IsValid()) {
@@ -893,7 +893,7 @@ class DexFile {
template <typename Visitor>
static uint32_t DecodeDebugInfoParameterNames(const uint8_t** debug_info,
- const Visitor& visitor);
+ Visitor&& visitor);
static inline bool StringEquals(const DexFile* df1, dex::StringIndex sidx1,
const DexFile* df2, dex::StringIndex sidx2);