summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter/interpreter_common.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_common.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_common.cc')
-rw-r--r--runtime/interpreter/interpreter_common.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index 6f87a8f..f0f10bb 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -316,11 +316,12 @@ static void UnstartedRuntimeInvoke(Thread* self, MethodHelper& mh,
}
// Explicit DoCall template function declarations.
-#define EXPLICIT_DO_CALL_TEMPLATE_DECL(_is_range, _do_assignability_check) \
-template bool DoCall<_is_range, _do_assignability_check>(ArtMethod* method, Object* receiver, \
- Thread* self, ShadowFrame& shadow_frame, \
- const Instruction* inst, \
- uint16_t inst_data, JValue* result)
+#define EXPLICIT_DO_CALL_TEMPLATE_DECL(_is_range, _do_assignability_check) \
+ template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) \
+ bool DoCall<_is_range, _do_assignability_check>(ArtMethod* method, Object* receiver, \
+ Thread* self, ShadowFrame& shadow_frame, \
+ const Instruction* inst, uint16_t inst_data, \
+ JValue* result)
EXPLICIT_DO_CALL_TEMPLATE_DECL(false, false);
EXPLICIT_DO_CALL_TEMPLATE_DECL(false, true);
EXPLICIT_DO_CALL_TEMPLATE_DECL(true, false);
@@ -329,7 +330,8 @@ EXPLICIT_DO_CALL_TEMPLATE_DECL(true, true);
// Explicit DoFilledNewArray template function declarations.
#define EXPLICIT_DO_FILLED_NEW_ARRAY_TEMPLATE_DECL(_is_range_, _check) \
- template bool DoFilledNewArray<_is_range_, _check>(const Instruction* inst, \
+ template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) \
+ bool DoFilledNewArray<_is_range_, _check>(const Instruction* inst, \
const ShadowFrame& shadow_frame, \
Thread* self, JValue* result)
EXPLICIT_DO_FILLED_NEW_ARRAY_TEMPLATE_DECL(false, false);