diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-09-26 14:32:37 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-09-26 19:54:39 -0700 |
commit | 76433275dbe39e5ced1c223b006d1b900b1937f6 (patch) | |
tree | a72c101defa86ceff8b633cf2eaa606c87f783eb /runtime/utils.cc | |
parent | 88adf36315237947d3a5d10b28fdf8b9da7794a4 (diff) | |
download | art-76433275dbe39e5ced1c223b006d1b900b1937f6.tar.gz art-76433275dbe39e5ced1c223b006d1b900b1937f6.tar.bz2 art-76433275dbe39e5ced1c223b006d1b900b1937f6.zip |
Optimize get/set reflection performance
Speedups mostly from reducing how often access checks are needed,
and adding more inlining, and adding templates.
Field_getInt from ~850ns -> 350ns.
Field_setInt from ~900ns -> 370ns.
Bug: 14063288
(cherry picked from commit ffc788cb7b5b9f53734d7bb8af2d5e45d885546b)
Change-Id: I2441581ff3478c6ae43b6aa49939ff3f07555ec8
Diffstat (limited to 'runtime/utils.cc')
-rw-r--r-- | runtime/utils.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/utils.cc b/runtime/utils.cc index 9157f6c9b..dbd22139e 100644 --- a/runtime/utils.cc +++ b/runtime/utils.cc @@ -315,10 +315,6 @@ std::string PrettyDescriptor(const char* descriptor) { return result; } -std::string PrettyDescriptor(Primitive::Type type) { - return PrettyDescriptor(Primitive::Descriptor(type)); -} - std::string PrettyField(mirror::ArtField* f, bool with_type) { if (f == NULL) { return "null"; @@ -1421,4 +1417,8 @@ void PushWord(std::vector<uint8_t>* buf, int data) { buf->push_back((data >> 24) & 0xff); } +std::string PrettyDescriptor(Primitive::Type type) { + return PrettyDescriptor(Primitive::Descriptor(type)); +} + } // namespace art |