Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 2 | |
| 3 | #ifndef ART_SRC_THREAD_H_ |
| 4 | #define ART_SRC_THREAD_H_ |
| 5 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 6 | #include <pthread.h> |
Elliott Hughes | a095764 | 2011-09-02 14:27:33 -0700 | [diff] [blame] | 7 | |
| 8 | #include <iosfwd> |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 9 | #include <list> |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 10 | |
Brian Carlstrom | 1f87008 | 2011-08-23 16:02:11 -0700 | [diff] [blame] | 11 | #include "dex_file.h" |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 12 | #include "globals.h" |
Elliott Hughes | 69f5bc6 | 2011-08-24 09:26:14 -0700 | [diff] [blame] | 13 | #include "jni_internal.h" |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 14 | #include "logging.h" |
| 15 | #include "macros.h" |
Brian Carlstrom | b765be0 | 2011-08-17 23:54:10 -0700 | [diff] [blame] | 16 | #include "mem_map.h" |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 17 | #include "offsets.h" |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 18 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 19 | namespace art { |
| 20 | |
Elliott Hughes | 69f5bc6 | 2011-08-24 09:26:14 -0700 | [diff] [blame] | 21 | class Array; |
Elliott Hughes | 37f7a40 | 2011-08-22 18:56:01 -0700 | [diff] [blame] | 22 | class Class; |
Brian Carlstrom | 1f87008 | 2011-08-23 16:02:11 -0700 | [diff] [blame] | 23 | class ClassLinker; |
Elliott Hughes | edcc09c | 2011-08-21 18:47:05 -0700 | [diff] [blame] | 24 | class ClassLoader; |
Brian Carlstrom | a40f9bc | 2011-07-26 21:26:07 -0700 | [diff] [blame] | 25 | class Method; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 26 | class Object; |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 27 | class Runtime; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 28 | class Thread; |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 29 | class ThreadList; |
Elliott Hughes | e5b0dc8 | 2011-08-23 09:59:02 -0700 | [diff] [blame] | 30 | class Throwable; |
Shih-wei Liao | 55df06b | 2011-08-26 14:39:27 -0700 | [diff] [blame] | 31 | class StackTraceElement; |
| 32 | template<class T> class ObjectArray; |
Shih-wei Liao | 4417536 | 2011-08-28 16:59:17 -0700 | [diff] [blame] | 33 | template<class T> class PrimitiveArray; |
| 34 | typedef PrimitiveArray<int32_t> IntArray; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 35 | |
| 36 | class Mutex { |
| 37 | public: |
| 38 | virtual ~Mutex() {} |
| 39 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 40 | void Lock(); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 41 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 42 | bool TryLock(); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 43 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 44 | void Unlock(); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 45 | |
| 46 | const char* GetName() { return name_; } |
| 47 | |
| 48 | Thread* GetOwner() { return owner_; } |
| 49 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 50 | static Mutex* Create(const char* name); |
| 51 | |
Elliott Hughes | 79082e3 | 2011-08-25 12:07:32 -0700 | [diff] [blame] | 52 | // TODO: only needed because we lack a condition variable abstraction. |
| 53 | pthread_mutex_t* GetImpl() { return &lock_impl_; } |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 54 | |
| 55 | private: |
Elliott Hughes | 18c0753 | 2011-08-18 15:50:51 -0700 | [diff] [blame] | 56 | explicit Mutex(const char* name) : name_(name), owner_(NULL) {} |
| 57 | |
Elliott Hughes | 79082e3 | 2011-08-25 12:07:32 -0700 | [diff] [blame] | 58 | void SetOwner(Thread* thread) { owner_ = thread; } |
| 59 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 60 | const char* name_; |
| 61 | |
| 62 | Thread* owner_; |
| 63 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 64 | pthread_mutex_t lock_impl_; |
| 65 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 66 | DISALLOW_COPY_AND_ASSIGN(Mutex); |
| 67 | }; |
| 68 | |
| 69 | class MutexLock { |
| 70 | public: |
| 71 | explicit MutexLock(Mutex *mu) : mu_(mu) { |
| 72 | mu_->Lock(); |
| 73 | } |
| 74 | ~MutexLock() { mu_->Unlock(); } |
| 75 | private: |
| 76 | Mutex* const mu_; |
| 77 | DISALLOW_COPY_AND_ASSIGN(MutexLock); |
| 78 | }; |
| 79 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 80 | // Stack allocated indirect reference table, allocated within the bridge frame |
| 81 | // between managed and native code. |
| 82 | class StackIndirectReferenceTable { |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 83 | public: |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 84 | // Number of references contained within this SIRT |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 85 | size_t NumberOfReferences() { |
| 86 | return number_of_references_; |
| 87 | } |
| 88 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 89 | // Link to previous SIRT or NULL |
| 90 | StackIndirectReferenceTable* Link() { |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 91 | return link_; |
| 92 | } |
| 93 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 94 | Object** References() { |
| 95 | return references_; |
Ian Rogers | a8cd9f4 | 2011-08-19 16:43:41 -0700 | [diff] [blame] | 96 | } |
| 97 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 98 | // Offset of length within SIRT, used by generated code |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 99 | static size_t NumberOfReferencesOffset() { |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 100 | return OFFSETOF_MEMBER(StackIndirectReferenceTable, number_of_references_); |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 101 | } |
| 102 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 103 | // Offset of link within SIRT, used by generated code |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 104 | static size_t LinkOffset() { |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 105 | return OFFSETOF_MEMBER(StackIndirectReferenceTable, link_); |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | private: |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 109 | StackIndirectReferenceTable() {} |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 110 | |
| 111 | size_t number_of_references_; |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 112 | StackIndirectReferenceTable* link_; |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 113 | |
Ian Rogers | a8cd9f4 | 2011-08-19 16:43:41 -0700 | [diff] [blame] | 114 | // Fake array, really allocated and filled in by jni_compiler. |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 115 | Object* references_[0]; |
Ian Rogers | a8cd9f4 | 2011-08-19 16:43:41 -0700 | [diff] [blame] | 116 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 117 | DISALLOW_COPY_AND_ASSIGN(StackIndirectReferenceTable); |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 118 | }; |
| 119 | |
Ian Rogers | 6de0860 | 2011-08-19 14:52:39 -0700 | [diff] [blame] | 120 | struct NativeToManagedRecord { |
| 121 | NativeToManagedRecord* link; |
| 122 | void* last_top_of_managed_stack; |
| 123 | }; |
| 124 | |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 125 | // Iterator over managed frames up to the first native-to-managed transition |
| 126 | class Frame { |
Shih-wei Liao | 9b576b4 | 2011-08-29 01:45:07 -0700 | [diff] [blame] | 127 | public: |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 128 | Frame() : sp_(NULL) {} |
| 129 | |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 130 | Method* GetMethod() const { |
Elliott Hughes | a095764 | 2011-09-02 14:27:33 -0700 | [diff] [blame] | 131 | return (sp_ != NULL) ? *sp_ : NULL; |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | bool HasNext() const { |
| 135 | return NextMethod() != NULL; |
| 136 | } |
| 137 | |
| 138 | void Next(); |
| 139 | |
Shih-wei Liao | 55df06b | 2011-08-26 14:39:27 -0700 | [diff] [blame] | 140 | uintptr_t GetPC() const; |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 141 | |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 142 | Method** GetSP() const { |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 143 | return sp_; |
| 144 | } |
| 145 | |
| 146 | // TODO: this is here for testing, remove when we have exception unit tests |
| 147 | // that use the real stack |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 148 | void SetSP(Method** sp) { |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 149 | sp_ = sp; |
| 150 | } |
| 151 | |
| 152 | private: |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 153 | Method* NextMethod() const; |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 154 | |
| 155 | friend class Thread; |
| 156 | |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 157 | Method** sp_; |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 158 | }; |
| 159 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 160 | class Thread { |
| 161 | public: |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 162 | enum State { |
| 163 | kUnknown = -1, |
| 164 | kNew, |
| 165 | kRunnable, |
| 166 | kBlocked, |
| 167 | kWaiting, |
| 168 | kTimedWaiting, |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 169 | kNative, |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 170 | kTerminated, |
| 171 | }; |
| 172 | |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 173 | |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 174 | static const size_t kDefaultStackSize = 64 * KB; |
| 175 | |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 176 | // Runtime support function pointers |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 177 | void (*pDebugMe)(Method*, uint32_t); |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 178 | void* (*pMemcpy)(void*, const void*, size_t); |
buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 179 | uint64_t (*pShlLong)(uint64_t, uint32_t); |
| 180 | uint64_t (*pShrLong)(uint64_t, uint32_t); |
| 181 | uint64_t (*pUshrLong)(uint64_t, uint32_t); |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 182 | float (*pI2f)(int); |
| 183 | int (*pF2iz)(float); |
| 184 | float (*pD2f)(double); |
| 185 | double (*pF2d)(float); |
| 186 | double (*pI2d)(int); |
| 187 | int (*pD2iz)(double); |
| 188 | float (*pL2f)(long); |
| 189 | double (*pL2d)(long); |
buzbee | 1b4c859 | 2011-08-31 10:43:51 -0700 | [diff] [blame] | 190 | long long (*pF2l)(float); |
| 191 | long long (*pD2l)(double); |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 192 | float (*pFadd)(float, float); |
| 193 | float (*pFsub)(float, float); |
| 194 | float (*pFdiv)(float, float); |
| 195 | float (*pFmul)(float, float); |
| 196 | float (*pFmodf)(float, float); |
| 197 | double (*pDadd)(double, double); |
| 198 | double (*pDsub)(double, double); |
| 199 | double (*pDdiv)(double, double); |
| 200 | double (*pDmul)(double, double); |
| 201 | double (*pFmod)(double, double); |
| 202 | int (*pIdivmod)(int, int); |
| 203 | int (*pIdiv)(int, int); |
buzbee | 439c4fa | 2011-08-27 15:59:07 -0700 | [diff] [blame] | 204 | long long (*pLmul)(long long, long long); |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 205 | long long (*pLdivmod)(long long, long long); |
buzbee | dfd3d70 | 2011-08-28 12:56:51 -0700 | [diff] [blame] | 206 | Array* (*pAllocFromCode)(uint32_t, Method*, int32_t); |
Brian Carlstrom | 1f87008 | 2011-08-23 16:02:11 -0700 | [diff] [blame] | 207 | Object* (*pAllocObjectFromCode)(uint32_t, Method*); |
buzbee | e193174 | 2011-08-28 21:15:53 -0700 | [diff] [blame] | 208 | uint32_t (*pGet32Static)(uint32_t, const Method*); |
| 209 | void (*pSet32Static)(uint32_t, const Method*, uint32_t); |
| 210 | uint64_t (*pGet64Static)(uint32_t, const Method*); |
| 211 | void (*pSet64Static)(uint32_t, const Method*, uint64_t); |
| 212 | Object* (*pGetObjStatic)(uint32_t, const Method*); |
| 213 | void (*pSetObjStatic)(uint32_t, const Method*, Object*); |
buzbee | 1b4c859 | 2011-08-31 10:43:51 -0700 | [diff] [blame] | 214 | bool (*pCanPutArrayElementFromCode)(const Class*, const Class*); |
| 215 | int (*pInstanceofNonTrivialFromCode) (const Class*, const Class*); |
| 216 | Method* (*pFindInterfaceMethodInCache)(Class*, uint32_t, const Method*, struct DvmDex*); |
| 217 | bool (*pUnlockObjectFromCode)(Thread*, Object*); |
| 218 | void (*pLockObjectFromCode)(Thread*, Object*); |
| 219 | void (*pThrowException)(Thread*, Throwable*); |
| 220 | void (*pHandleFillArrayDataFromCode)(Array*, const uint16_t*); |
| 221 | Class* (*pInitializeTypeFromCode)(uint32_t, Method*); |
buzbee | 561227c | 2011-09-02 15:28:19 -0700 | [diff] [blame] | 222 | void (*pResolveMethodFromCode)(Method*, uint32_t); |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 223 | void (*pInvokeInterfaceTrampoline)(void*, void*, void*, void*); |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 224 | |
Shih-wei Liao | 9b576b4 | 2011-08-29 01:45:07 -0700 | [diff] [blame] | 225 | class StackVisitor { |
| 226 | public: |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 227 | virtual ~StackVisitor() {} |
Shih-wei Liao | 9b576b4 | 2011-08-29 01:45:07 -0700 | [diff] [blame] | 228 | virtual bool VisitFrame(const Frame& frame) = 0; |
| 229 | }; |
| 230 | |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 231 | // Creates a new thread. |
Brian Carlstrom | b765be0 | 2011-08-17 23:54:10 -0700 | [diff] [blame] | 232 | static Thread* Create(const Runtime* runtime); |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 233 | |
| 234 | // Creates a new thread from the calling thread. |
Elliott Hughes | 515a5bc | 2011-08-17 11:08:34 -0700 | [diff] [blame] | 235 | static Thread* Attach(const Runtime* runtime); |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 236 | |
| 237 | static Thread* Current() { |
Carl Shapiro | d0e7e77 | 2011-07-15 14:31:01 -0700 | [diff] [blame] | 238 | void* thread = pthread_getspecific(Thread::pthread_key_self_); |
| 239 | return reinterpret_cast<Thread*>(thread); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 240 | } |
| 241 | |
Elliott Hughes | a095764 | 2011-09-02 14:27:33 -0700 | [diff] [blame] | 242 | void Dump(std::ostream& os) const; |
| 243 | |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 244 | State GetState() const { |
| 245 | return state_; |
| 246 | } |
| 247 | |
| 248 | State SetState(State new_state) { |
| 249 | State old_state = state_; |
| 250 | state_ = new_state; |
| 251 | return old_state; |
| 252 | } |
| 253 | |
| 254 | bool CanAccessDirectReferences() const { |
| 255 | return state_ == kRunnable; |
| 256 | } |
| 257 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 258 | uint32_t GetId() const { |
| 259 | return id_; |
| 260 | } |
| 261 | |
Elliott Hughes | d92bec4 | 2011-09-02 17:04:36 -0700 | [diff] [blame] | 262 | pid_t GetTid() const { |
| 263 | return tid_; |
| 264 | } |
Elliott Hughes | e27955c | 2011-08-26 15:21:24 -0700 | [diff] [blame] | 265 | |
| 266 | pthread_t GetImpl() const { |
| 267 | return handle_; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 268 | } |
| 269 | |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 270 | // Returns the Method* for the current method. |
| 271 | // This is used by the JNI implementation for logging and diagnostic purposes. |
| 272 | const Method* GetCurrentMethod() const { |
| 273 | return top_of_managed_stack_.GetMethod(); |
| 274 | } |
| 275 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 276 | bool IsExceptionPending() const { |
Elliott Hughes | b20a554 | 2011-08-12 18:03:12 -0700 | [diff] [blame] | 277 | return exception_ != NULL; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 278 | } |
| 279 | |
Elliott Hughes | e5b0dc8 | 2011-08-23 09:59:02 -0700 | [diff] [blame] | 280 | Throwable* GetException() const { |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 281 | DCHECK(CanAccessDirectReferences()); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 282 | return exception_; |
| 283 | } |
| 284 | |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 285 | void SetException(Throwable* new_exception) { |
| 286 | DCHECK(CanAccessDirectReferences()); |
| 287 | CHECK(new_exception != NULL); |
| 288 | // TODO: CHECK(exception_ == NULL); |
| 289 | exception_ = new_exception; // TODO |
| 290 | } |
| 291 | |
| 292 | void ClearException() { |
| 293 | exception_ = NULL; |
Elliott Hughes | a095764 | 2011-09-02 14:27:33 -0700 | [diff] [blame] | 294 | } |
| 295 | |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 296 | Frame GetTopOfStack() const { |
| 297 | return top_of_managed_stack_; |
| 298 | } |
| 299 | |
| 300 | // TODO: this is here for testing, remove when we have exception unit tests |
| 301 | // that use the real stack |
| 302 | void SetTopOfStack(void* stack) { |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 303 | top_of_managed_stack_.SetSP(reinterpret_cast<Method**>(stack)); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 304 | } |
| 305 | |
Elliott Hughes | e5b0dc8 | 2011-08-23 09:59:02 -0700 | [diff] [blame] | 306 | void ThrowNewException(const char* exception_class_descriptor, const char* fmt, ...) |
Elliott Hughes | a5b897e | 2011-08-16 11:33:06 -0700 | [diff] [blame] | 307 | __attribute__ ((format(printf, 3, 4))); |
| 308 | |
Elliott Hughes | 79082e3 | 2011-08-25 12:07:32 -0700 | [diff] [blame] | 309 | // This exception is special, because we need to pre-allocate an instance. |
| 310 | void ThrowOutOfMemoryError(); |
| 311 | |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 312 | Frame FindExceptionHandler(void* throw_pc, void** handler_pc); |
| 313 | |
| 314 | void* FindExceptionHandlerInMethod(const Method* method, |
| 315 | void* throw_pc, |
| 316 | const DexFile& dex_file, |
| 317 | ClassLinker* class_linker); |
Shih-wei Liao | 668512a | 2011-09-01 14:18:34 -0700 | [diff] [blame] | 318 | static ThreadOffset SelfOffset() { |
| 319 | return ThreadOffset(OFFSETOF_MEMBER(Thread, self_)); |
| 320 | } |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 321 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 322 | // Offset of exception within Thread, used by generated code |
| 323 | static ThreadOffset ExceptionOffset() { |
| 324 | return ThreadOffset(OFFSETOF_MEMBER(Thread, exception_)); |
| 325 | } |
| 326 | |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 327 | // Offset of id within Thread, used by generated code |
| 328 | static ThreadOffset IdOffset() { |
| 329 | return ThreadOffset(OFFSETOF_MEMBER(Thread, id_)); |
| 330 | } |
| 331 | |
| 332 | // Offset of card_table within Thread, used by generated code |
| 333 | static ThreadOffset CardTableOffset() { |
| 334 | return ThreadOffset(OFFSETOF_MEMBER(Thread, card_table_)); |
| 335 | } |
| 336 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 337 | void SetName(const char* name); |
| 338 | |
| 339 | void Suspend(); |
| 340 | |
| 341 | bool IsSuspended(); |
| 342 | |
| 343 | void Resume(); |
| 344 | |
Elliott Hughes | c1674ed | 2011-08-25 18:09:09 -0700 | [diff] [blame] | 345 | static bool Startup(); |
| 346 | static void Shutdown(); |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 347 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 348 | static ThreadOffset SuspendCountOffset() { |
| 349 | return ThreadOffset(OFFSETOF_MEMBER(Thread, suspend_count_)); |
| 350 | } |
| 351 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 352 | // Offset of state within Thread, used by generated code |
| 353 | static ThreadOffset StateOffset() { |
| 354 | return ThreadOffset(OFFSETOF_MEMBER(Thread, state_)); |
| 355 | } |
| 356 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 357 | // JNI methods |
Elliott Hughes | 69f5bc6 | 2011-08-24 09:26:14 -0700 | [diff] [blame] | 358 | JNIEnvExt* GetJniEnv() const { |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 359 | return jni_env_; |
| 360 | } |
| 361 | |
| 362 | // Offset of JNI environment within Thread, used by generated code |
| 363 | static ThreadOffset JniEnvOffset() { |
| 364 | return ThreadOffset(OFFSETOF_MEMBER(Thread, jni_env_)); |
| 365 | } |
| 366 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 367 | // Offset of top of managed stack address, used by generated code |
| 368 | static ThreadOffset TopOfManagedStackOffset() { |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 369 | return ThreadOffset(OFFSETOF_MEMBER(Thread, top_of_managed_stack_) + |
| 370 | OFFSETOF_MEMBER(Frame, sp_)); |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 371 | } |
| 372 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 373 | // Offset of top stack indirect reference table within Thread, used by |
| 374 | // generated code |
| 375 | static ThreadOffset TopSirtOffset() { |
| 376 | return ThreadOffset(OFFSETOF_MEMBER(Thread, top_sirt_)); |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 377 | } |
| 378 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 379 | // Number of references allocated in SIRTs on this thread |
| 380 | size_t NumSirtReferences(); |
Ian Rogers | a8cd9f4 | 2011-08-19 16:43:41 -0700 | [diff] [blame] | 381 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 382 | // Is the given obj in this thread's stack indirect reference table? |
| 383 | bool SirtContains(jobject obj); |
| 384 | |
| 385 | // Convert a jobject into a Object* |
| 386 | Object* DecodeJObject(jobject obj); |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 387 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 388 | // Offset of exception_entry_point_ within Thread, used by generated code |
| 389 | static ThreadOffset ExceptionEntryPointOffset() { |
| 390 | return ThreadOffset(OFFSETOF_MEMBER(Thread, exception_entry_point_)); |
| 391 | } |
| 392 | |
| 393 | void RegisterExceptionEntryPoint(void (*handler)(Method**)) { |
| 394 | exception_entry_point_ = handler; |
| 395 | } |
| 396 | |
| 397 | // Offset of suspend_count_entry_point_ within Thread, used by generated code |
| 398 | static ThreadOffset SuspendCountEntryPointOffset() { |
| 399 | return ThreadOffset(OFFSETOF_MEMBER(Thread, suspend_count_entry_point_)); |
| 400 | } |
| 401 | |
| 402 | void RegisterSuspendCountEntryPoint(void (*handler)(Method**)) { |
| 403 | suspend_count_entry_point_ = handler; |
| 404 | } |
| 405 | |
| 406 | // Increasing the suspend count, will cause the thread to run to safepoint |
| 407 | void IncrementSuspendCount() { suspend_count_++; } |
| 408 | void DecrementSuspendCount() { suspend_count_--; } |
| 409 | |
Ian Rogers | 6de0860 | 2011-08-19 14:52:39 -0700 | [diff] [blame] | 410 | // Linked list recording transitions from native to managed code |
| 411 | void PushNativeToManagedRecord(NativeToManagedRecord* record) { |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 412 | record->last_top_of_managed_stack = reinterpret_cast<void*>(top_of_managed_stack_.GetSP()); |
Ian Rogers | 6de0860 | 2011-08-19 14:52:39 -0700 | [diff] [blame] | 413 | record->link = native_to_managed_record_; |
| 414 | native_to_managed_record_ = record; |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 415 | top_of_managed_stack_.SetSP(NULL); |
Ian Rogers | 6de0860 | 2011-08-19 14:52:39 -0700 | [diff] [blame] | 416 | } |
| 417 | void PopNativeToManagedRecord(const NativeToManagedRecord& record) { |
| 418 | native_to_managed_record_ = record.link; |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 419 | top_of_managed_stack_.SetSP(reinterpret_cast<Method**>(record.last_top_of_managed_stack)); |
Ian Rogers | 6de0860 | 2011-08-19 14:52:39 -0700 | [diff] [blame] | 420 | } |
| 421 | |
Brian Carlstrom | bffb155 | 2011-08-25 12:23:53 -0700 | [diff] [blame] | 422 | const ClassLoader* GetClassLoaderOverride() { |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 423 | // TODO: need to place the class_loader_override_ in a handle |
| 424 | // DCHECK(CanAccessDirectReferences()); |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 425 | return class_loader_override_; |
| 426 | } |
| 427 | |
Brian Carlstrom | bffb155 | 2011-08-25 12:23:53 -0700 | [diff] [blame] | 428 | void SetClassLoaderOverride(const ClassLoader* class_loader_override) { |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 429 | class_loader_override_ = class_loader_override; |
| 430 | } |
| 431 | |
Shih-wei Liao | 4417536 | 2011-08-28 16:59:17 -0700 | [diff] [blame] | 432 | // Allocate stack trace |
Shih-wei Liao | 9b576b4 | 2011-08-29 01:45:07 -0700 | [diff] [blame] | 433 | ObjectArray<StackTraceElement>* AllocStackTrace(); |
Shih-wei Liao | 55df06b | 2011-08-26 14:39:27 -0700 | [diff] [blame] | 434 | |
Elliott Hughes | 410c0c8 | 2011-09-01 17:58:25 -0700 | [diff] [blame] | 435 | void VisitRoots(Heap::RootVisitor* visitor, void* arg) const; |
| 436 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 437 | private: |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 438 | Thread() |
Elliott Hughes | 330304d | 2011-08-12 14:28:05 -0700 | [diff] [blame] | 439 | : id_(1234), |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 440 | top_of_managed_stack_(), |
Ian Rogers | 6de0860 | 2011-08-19 14:52:39 -0700 | [diff] [blame] | 441 | native_to_managed_record_(NULL), |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 442 | top_sirt_(NULL), |
Elliott Hughes | 330304d | 2011-08-12 14:28:05 -0700 | [diff] [blame] | 443 | jni_env_(NULL), |
| 444 | exception_(NULL), |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 445 | suspend_count_(0), |
| 446 | class_loader_override_(NULL) { |
buzbee | 3ea4ec5 | 2011-08-22 17:37:19 -0700 | [diff] [blame] | 447 | InitFunctionPointers(); |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 448 | } |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 449 | |
Elliott Hughes | c1674ed | 2011-08-25 18:09:09 -0700 | [diff] [blame] | 450 | ~Thread(); |
Ian Rogers | 0cfe1fb | 2011-08-26 03:29:44 -0700 | [diff] [blame] | 451 | friend class Runtime; // For ~Thread. |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 452 | |
Elliott Hughes | d92bec4 | 2011-09-02 17:04:36 -0700 | [diff] [blame] | 453 | void DumpState(std::ostream& os) const; |
| 454 | void DumpStack(std::ostream& os) const; |
| 455 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 456 | void InitCpu(); |
buzbee | 3ea4ec5 | 2011-08-22 17:37:19 -0700 | [diff] [blame] | 457 | void InitFunctionPointers(); |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 458 | |
Shih-wei Liao | 9b576b4 | 2011-08-29 01:45:07 -0700 | [diff] [blame] | 459 | void WalkStack(StackVisitor* visitor); |
Shih-wei Liao | 4417536 | 2011-08-28 16:59:17 -0700 | [diff] [blame] | 460 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 461 | // Managed thread id. |
| 462 | uint32_t id_; |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 463 | |
Elliott Hughes | d92bec4 | 2011-09-02 17:04:36 -0700 | [diff] [blame] | 464 | // System thread id. |
| 465 | pid_t tid_; |
| 466 | |
| 467 | // Native thread handle. |
| 468 | pthread_t handle_; |
| 469 | |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 470 | // FIXME: placeholder for the gc cardTable |
| 471 | uint32_t card_table_; |
| 472 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 473 | // Top of the managed stack, written out prior to the state transition from |
| 474 | // kRunnable to kNative. Uses include to give the starting point for scanning |
| 475 | // a managed stack when a thread is in native code. |
Shih-wei Liao | 1a18c8c | 2011-08-14 17:47:36 -0700 | [diff] [blame] | 476 | Frame top_of_managed_stack_; |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 477 | |
Ian Rogers | 6de0860 | 2011-08-19 14:52:39 -0700 | [diff] [blame] | 478 | // A linked list (of stack allocated records) recording transitions from |
| 479 | // native to managed code. |
| 480 | NativeToManagedRecord* native_to_managed_record_; |
| 481 | |
Ian Rogers | 408f79a | 2011-08-23 18:22:33 -0700 | [diff] [blame] | 482 | // Top of linked list of stack indirect reference tables or NULL for none |
| 483 | StackIndirectReferenceTable* top_sirt_; |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 484 | |
| 485 | // Every thread may have an associated JNI environment |
Elliott Hughes | 69f5bc6 | 2011-08-24 09:26:14 -0700 | [diff] [blame] | 486 | JNIEnvExt* jni_env_; |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 487 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 488 | State state_; |
| 489 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 490 | // Initialized to "this". On certain architectures (such as x86) reading |
| 491 | // off of Thread::Current is easy but getting the address of Thread::Current |
| 492 | // is hard. This field can be read off of Thread::Current to give the address. |
| 493 | Thread* self_; |
| 494 | |
| 495 | Runtime* runtime_; |
| 496 | |
| 497 | // The pending exception or NULL. |
Elliott Hughes | e5b0dc8 | 2011-08-23 09:59:02 -0700 | [diff] [blame] | 498 | Throwable* exception_; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 499 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 500 | // A non-zero value is used to tell the current thread to enter a safe point |
| 501 | // at the next poll. |
| 502 | int suspend_count_; |
| 503 | |
Elliott Hughes | edcc09c | 2011-08-21 18:47:05 -0700 | [diff] [blame] | 504 | // Needed to get the right ClassLoader in JNI_OnLoad, but also |
| 505 | // useful for testing. |
Brian Carlstrom | bffb155 | 2011-08-25 12:23:53 -0700 | [diff] [blame] | 506 | const ClassLoader* class_loader_override_; |
buzbee | c143c55 | 2011-08-20 17:38:58 -0700 | [diff] [blame] | 507 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 508 | // TLS key used to retrieve the VM thread object. |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 509 | static pthread_key_t pthread_key_self_; |
| 510 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 511 | // Entry point called when exception_ is set |
| 512 | void (*exception_entry_point_)(Method** frame); |
| 513 | |
| 514 | // Entry point called when suspend_count_ is non-zero |
| 515 | void (*suspend_count_entry_point_)(Method** frame); |
| 516 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 517 | DISALLOW_COPY_AND_ASSIGN(Thread); |
| 518 | }; |
Elliott Hughes | 330304d | 2011-08-12 14:28:05 -0700 | [diff] [blame] | 519 | std::ostream& operator<<(std::ostream& os, const Thread& thread); |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 520 | std::ostream& operator<<(std::ostream& os, const Thread::State& state); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 521 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 522 | class ThreadList { |
| 523 | public: |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 524 | static const int kMaxId = 0xFFFF; |
| 525 | static const int kInvalidId = 0; |
| 526 | static const int kMainId = 1; |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 527 | |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 528 | static ThreadList* Create(); |
| 529 | |
| 530 | ~ThreadList(); |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 531 | |
Elliott Hughes | d92bec4 | 2011-09-02 17:04:36 -0700 | [diff] [blame] | 532 | void Dump(std::ostream& os); |
| 533 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 534 | void Register(Thread* thread); |
| 535 | |
| 536 | void Unregister(Thread* thread); |
| 537 | |
Elliott Hughes | c1674ed | 2011-08-25 18:09:09 -0700 | [diff] [blame] | 538 | bool Contains(Thread* thread); |
| 539 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 540 | void Lock() { |
| 541 | lock_->Lock(); |
| 542 | } |
| 543 | |
| 544 | void Unlock() { |
| 545 | lock_->Unlock(); |
| 546 | }; |
| 547 | |
Elliott Hughes | 410c0c8 | 2011-09-01 17:58:25 -0700 | [diff] [blame] | 548 | void VisitRoots(Heap::RootVisitor* visitor, void* arg) const; |
| 549 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 550 | private: |
| 551 | ThreadList(); |
| 552 | |
| 553 | std::list<Thread*> list_; |
| 554 | |
| 555 | Mutex* lock_; |
| 556 | |
| 557 | DISALLOW_COPY_AND_ASSIGN(ThreadList); |
| 558 | }; |
| 559 | |
| 560 | class ThreadListLock { |
| 561 | public: |
| 562 | ThreadListLock(ThreadList* thread_list, Thread* current_thread) |
| 563 | : thread_list_(thread_list) { |
| 564 | if (current_thread == NULL) { // try to get it from TLS |
| 565 | current_thread = Thread::Current(); |
| 566 | } |
| 567 | Thread::State old_state; |
| 568 | if (current_thread != NULL) { |
Elliott Hughes | ad7c2a3 | 2011-08-31 11:58:10 -0700 | [diff] [blame] | 569 | old_state = current_thread->SetState(Thread::kWaiting); // TODO: VMWAIT |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 570 | } else { |
| 571 | // happens during VM shutdown |
| 572 | old_state = Thread::kUnknown; // TODO: something else |
| 573 | } |
| 574 | thread_list_->Lock(); |
| 575 | if (current_thread != NULL) { |
| 576 | current_thread->SetState(old_state); |
| 577 | } |
| 578 | } |
| 579 | |
| 580 | ~ThreadListLock() { |
| 581 | thread_list_->Unlock(); |
| 582 | } |
| 583 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 584 | private: |
| 585 | ThreadList* thread_list_; |
| 586 | |
| 587 | DISALLOW_COPY_AND_ASSIGN(ThreadListLock); |
| 588 | }; |
| 589 | |
Elliott Hughes | ad7c2a3 | 2011-08-31 11:58:10 -0700 | [diff] [blame] | 590 | class ScopedThreadStateChange { |
| 591 | public: |
| 592 | ScopedThreadStateChange(Thread* thread, Thread::State new_state) : thread_(thread) { |
| 593 | old_thread_state_ = thread_->SetState(new_state); |
| 594 | } |
| 595 | |
| 596 | ~ScopedThreadStateChange() { |
| 597 | thread_->SetState(old_thread_state_); |
| 598 | } |
| 599 | |
| 600 | private: |
| 601 | Thread* thread_; |
| 602 | Thread::State old_thread_state_; |
| 603 | DISALLOW_COPY_AND_ASSIGN(ScopedThreadStateChange); |
| 604 | }; |
| 605 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 606 | } // namespace art |
| 607 | |
| 608 | #endif // ART_SRC_THREAD_H_ |