OSDN Git Service

ART: Add pointer-size template to some reflection functions
authorAndreas Gampe <agampe@google.com>
Mon, 25 Jul 2016 20:06:04 +0000 (13:06 -0700)
committerAndreas Gampe <agampe@google.com>
Mon, 25 Jul 2016 20:09:41 +0000 (13:09 -0700)
commite01e3644205c3644546889237c20185391a0092e
tree413fcf279b415a305605a601297e3856f13a2948
parentde4cf16f467b531373560ca6eb785f0f36606aae
ART: Add pointer-size template to some reflection functions

The unstarted runtime may run code for a different pointer size,
even when no transaction is active (e.g., during startup). To
retain performance when the runtime is up and executing under
normal conditions, add a template parameter and use sizeof(void*)
in places where it is adequate.

For maintainability, it is necessary to drop the default for
the transaction template parameter. Implicit conversions from
bool to size_t may lead to incorrect code and hard to diagnose
problems. So instead ensure that all callers must give all
template parameter values.

Test: m test-art-host
Change-Id: I3076883422c8553ede4de5642409c5684a5a9aa8
14 files changed:
runtime/dex_file.cc
runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
runtime/interpreter/unstarted_runtime.cc
runtime/jni_internal.cc
runtime/mirror/abstract_method.cc
runtime/mirror/abstract_method.h
runtime/mirror/class.cc
runtime/mirror/class.h
runtime/mirror/field-inl.h
runtime/mirror/field.h
runtime/mirror/method.cc
runtime/mirror/method.h
runtime/native/java_lang_Class.cc
runtime/proxy_test.cc