summaryrefslogtreecommitdiffstats
path: root/runtime/thread.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-03-13 11:33:37 -0700
committerMathieu Chartier <mathieuc@google.com>2015-03-13 16:38:25 -0700
commit12d625f87bcd6c4059a205bb39007a255f57f382 (patch)
treeb69f6f80f56977c176e0c441869d2f1de06ede70 /runtime/thread.h
parentb871a15f1f662c8efe10d41199180bd00b6decd1 (diff)
downloadart-12d625f87bcd6c4059a205bb39007a255f57f382.zip
art-12d625f87bcd6c4059a205bb39007a255f57f382.tar.gz
art-12d625f87bcd6c4059a205bb39007a255f57f382.tar.bz2
Change method verifiers to be thread local roots
Bug: 10921004 Change-Id: I3a1425d76cd380587ba67ef6d5ec1227564e55bf
Diffstat (limited to 'runtime/thread.h')
-rw-r--r--runtime/thread.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/runtime/thread.h b/runtime/thread.h
index 2e9ae3c..da7af83 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -62,6 +62,11 @@ namespace mirror {
class StackTraceElement;
class Throwable;
} // namespace mirror
+
+namespace verifier {
+class MethodVerifier;
+} // namespace verifier
+
class BaseMutex;
class ClassLinker;
class Closure;
@@ -875,6 +880,9 @@ class Thread {
return tls32_.suspended_at_suspend_check;
}
+ void SetVerifier(verifier::MethodVerifier* verifier);
+ void ClearVerifier(verifier::MethodVerifier* verifier);
+
private:
explicit Thread(bool daemon);
~Thread() LOCKS_EXCLUDED(Locks::mutator_lock_,
@@ -1055,10 +1063,8 @@ class Thread {
pthread_self(0), last_no_thread_suspension_cause(nullptr), thread_local_start(nullptr),
thread_local_pos(nullptr), thread_local_end(nullptr), thread_local_objects(0),
thread_local_alloc_stack_top(nullptr), thread_local_alloc_stack_end(nullptr),
- nested_signal_state(nullptr), flip_function(nullptr) {
- for (size_t i = 0; i < kLockLevelCount; ++i) {
- held_mutexes[i] = nullptr;
- }
+ nested_signal_state(nullptr), flip_function(nullptr), method_verifier(nullptr) {
+ std::fill(held_mutexes, held_mutexes + kLockLevelCount, nullptr);
}
// The biased card table, see CardTable for details.
@@ -1172,6 +1178,9 @@ class Thread {
// The function used for thread flip.
Closure* flip_function;
+
+ // Current method verifier, used for root marking.
+ verifier::MethodVerifier* method_verifier;
} tlsPtr_;
// Guards the 'interrupted_' and 'wait_monitor_' members.