summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter/interpreter_switch_impl.cc
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2013-09-30 16:42:32 +0200
committerSebastien Hertz <shertz@google.com>2013-09-30 18:17:05 +0200
commitc67148594b1580c278ae71e3ce5c6fd59bfa6bd3 (patch)
tree4413606a3c8d0d8426c891574047c9256a43abda /runtime/interpreter/interpreter_switch_impl.cc
parenta95be97148b2b2c5095cf80edbebaa771202290e (diff)
downloadart-c67148594b1580c278ae71e3ce5c6fd59bfa6bd3.zip
art-c67148594b1580c278ae71e3ce5c6fd59bfa6bd3.tar.gz
art-c67148594b1580c278ae71e3ce5c6fd59bfa6bd3.tar.bz2
Enable thread analysis on template functions.
All template functions using thread analysis must be explicitly instantiated with the thread analysis attributes to enable thread analysis. We use macros to do this since there are many variants of a same function depending the number of template arguments. Also add documentation of these functions. Change-Id: I3c79acc2f0a6a8dfb5c42924439145292dd68812
Diffstat (limited to 'runtime/interpreter/interpreter_switch_impl.cc')
-rw-r--r--runtime/interpreter/interpreter_switch_impl.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc
index 82f216a..dcc86e8 100644
--- a/runtime/interpreter/interpreter_switch_impl.cc
+++ b/runtime/interpreter/interpreter_switch_impl.cc
@@ -51,7 +51,7 @@ namespace interpreter {
#define PREAMBLE()
template<bool do_access_check>
-static JValue ExecuteSwitchImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item,
+JValue ExecuteSwitchImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item,
ShadowFrame& shadow_frame, JValue result_register) {
bool do_assignability_check = do_access_check;
if (UNLIKELY(!shadow_frame.HasReferenceArray())) {
@@ -2134,12 +2134,14 @@ static JValue ExecuteSwitchImpl(Thread* self, MethodHelper& mh, const DexFile::C
} // NOLINT(readability/fn_size)
// Explicit definitions of ExecuteSwitchImpl.
-template JValue ExecuteSwitchImpl<true>(Thread* self, MethodHelper& mh,
- const DexFile::CodeItem* code_item,
- ShadowFrame& shadow_frame, JValue result_register);
-template JValue ExecuteSwitchImpl<false>(Thread* self, MethodHelper& mh,
- const DexFile::CodeItem* code_item,
- ShadowFrame& shadow_frame, JValue result_register);
+template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) HOT_ATTR
+JValue ExecuteSwitchImpl<true>(Thread* self, MethodHelper& mh,
+ const DexFile::CodeItem* code_item,
+ ShadowFrame& shadow_frame, JValue result_register);
+template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) HOT_ATTR
+JValue ExecuteSwitchImpl<false>(Thread* self, MethodHelper& mh,
+ const DexFile::CodeItem* code_item,
+ ShadowFrame& shadow_frame, JValue result_register);
} // namespace interpreter
} // namespace art