OSDN Git Service

Optimize get/set reflection performance
authorMathieu Chartier <mathieuc@google.com>
Fri, 26 Sep 2014 21:32:37 +0000 (14:32 -0700)
committerMathieu Chartier <mathieuc@google.com>
Sat, 27 Sep 2014 02:54:39 +0000 (19:54 -0700)
commit76433275dbe39e5ced1c223b006d1b900b1937f6
treea72c101defa86ceff8b633cf2eaa606c87f783eb
parent88adf36315237947d3a5d10b28fdf8b9da7794a4
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
13 files changed:
runtime/entrypoints/portable/portable_thread_entrypoints.cc
runtime/entrypoints/quick/callee_save_frame.h
runtime/entrypoints/quick/quick_jni_entrypoints.cc
runtime/mirror/art_field-inl.h
runtime/mirror/art_field.cc
runtime/mirror/art_field.h
runtime/native/java_lang_reflect_Field.cc
runtime/reflection-inl.h [new file with mode: 0644]
runtime/reflection.cc
runtime/reflection.h
runtime/thread-inl.h
runtime/utils.cc
runtime/utils_test.cc