blob: 7da15d9f4c0ae5bbf78d6f991023b2deb27bd4ee [file] [log] [blame]
Ian Rogers693ff612013-02-01 10:56:12 -08001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Brian Carlstromfc0e3212013-07-17 14:40:12 -070017#ifndef ART_RUNTIME_THREAD_INL_H_
18#define ART_RUNTIME_THREAD_INL_H_
Ian Rogers693ff612013-02-01 10:56:12 -080019
20#include "thread.h"
21
Ian Rogers1eb512d2013-10-18 15:42:20 -070022#include "base/casts.h"
Ian Rogers693ff612013-02-01 10:56:12 -080023#include "base/mutex-inl.h"
Andreas Gamped4901292017-05-30 18:41:34 -070024#include "base/time_utils.h"
Ian Rogers68d8b422014-07-17 11:09:10 -070025#include "jni_env_ext.h"
Andreas Gampe513061a2017-06-01 09:17:34 -070026#include "managed_stack-inl.h"
Andreas Gampec73cb642017-02-22 10:11:30 -080027#include "obj_ptr.h"
Andreas Gampeb486a982017-06-01 13:45:54 -070028#include "thread-current-inl.h"
Mathieu Chartier3cf22532015-07-09 15:15:09 -070029#include "thread_pool.h"
Ian Rogers693ff612013-02-01 10:56:12 -080030
31namespace art {
32
Ian Rogers1eb512d2013-10-18 15:42:20 -070033// Quickly access the current thread from a JNIEnv.
34static inline Thread* ThreadForEnv(JNIEnv* env) {
35 JNIEnvExt* full_env(down_cast<JNIEnvExt*>(env));
36 return full_env->self;
37}
38
Ian Rogers7b078e82014-09-10 14:44:24 -070039inline void Thread::AllowThreadSuspension() {
40 DCHECK_EQ(Thread::Current(), this);
41 if (UNLIKELY(TestAllFlags())) {
42 CheckSuspend();
43 }
Mathieu Chartiera59d9b22016-09-26 18:13:17 -070044 // Invalidate the current thread's object pointers (ObjPtr) to catch possible moving GC bugs due
45 // to missing handles.
Mathieu Chartier3f7f03c2016-09-26 11:39:52 -070046 PoisonObjectPointers();
Ian Rogers7b078e82014-09-10 14:44:24 -070047}
48
49inline void Thread::CheckSuspend() {
50 DCHECK_EQ(Thread::Current(), this);
51 for (;;) {
52 if (ReadFlag(kCheckpointRequest)) {
53 RunCheckpointFunction();
54 } else if (ReadFlag(kSuspendRequest)) {
55 FullSuspendCheck();
Hiroshi Yamauchi30493242016-11-03 13:06:52 -070056 } else if (ReadFlag(kEmptyCheckpointRequest)) {
57 RunEmptyCheckpoint();
58 } else {
59 break;
60 }
61 }
62}
63
Hiroshi Yamauchia2224042017-02-08 16:35:45 -080064inline void Thread::CheckEmptyCheckpointFromWeakRefAccess(BaseMutex* cond_var_mutex) {
65 Thread* self = Thread::Current();
66 DCHECK_EQ(self, this);
67 for (;;) {
68 if (ReadFlag(kEmptyCheckpointRequest)) {
69 RunEmptyCheckpoint();
70 // Check we hold only an expected mutex when accessing weak ref.
71 if (kIsDebugBuild) {
72 for (int i = kLockLevelCount - 1; i >= 0; --i) {
73 BaseMutex* held_mutex = self->GetHeldMutex(static_cast<LockLevel>(i));
74 if (held_mutex != nullptr &&
75 held_mutex != Locks::mutator_lock_ &&
76 held_mutex != cond_var_mutex) {
Hiroshi Yamauchi8a433242017-03-07 14:39:22 -080077 CHECK(Locks::IsExpectedOnWeakRefAccess(held_mutex))
Hiroshi Yamauchia2224042017-02-08 16:35:45 -080078 << "Holding unexpected mutex " << held_mutex->GetName()
79 << " when accessing weak ref";
80 }
81 }
82 }
83 } else {
84 break;
85 }
86 }
87}
88
89inline void Thread::CheckEmptyCheckpointFromMutex() {
Hiroshi Yamauchi30493242016-11-03 13:06:52 -070090 DCHECK_EQ(Thread::Current(), this);
91 for (;;) {
92 if (ReadFlag(kEmptyCheckpointRequest)) {
93 RunEmptyCheckpoint();
Ian Rogers7b078e82014-09-10 14:44:24 -070094 } else {
95 break;
96 }
97 }
98}
99
Ian Rogersc0fa3ad2013-02-05 00:11:55 -0800100inline ThreadState Thread::SetState(ThreadState new_state) {
Yu Lieac44242015-06-29 10:50:03 +0800101 // Should only be used to change between suspended states.
102 // Cannot use this code to change into or from Runnable as changing to Runnable should
103 // fail if old_state_and_flags.suspend_request is true and changing from Runnable might
104 // miss passing an active suspend barrier.
Ian Rogersc0fa3ad2013-02-05 00:11:55 -0800105 DCHECK_NE(new_state, kRunnable);
Andreas Gampeef048f62014-11-25 22:12:27 -0800106 if (kIsDebugBuild && this != Thread::Current()) {
107 std::string name;
108 GetThreadName(name);
109 LOG(FATAL) << "Thread \"" << name << "\"(" << this << " != Thread::Current()="
110 << Thread::Current() << ") changing state to " << new_state;
111 }
Chris Dearman59cde532013-12-04 18:53:49 -0800112 union StateAndFlags old_state_and_flags;
Ian Rogersdd7624d2014-03-14 17:43:00 -0700113 old_state_and_flags.as_int = tls32_.state_and_flags.as_int;
Yu Lieac44242015-06-29 10:50:03 +0800114 CHECK_NE(old_state_and_flags.as_struct.state, kRunnable);
Ian Rogersdd7624d2014-03-14 17:43:00 -0700115 tls32_.state_and_flags.as_struct.state = new_state;
Ian Rogersc0fa3ad2013-02-05 00:11:55 -0800116 return static_cast<ThreadState>(old_state_and_flags.as_struct.state);
117}
118
Mathieu Chartier10b218d2016-07-25 17:48:52 -0700119inline bool Thread::IsThreadSuspensionAllowable() const {
120 if (tls32_.no_thread_suspension != 0) {
121 return false;
122 }
123 for (int i = kLockLevelCount - 1; i >= 0; --i) {
124 if (i != kMutatorLock && GetHeldMutex(static_cast<LockLevel>(i)) != nullptr) {
125 return false;
126 }
127 }
128 return true;
129}
130
Ian Rogers693ff612013-02-01 10:56:12 -0800131inline void Thread::AssertThreadSuspensionIsAllowable(bool check_locks) const {
Ian Rogersf3d874c2014-07-17 18:52:42 -0700132 if (kIsDebugBuild) {
Nicolas Geoffraydb978712014-12-09 13:33:38 +0000133 if (gAborting == 0) {
134 CHECK_EQ(0u, tls32_.no_thread_suspension) << tlsPtr_.last_no_thread_suspension_cause;
135 }
Ian Rogersf3d874c2014-07-17 18:52:42 -0700136 if (check_locks) {
137 bool bad_mutexes_held = false;
138 for (int i = kLockLevelCount - 1; i >= 0; --i) {
139 // We expect no locks except the mutator_lock_ or thread list suspend thread lock.
Ian Rogers4ad5cd32014-11-11 23:08:07 -0800140 if (i != kMutatorLock) {
Ian Rogersf3d874c2014-07-17 18:52:42 -0700141 BaseMutex* held_mutex = GetHeldMutex(static_cast<LockLevel>(i));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700142 if (held_mutex != nullptr) {
Ian Rogersf3d874c2014-07-17 18:52:42 -0700143 LOG(ERROR) << "holding \"" << held_mutex->GetName()
144 << "\" at point where thread suspension is expected";
145 bad_mutexes_held = true;
146 }
Ian Rogers693ff612013-02-01 10:56:12 -0800147 }
148 }
Nicolas Geoffraydb978712014-12-09 13:33:38 +0000149 if (gAborting == 0) {
150 CHECK(!bad_mutexes_held);
151 }
Ian Rogers693ff612013-02-01 10:56:12 -0800152 }
Ian Rogers693ff612013-02-01 10:56:12 -0800153 }
Ian Rogers693ff612013-02-01 10:56:12 -0800154}
155
Mathieu Chartier8ac9c912015-10-01 15:58:41 -0700156inline void Thread::TransitionToSuspendedAndRunCheckpoints(ThreadState new_state) {
Ian Rogers693ff612013-02-01 10:56:12 -0800157 DCHECK_NE(new_state, kRunnable);
Ian Rogers693ff612013-02-01 10:56:12 -0800158 DCHECK_EQ(GetState(), kRunnable);
159 union StateAndFlags old_state_and_flags;
160 union StateAndFlags new_state_and_flags;
Dave Allison0f5f6bb2013-11-22 17:39:19 -0800161 while (true) {
Ian Rogersdd7624d2014-03-14 17:43:00 -0700162 old_state_and_flags.as_int = tls32_.state_and_flags.as_int;
Ian Rogersd9c4fc92013-10-01 19:45:43 -0700163 if (UNLIKELY((old_state_and_flags.as_struct.flags & kCheckpointRequest) != 0)) {
164 RunCheckpointFunction();
165 continue;
166 }
Hiroshi Yamauchi30493242016-11-03 13:06:52 -0700167 if (UNLIKELY((old_state_and_flags.as_struct.flags & kEmptyCheckpointRequest) != 0)) {
168 RunEmptyCheckpoint();
169 continue;
170 }
Dave Allison0f5f6bb2013-11-22 17:39:19 -0800171 // Change the state but keep the current flags (kCheckpointRequest is clear).
172 DCHECK_EQ((old_state_and_flags.as_struct.flags & kCheckpointRequest), 0);
Hiroshi Yamauchi30493242016-11-03 13:06:52 -0700173 DCHECK_EQ((old_state_and_flags.as_struct.flags & kEmptyCheckpointRequest), 0);
Dave Allison0f5f6bb2013-11-22 17:39:19 -0800174 new_state_and_flags.as_struct.flags = old_state_and_flags.as_struct.flags;
Ian Rogers693ff612013-02-01 10:56:12 -0800175 new_state_and_flags.as_struct.state = new_state;
Ian Rogersb8e087e2014-07-09 21:12:06 -0700176
Yu Lieac44242015-06-29 10:50:03 +0800177 // CAS the value with a memory ordering.
Ian Rogersb8e087e2014-07-09 21:12:06 -0700178 bool done =
Yu Lieac44242015-06-29 10:50:03 +0800179 tls32_.state_and_flags.as_atomic_int.CompareExchangeWeakRelease(old_state_and_flags.as_int,
Ian Rogersb8e087e2014-07-09 21:12:06 -0700180 new_state_and_flags.as_int);
181 if (LIKELY(done)) {
Dave Allison0f5f6bb2013-11-22 17:39:19 -0800182 break;
183 }
184 }
Mathieu Chartier8ac9c912015-10-01 15:58:41 -0700185}
Yu Lieac44242015-06-29 10:50:03 +0800186
Mathieu Chartier8ac9c912015-10-01 15:58:41 -0700187inline void Thread::PassActiveSuspendBarriers() {
Yu Lieac44242015-06-29 10:50:03 +0800188 while (true) {
189 uint16_t current_flags = tls32_.state_and_flags.as_struct.flags;
Hiroshi Yamauchi30493242016-11-03 13:06:52 -0700190 if (LIKELY((current_flags &
191 (kCheckpointRequest | kEmptyCheckpointRequest | kActiveSuspendBarrier)) == 0)) {
Yu Lieac44242015-06-29 10:50:03 +0800192 break;
193 } else if ((current_flags & kActiveSuspendBarrier) != 0) {
194 PassActiveSuspendBarriers(this);
195 } else {
196 // Impossible
Mathieu Chartier8ac9c912015-10-01 15:58:41 -0700197 LOG(FATAL) << "Fatal, thread transitioned into suspended without running the checkpoint";
Yu Lieac44242015-06-29 10:50:03 +0800198 }
199 }
Ian Rogers693ff612013-02-01 10:56:12 -0800200}
201
Mathieu Chartier8ac9c912015-10-01 15:58:41 -0700202inline void Thread::TransitionFromRunnableToSuspended(ThreadState new_state) {
203 AssertThreadSuspensionIsAllowable();
Mathieu Chartier3398c782016-09-30 10:27:43 -0700204 PoisonObjectPointersIfDebug();
Mathieu Chartier8ac9c912015-10-01 15:58:41 -0700205 DCHECK_EQ(this, Thread::Current());
206 // Change to non-runnable state, thereby appearing suspended to the system.
207 TransitionToSuspendedAndRunCheckpoints(new_state);
208 // Mark the release of the share of the mutator_lock_.
209 Locks::mutator_lock_->TransitionFromRunnableToSuspended(this);
210 // Once suspended - check the active suspend barrier flag
211 PassActiveSuspendBarriers();
212}
213
Ian Rogers693ff612013-02-01 10:56:12 -0800214inline ThreadState Thread::TransitionFromSuspendedToRunnable() {
Chris Dearman59cde532013-12-04 18:53:49 -0800215 union StateAndFlags old_state_and_flags;
Ian Rogersdd7624d2014-03-14 17:43:00 -0700216 old_state_and_flags.as_int = tls32_.state_and_flags.as_int;
Ian Rogers693ff612013-02-01 10:56:12 -0800217 int16_t old_state = old_state_and_flags.as_struct.state;
218 DCHECK_NE(static_cast<ThreadState>(old_state), kRunnable);
219 do {
220 Locks::mutator_lock_->AssertNotHeld(this); // Otherwise we starve GC..
Ian Rogersdd7624d2014-03-14 17:43:00 -0700221 old_state_and_flags.as_int = tls32_.state_and_flags.as_int;
Ian Rogers693ff612013-02-01 10:56:12 -0800222 DCHECK_EQ(old_state_and_flags.as_struct.state, old_state);
Yu Lieac44242015-06-29 10:50:03 +0800223 if (LIKELY(old_state_and_flags.as_struct.flags == 0)) {
224 // Optimize for the return from native code case - this is the fast path.
225 // Atomically change from suspended to runnable if no suspend request pending.
226 union StateAndFlags new_state_and_flags;
227 new_state_and_flags.as_int = old_state_and_flags.as_int;
228 new_state_and_flags.as_struct.state = kRunnable;
229 // CAS the value with a memory barrier.
230 if (LIKELY(tls32_.state_and_flags.as_atomic_int.CompareExchangeWeakAcquire(
231 old_state_and_flags.as_int,
232 new_state_and_flags.as_int))) {
233 // Mark the acquisition of a share of the mutator_lock_.
234 Locks::mutator_lock_->TransitionFromSuspendedToRunnable(this);
235 break;
236 }
237 } else if ((old_state_and_flags.as_struct.flags & kActiveSuspendBarrier) != 0) {
238 PassActiveSuspendBarriers(this);
Hiroshi Yamauchi30493242016-11-03 13:06:52 -0700239 } else if ((old_state_and_flags.as_struct.flags &
240 (kCheckpointRequest | kEmptyCheckpointRequest)) != 0) {
Yu Lieac44242015-06-29 10:50:03 +0800241 // Impossible
Mathieu Chartierdabdccc2015-10-01 14:46:29 -0700242 LOG(FATAL) << "Transitioning to runnable with checkpoint flag, "
243 << " flags=" << old_state_and_flags.as_struct.flags
244 << " state=" << old_state_and_flags.as_struct.state;
Yu Lieac44242015-06-29 10:50:03 +0800245 } else if ((old_state_and_flags.as_struct.flags & kSuspendRequest) != 0) {
Ian Rogers693ff612013-02-01 10:56:12 -0800246 // Wait while our suspend count is non-zero.
Nicolas Geoffray9f5f8ac2016-06-29 14:39:59 +0100247
248 // We pass null to the MutexLock as we may be in a situation where the
249 // runtime is shutting down. Guarding ourselves from that situation
250 // requires to take the shutdown lock, which is undesirable here.
251 Thread* thread_to_pass = nullptr;
252 if (kIsDebugBuild && !IsDaemon()) {
253 // We know we can make our debug locking checks on non-daemon threads,
254 // so re-enable them on debug builds.
255 thread_to_pass = this;
256 }
257 MutexLock mu(thread_to_pass, *Locks::thread_suspend_count_lock_);
Hiroshi Yamauchiee235822016-08-19 17:03:27 -0700258 ScopedTransitioningToRunnable scoped_transitioning_to_runnable(this);
Ian Rogersdd7624d2014-03-14 17:43:00 -0700259 old_state_and_flags.as_int = tls32_.state_and_flags.as_int;
Ian Rogers693ff612013-02-01 10:56:12 -0800260 DCHECK_EQ(old_state_and_flags.as_struct.state, old_state);
261 while ((old_state_and_flags.as_struct.flags & kSuspendRequest) != 0) {
262 // Re-check when Thread::resume_cond_ is notified.
Nicolas Geoffray9f5f8ac2016-06-29 14:39:59 +0100263 Thread::resume_cond_->Wait(thread_to_pass);
Ian Rogersdd7624d2014-03-14 17:43:00 -0700264 old_state_and_flags.as_int = tls32_.state_and_flags.as_int;
Ian Rogers693ff612013-02-01 10:56:12 -0800265 DCHECK_EQ(old_state_and_flags.as_struct.state, old_state);
266 }
267 DCHECK_EQ(GetSuspendCount(), 0);
268 }
Ian Rogers719d1a32014-03-06 12:13:39 -0800269 } while (true);
Yu Lieac44242015-06-29 10:50:03 +0800270 // Run the flip function, if set.
271 Closure* flip_func = GetFlipFunction();
272 if (flip_func != nullptr) {
273 flip_func->Run(this);
274 }
275 return static_cast<ThreadState>(old_state);
Ian Rogers693ff612013-02-01 10:56:12 -0800276}
277
Mathieu Chartiere6da9af2013-12-16 11:54:42 -0800278inline mirror::Object* Thread::AllocTlab(size_t bytes) {
279 DCHECK_GE(TlabSize(), bytes);
Ian Rogersdd7624d2014-03-14 17:43:00 -0700280 ++tlsPtr_.thread_local_objects;
281 mirror::Object* ret = reinterpret_cast<mirror::Object*>(tlsPtr_.thread_local_pos);
282 tlsPtr_.thread_local_pos += bytes;
Mathieu Chartier692fafd2013-11-29 17:24:40 -0800283 return ret;
284}
285
Hiroshi Yamauchif5b0e202014-02-11 17:02:22 -0800286inline bool Thread::PushOnThreadLocalAllocationStack(mirror::Object* obj) {
Ian Rogersdd7624d2014-03-14 17:43:00 -0700287 DCHECK_LE(tlsPtr_.thread_local_alloc_stack_top, tlsPtr_.thread_local_alloc_stack_end);
288 if (tlsPtr_.thread_local_alloc_stack_top < tlsPtr_.thread_local_alloc_stack_end) {
Hiroshi Yamauchif5b0e202014-02-11 17:02:22 -0800289 // There's room.
Ian Rogers13735952014-10-08 12:43:28 -0700290 DCHECK_LE(reinterpret_cast<uint8_t*>(tlsPtr_.thread_local_alloc_stack_top) +
Mathieu Chartiercb535da2015-01-23 13:50:03 -0800291 sizeof(StackReference<mirror::Object>),
Ian Rogers13735952014-10-08 12:43:28 -0700292 reinterpret_cast<uint8_t*>(tlsPtr_.thread_local_alloc_stack_end));
Mathieu Chartiercb535da2015-01-23 13:50:03 -0800293 DCHECK(tlsPtr_.thread_local_alloc_stack_top->AsMirrorPtr() == nullptr);
294 tlsPtr_.thread_local_alloc_stack_top->Assign(obj);
Ian Rogersdd7624d2014-03-14 17:43:00 -0700295 ++tlsPtr_.thread_local_alloc_stack_top;
Hiroshi Yamauchif5b0e202014-02-11 17:02:22 -0800296 return true;
297 }
298 return false;
299}
300
Mathieu Chartiercb535da2015-01-23 13:50:03 -0800301inline void Thread::SetThreadLocalAllocationStack(StackReference<mirror::Object>* start,
302 StackReference<mirror::Object>* end) {
Hiroshi Yamauchif5b0e202014-02-11 17:02:22 -0800303 DCHECK(Thread::Current() == this) << "Should be called by self";
304 DCHECK(start != nullptr);
305 DCHECK(end != nullptr);
Mathieu Chartiercb535da2015-01-23 13:50:03 -0800306 DCHECK_ALIGNED(start, sizeof(StackReference<mirror::Object>));
307 DCHECK_ALIGNED(end, sizeof(StackReference<mirror::Object>));
Hiroshi Yamauchif5b0e202014-02-11 17:02:22 -0800308 DCHECK_LT(start, end);
Ian Rogersdd7624d2014-03-14 17:43:00 -0700309 tlsPtr_.thread_local_alloc_stack_end = end;
310 tlsPtr_.thread_local_alloc_stack_top = start;
Hiroshi Yamauchif5b0e202014-02-11 17:02:22 -0800311}
312
313inline void Thread::RevokeThreadLocalAllocationStack() {
314 if (kIsDebugBuild) {
315 // Note: self is not necessarily equal to this thread since thread may be suspended.
316 Thread* self = Thread::Current();
317 DCHECK(this == self || IsSuspended() || GetState() == kWaitingPerformingGc)
318 << GetState() << " thread " << this << " self " << self;
319 }
Ian Rogersdd7624d2014-03-14 17:43:00 -0700320 tlsPtr_.thread_local_alloc_stack_end = nullptr;
321 tlsPtr_.thread_local_alloc_stack_top = nullptr;
Hiroshi Yamauchif5b0e202014-02-11 17:02:22 -0800322}
323
Mathieu Chartiera59d9b22016-09-26 18:13:17 -0700324inline void Thread::PoisonObjectPointersIfDebug() {
Andreas Gampec73cb642017-02-22 10:11:30 -0800325 if (kObjPtrPoisoning) {
Mathieu Chartiera59d9b22016-09-26 18:13:17 -0700326 Thread::Current()->PoisonObjectPointers();
327 }
328}
329
Hiroshi Yamauchi02e7f1a2016-10-03 15:32:01 -0700330inline bool Thread::ModifySuspendCount(Thread* self,
331 int delta,
332 AtomicInteger* suspend_barrier,
333 bool for_debugger) {
334 if (delta > 0 && ((kUseReadBarrier && this != self) || suspend_barrier != nullptr)) {
335 // When delta > 0 (requesting a suspend), ModifySuspendCountInternal() may fail either if
336 // active_suspend_barriers is full or we are in the middle of a thread flip. Retry in a loop.
337 while (true) {
338 if (LIKELY(ModifySuspendCountInternal(self, delta, suspend_barrier, for_debugger))) {
339 return true;
340 } else {
341 // Failure means the list of active_suspend_barriers is full or we are in the middle of a
342 // thread flip, we should release the thread_suspend_count_lock_ (to avoid deadlock) and
343 // wait till the target thread has executed or Thread::PassActiveSuspendBarriers() or the
344 // flip function. Note that we could not simply wait for the thread to change to a suspended
345 // state, because it might need to run checkpoint function before the state change or
346 // resumes from the resume_cond_, which also needs thread_suspend_count_lock_.
347 //
348 // The list of active_suspend_barriers is very unlikely to be full since more than
349 // kMaxSuspendBarriers threads need to execute SuspendAllInternal() simultaneously, and
350 // target thread stays in kRunnable in the mean time.
351 Locks::thread_suspend_count_lock_->ExclusiveUnlock(self);
352 NanoSleep(100000);
353 Locks::thread_suspend_count_lock_->ExclusiveLock(self);
354 }
355 }
356 } else {
357 return ModifySuspendCountInternal(self, delta, suspend_barrier, for_debugger);
358 }
359}
360
Andreas Gampe513061a2017-06-01 09:17:34 -0700361inline ShadowFrame* Thread::PushShadowFrame(ShadowFrame* new_top_frame) {
362 return tlsPtr_.managed_stack.PushShadowFrame(new_top_frame);
363}
364
365inline ShadowFrame* Thread::PopShadowFrame() {
366 return tlsPtr_.managed_stack.PopShadowFrame();
367}
368
Ian Rogers693ff612013-02-01 10:56:12 -0800369} // namespace art
370
Brian Carlstromfc0e3212013-07-17 14:40:12 -0700371#endif // ART_RUNTIME_THREAD_INL_H_