blob: ab903d64046a9a4f5890fe7ba7cc6eec042dbc5c [file] [log] [blame]
Elliott Hughes68e76522011-10-05 13:22:16 -07001/*
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_STACK_H_
18#define ART_RUNTIME_STACK_H_
Elliott Hughes68e76522011-10-05 13:22:16 -070019
Ian Rogers6d4d9fc2011-11-30 16:24:48 -080020#include "dex_file.h"
jeffhao725a9572012-11-13 18:20:12 -080021#include "instrumentation.h"
Ian Rogersef7d42f2014-01-06 12:55:46 -080022#include "base/casts.h"
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080023#include "base/macros.h"
Ian Rogers166db042013-07-26 12:05:57 -070024#include "arch/context.h"
Mathieu Chartier4e305412014-02-19 10:54:44 -080025#include "mirror/object.h"
Ian Rogersef7d42f2014-01-06 12:55:46 -080026#include "mirror/object_reference.h"
Mathieu Chartier4e305412014-02-19 10:54:44 -080027#include "verify_object.h"
Elliott Hughes68e76522011-10-05 13:22:16 -070028
29#include <stdint.h>
Ian Rogers40e3bac2012-11-20 00:09:14 -080030#include <string>
Elliott Hughes68e76522011-10-05 13:22:16 -070031
32namespace art {
33
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080034namespace mirror {
Brian Carlstromea46f952013-07-30 01:26:50 -070035 class ArtMethod;
36 class Object;
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080037} // namespace mirror
38
39class Context;
Ian Rogers0399dde2012-06-06 17:09:28 -070040class ShadowFrame;
Elliott Hughes08fc03a2012-06-26 17:34:00 -070041class StackIndirectReferenceTable;
Ian Rogers00f7d0e2012-07-19 15:28:27 -070042class ScopedObjectAccess;
Elliott Hughes68e76522011-10-05 13:22:16 -070043class Thread;
44
Ian Rogers2bcb4a42012-11-08 10:39:18 -080045// The kind of vreg being accessed in calls to Set/GetVReg.
46enum VRegKind {
47 kReferenceVReg,
48 kIntVReg,
49 kFloatVReg,
50 kLongLoVReg,
51 kLongHiVReg,
52 kDoubleLoVReg,
53 kDoubleHiVReg,
54 kConstant,
55 kImpreciseConstant,
56 kUndefined,
57};
58
Razvan A Lupusoruda7a69b2014-01-08 15:09:50 -080059/**
60 * @brief Represents the virtual register numbers that denote special meaning.
61 * @details This is used to make some virtual register numbers to have specific
62 * semantic meaning. This is done so that the compiler can treat all virtual
63 * registers the same way and only special case when needed. For example,
64 * calculating SSA does not care whether a virtual register is a normal one or
65 * a compiler temporary, so it can deal with them in a consistent manner. But,
66 * for example if backend cares about temporaries because it has custom spill
67 * location, then it can special case them only then.
68 */
69enum VRegBaseRegNum : int {
70 /**
71 * @brief Virtual registers originating from dex have number >= 0.
72 */
73 kVRegBaseReg = 0,
74
75 /**
76 * @brief Invalid virtual register number.
77 */
78 kVRegInvalid = -1,
79
80 /**
81 * @brief Used to denote the base register for compiler temporaries.
82 * @details Compiler temporaries are virtual registers not originating
83 * from dex but that are created by compiler. All virtual register numbers
84 * that are <= kVRegTempBaseReg are categorized as compiler temporaries.
85 */
86 kVRegTempBaseReg = -2,
87
88 /**
89 * @brief Base register of temporary that holds the method pointer.
90 * @details This is a special compiler temporary because it has a specific
91 * location on stack.
92 */
93 kVRegMethodPtrBaseReg = kVRegTempBaseReg,
94
95 /**
96 * @brief Base register of non-special compiler temporary.
97 * @details A non-special compiler temporary is one whose spill location
98 * is flexible.
99 */
100 kVRegNonSpecialTempBaseReg = -3,
101};
102
Dave Allisonf9439142014-03-27 15:10:22 -0700103// Special object used to mark the gap in the stack placed when a stack
104// overflow fault occurs during implicit stack checking. This is not
105// a real object - it is used simply as a valid address to which a
106// mirror::ArtMethod* can be compared during a stack walk. It is inserted
107// into the stack during the stack overflow signal handling to mark the gap
108// in which the memory is protected against read and write.
109extern void* stack_overflow_gap_marker;
110
Ian Rogersef7d42f2014-01-06 12:55:46 -0800111// A reference from the shadow stack to a MirrorType object within the Java heap.
112template<class MirrorType>
113class MANAGED StackReference : public mirror::ObjectReference<false, MirrorType> {
114 public:
115 StackReference<MirrorType>() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
116 : mirror::ObjectReference<false, MirrorType>(nullptr) {}
117
118 static StackReference<MirrorType> FromMirrorPtr(MirrorType* p)
119 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
120 return StackReference<MirrorType>(p);
121 }
122
123 private:
124 StackReference<MirrorType>(MirrorType* p) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
125 : mirror::ObjectReference<false, MirrorType>(p) {}
126};
127
Mathieu Chartier67022432012-11-29 18:04:50 -0800128// ShadowFrame has 3 possible layouts:
129// - portable - a unified array of VRegs and references. Precise references need GC maps.
130// - interpreter - separate VRegs and reference arrays. References are in the reference array.
131// - JNI - just VRegs, but where every VReg holds a reference.
Ian Rogers0399dde2012-06-06 17:09:28 -0700132class ShadowFrame {
Elliott Hughes68e76522011-10-05 13:22:16 -0700133 public:
Ian Rogersef7d42f2014-01-06 12:55:46 -0800134 // Compute size of ShadowFrame in bytes assuming it has a reference array.
Jeff Hao66135192013-05-14 11:02:41 -0700135 static size_t ComputeSize(uint32_t num_vregs) {
136 return sizeof(ShadowFrame) + (sizeof(uint32_t) * num_vregs) +
Ian Rogersef7d42f2014-01-06 12:55:46 -0800137 (sizeof(StackReference<mirror::Object>) * num_vregs);
Jeff Hao66135192013-05-14 11:02:41 -0700138 }
139
140 // Create ShadowFrame in heap for deoptimization.
TDYa127ce4cc0d2012-11-18 16:59:53 -0800141 static ShadowFrame* Create(uint32_t num_vregs, ShadowFrame* link,
Brian Carlstromea46f952013-07-30 01:26:50 -0700142 mirror::ArtMethod* method, uint32_t dex_pc) {
Jeff Hao66135192013-05-14 11:02:41 -0700143 uint8_t* memory = new uint8_t[ComputeSize(num_vregs)];
Sebastien Hertzc61124b2013-09-10 11:44:19 +0200144 return Create(num_vregs, link, method, dex_pc, memory);
Jeff Hao66135192013-05-14 11:02:41 -0700145 }
146
147 // Create ShadowFrame for interpreter using provided memory.
148 static ShadowFrame* Create(uint32_t num_vregs, ShadowFrame* link,
Brian Carlstromea46f952013-07-30 01:26:50 -0700149 mirror::ArtMethod* method, uint32_t dex_pc, void* memory) {
TDYa127ce4cc0d2012-11-18 16:59:53 -0800150 ShadowFrame* sf = new (memory) ShadowFrame(num_vregs, link, method, dex_pc, true);
151 return sf;
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700152 }
153 ~ShadowFrame() {}
154
TDYa127ce4cc0d2012-11-18 16:59:53 -0800155 bool HasReferenceArray() const {
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700156#if defined(ART_USE_PORTABLE_COMPILER)
TDYa127ce4cc0d2012-11-18 16:59:53 -0800157 return (number_of_vregs_ & kHasReferenceArray) != 0;
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700158#else
159 return true;
160#endif
Ian Rogers0399dde2012-06-06 17:09:28 -0700161 }
Elliott Hughes68e76522011-10-05 13:22:16 -0700162
TDYa127ce4cc0d2012-11-18 16:59:53 -0800163 uint32_t NumberOfVRegs() const {
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700164#if defined(ART_USE_PORTABLE_COMPILER)
TDYa127ce4cc0d2012-11-18 16:59:53 -0800165 return number_of_vregs_ & ~kHasReferenceArray;
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700166#else
167 return number_of_vregs_;
168#endif
Ian Rogers0399dde2012-06-06 17:09:28 -0700169 }
170
TDYa127ce4cc0d2012-11-18 16:59:53 -0800171 void SetNumberOfVRegs(uint32_t number_of_vregs) {
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700172#if defined(ART_USE_PORTABLE_COMPILER)
TDYa127ce4cc0d2012-11-18 16:59:53 -0800173 number_of_vregs_ = number_of_vregs | (number_of_vregs_ & kHasReferenceArray);
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700174#else
175 UNUSED(number_of_vregs);
176 UNIMPLEMENTED(FATAL) << "Should only be called when portable is enabled";
177#endif
Ian Rogers5438ad82012-10-15 17:22:44 -0700178 }
179
Ian Rogers0399dde2012-06-06 17:09:28 -0700180 uint32_t GetDexPC() const {
181 return dex_pc_;
182 }
183
184 void SetDexPC(uint32_t dex_pc) {
185 dex_pc_ = dex_pc;
186 }
187
Ian Rogers0399dde2012-06-06 17:09:28 -0700188 ShadowFrame* GetLink() const {
189 return link_;
190 }
191
192 void SetLink(ShadowFrame* frame) {
193 DCHECK_NE(this, frame);
194 link_ = frame;
195 }
196
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700197 int32_t GetVReg(size_t i) const {
TDYa127ce4cc0d2012-11-18 16:59:53 -0800198 DCHECK_LT(i, NumberOfVRegs());
199 const uint32_t* vreg = &vregs_[i];
200 return *reinterpret_cast<const int32_t*>(vreg);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700201 }
202
203 float GetVRegFloat(size_t i) const {
TDYa127ce4cc0d2012-11-18 16:59:53 -0800204 DCHECK_LT(i, NumberOfVRegs());
205 // NOTE: Strict-aliasing?
206 const uint32_t* vreg = &vregs_[i];
207 return *reinterpret_cast<const float*>(vreg);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700208 }
209
210 int64_t GetVRegLong(size_t i) const {
Sebastien Hertz807a2562013-04-15 09:33:39 +0200211 DCHECK_LT(i, NumberOfVRegs());
TDYa127ce4cc0d2012-11-18 16:59:53 -0800212 const uint32_t* vreg = &vregs_[i];
Jeff Haoe47637c2013-09-19 15:13:16 -0700213 // Alignment attribute required for GCC 4.8
214 typedef const int64_t unaligned_int64 __attribute__ ((aligned (4)));
215 return *reinterpret_cast<unaligned_int64*>(vreg);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700216 }
217
218 double GetVRegDouble(size_t i) const {
Sebastien Hertz807a2562013-04-15 09:33:39 +0200219 DCHECK_LT(i, NumberOfVRegs());
TDYa127ce4cc0d2012-11-18 16:59:53 -0800220 const uint32_t* vreg = &vregs_[i];
Jeff Haoe47637c2013-09-19 15:13:16 -0700221 // Alignment attribute required for GCC 4.8
222 typedef const double unaligned_double __attribute__ ((aligned (4)));
223 return *reinterpret_cast<unaligned_double*>(vreg);
TDYa127ce4cc0d2012-11-18 16:59:53 -0800224 }
225
Mathieu Chartier4e305412014-02-19 10:54:44 -0800226 template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags>
Ian Rogersef7d42f2014-01-06 12:55:46 -0800227 mirror::Object* GetVRegReference(size_t i) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
TDYa127ce4cc0d2012-11-18 16:59:53 -0800228 DCHECK_LT(i, NumberOfVRegs());
Mathieu Chartier4e305412014-02-19 10:54:44 -0800229 mirror::Object* ref;
TDYa127ce4cc0d2012-11-18 16:59:53 -0800230 if (HasReferenceArray()) {
Mathieu Chartier4e305412014-02-19 10:54:44 -0800231 ref = References()[i].AsMirrorPtr();
TDYa127ce4cc0d2012-11-18 16:59:53 -0800232 } else {
Ian Rogersef7d42f2014-01-06 12:55:46 -0800233 const uint32_t* vreg_ptr = &vregs_[i];
Mathieu Chartier4e305412014-02-19 10:54:44 -0800234 ref = reinterpret_cast<const StackReference<mirror::Object>*>(vreg_ptr)->AsMirrorPtr();
TDYa127ce4cc0d2012-11-18 16:59:53 -0800235 }
Mathieu Chartier4e305412014-02-19 10:54:44 -0800236 if (kVerifyFlags & kVerifyReads) {
237 VerifyObject(ref);
238 }
239 return ref;
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700240 }
241
Jeff Hao16743632013-05-08 10:59:04 -0700242 // Get view of vregs as range of consecutive arguments starting at i.
243 uint32_t* GetVRegArgs(size_t i) {
244 return &vregs_[i];
245 }
246
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700247 void SetVReg(size_t i, int32_t val) {
TDYa127ce4cc0d2012-11-18 16:59:53 -0800248 DCHECK_LT(i, NumberOfVRegs());
249 uint32_t* vreg = &vregs_[i];
250 *reinterpret_cast<int32_t*>(vreg) = val;
Mathieu Chartier590fee92013-09-13 13:46:47 -0700251 // This is needed for moving collectors since these can update the vreg references if they
252 // happen to agree with references in the reference array.
253 if (kMovingCollector && HasReferenceArray()) {
Ian Rogersef7d42f2014-01-06 12:55:46 -0800254 References()[i].Clear();
Mathieu Chartier590fee92013-09-13 13:46:47 -0700255 }
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700256 }
257
258 void SetVRegFloat(size_t i, float val) {
TDYa127ce4cc0d2012-11-18 16:59:53 -0800259 DCHECK_LT(i, NumberOfVRegs());
260 uint32_t* vreg = &vregs_[i];
261 *reinterpret_cast<float*>(vreg) = val;
Mathieu Chartier590fee92013-09-13 13:46:47 -0700262 // This is needed for moving collectors since these can update the vreg references if they
263 // happen to agree with references in the reference array.
264 if (kMovingCollector && HasReferenceArray()) {
Ian Rogersef7d42f2014-01-06 12:55:46 -0800265 References()[i].Clear();
Mathieu Chartier590fee92013-09-13 13:46:47 -0700266 }
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700267 }
268
269 void SetVRegLong(size_t i, int64_t val) {
Sebastien Hertz807a2562013-04-15 09:33:39 +0200270 DCHECK_LT(i, NumberOfVRegs());
TDYa127ce4cc0d2012-11-18 16:59:53 -0800271 uint32_t* vreg = &vregs_[i];
Jeff Haoe47637c2013-09-19 15:13:16 -0700272 // Alignment attribute required for GCC 4.8
273 typedef int64_t unaligned_int64 __attribute__ ((aligned (4)));
274 *reinterpret_cast<unaligned_int64*>(vreg) = val;
Mathieu Chartier590fee92013-09-13 13:46:47 -0700275 // This is needed for moving collectors since these can update the vreg references if they
276 // happen to agree with references in the reference array.
277 if (kMovingCollector && HasReferenceArray()) {
Ian Rogersef7d42f2014-01-06 12:55:46 -0800278 References()[i].Clear();
279 References()[i + 1].Clear();
Mathieu Chartier590fee92013-09-13 13:46:47 -0700280 }
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700281 }
282
283 void SetVRegDouble(size_t i, double val) {
Sebastien Hertz807a2562013-04-15 09:33:39 +0200284 DCHECK_LT(i, NumberOfVRegs());
TDYa127ce4cc0d2012-11-18 16:59:53 -0800285 uint32_t* vreg = &vregs_[i];
Jeff Haoe47637c2013-09-19 15:13:16 -0700286 // Alignment attribute required for GCC 4.8
287 typedef double unaligned_double __attribute__ ((aligned (4)));
288 *reinterpret_cast<unaligned_double*>(vreg) = val;
Mathieu Chartier590fee92013-09-13 13:46:47 -0700289 // This is needed for moving collectors since these can update the vreg references if they
290 // happen to agree with references in the reference array.
291 if (kMovingCollector && HasReferenceArray()) {
Ian Rogersef7d42f2014-01-06 12:55:46 -0800292 References()[i].Clear();
293 References()[i + 1].Clear();
Mathieu Chartier590fee92013-09-13 13:46:47 -0700294 }
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700295 }
296
Mathieu Chartier4e305412014-02-19 10:54:44 -0800297 template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags>
Ian Rogersef7d42f2014-01-06 12:55:46 -0800298 void SetVRegReference(size_t i, mirror::Object* val) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
TDYa127ce4cc0d2012-11-18 16:59:53 -0800299 DCHECK_LT(i, NumberOfVRegs());
Mathieu Chartier4e305412014-02-19 10:54:44 -0800300 if (kVerifyFlags & kVerifyWrites) {
301 VerifyObject(val);
302 }
TDYa127ce4cc0d2012-11-18 16:59:53 -0800303 uint32_t* vreg = &vregs_[i];
Ian Rogersef7d42f2014-01-06 12:55:46 -0800304 reinterpret_cast<StackReference<mirror::Object>*>(vreg)->Assign(val);
TDYa127ce4cc0d2012-11-18 16:59:53 -0800305 if (HasReferenceArray()) {
Ian Rogersef7d42f2014-01-06 12:55:46 -0800306 References()[i].Assign(val);
TDYa127ce4cc0d2012-11-18 16:59:53 -0800307 }
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700308 }
309
Ian Rogersef7d42f2014-01-06 12:55:46 -0800310 mirror::ArtMethod* GetMethod() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
311 DCHECK(method_ != nullptr);
Ian Rogers0399dde2012-06-06 17:09:28 -0700312 return method_;
Elliott Hughes68e76522011-10-05 13:22:16 -0700313 }
314
Ian Rogers62d6c772013-02-27 08:32:07 -0800315 mirror::Object* GetThisObject() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
316
Jeff Haoe701f482013-05-24 11:50:49 -0700317 mirror::Object* GetThisObject(uint16_t num_ins) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
318
Ian Rogers62d6c772013-02-27 08:32:07 -0800319 ThrowLocation GetCurrentLocationForThrow() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
320
Brian Carlstromea46f952013-07-30 01:26:50 -0700321 void SetMethod(mirror::ArtMethod* method) {
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700322#if defined(ART_USE_PORTABLE_COMPILER)
Ian Rogersef7d42f2014-01-06 12:55:46 -0800323 DCHECK(method != nullptr);
Ian Rogers0399dde2012-06-06 17:09:28 -0700324 method_ = method;
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700325#else
326 UNUSED(method);
327 UNIMPLEMENTED(FATAL) << "Should only be called when portable is enabled";
328#endif
Elliott Hughes68e76522011-10-05 13:22:16 -0700329 }
330
Ian Rogersef7d42f2014-01-06 12:55:46 -0800331 bool Contains(StackReference<mirror::Object>* shadow_frame_entry_obj) const {
TDYa127ce4cc0d2012-11-18 16:59:53 -0800332 if (HasReferenceArray()) {
333 return ((&References()[0] <= shadow_frame_entry_obj) &&
334 (shadow_frame_entry_obj <= (&References()[NumberOfVRegs() - 1])));
335 } else {
336 uint32_t* shadow_frame_entry = reinterpret_cast<uint32_t*>(shadow_frame_entry_obj);
337 return ((&vregs_[0] <= shadow_frame_entry) &&
338 (shadow_frame_entry <= (&vregs_[NumberOfVRegs() - 1])));
Ian Rogers0399dde2012-06-06 17:09:28 -0700339 }
Elliott Hughes68e76522011-10-05 13:22:16 -0700340 }
341
Ian Rogers0399dde2012-06-06 17:09:28 -0700342 static size_t LinkOffset() {
343 return OFFSETOF_MEMBER(ShadowFrame, link_);
344 }
345
Ian Rogers0399dde2012-06-06 17:09:28 -0700346 static size_t MethodOffset() {
347 return OFFSETOF_MEMBER(ShadowFrame, method_);
348 }
349
Ian Rogers0399dde2012-06-06 17:09:28 -0700350 static size_t DexPCOffset() {
351 return OFFSETOF_MEMBER(ShadowFrame, dex_pc_);
352 }
353
Ian Rogers5438ad82012-10-15 17:22:44 -0700354 static size_t NumberOfVRegsOffset() {
355 return OFFSETOF_MEMBER(ShadowFrame, number_of_vregs_);
356 }
357
TDYa127ce4cc0d2012-11-18 16:59:53 -0800358 static size_t VRegsOffset() {
359 return OFFSETOF_MEMBER(ShadowFrame, vregs_);
Ian Rogers5438ad82012-10-15 17:22:44 -0700360 }
361
Elliott Hughes68e76522011-10-05 13:22:16 -0700362 private:
Brian Carlstromea46f952013-07-30 01:26:50 -0700363 ShadowFrame(uint32_t num_vregs, ShadowFrame* link, mirror::ArtMethod* method,
Ian Rogers2dd0e2c2013-01-24 12:42:14 -0800364 uint32_t dex_pc, bool has_reference_array)
TDYa127ce4cc0d2012-11-18 16:59:53 -0800365 : number_of_vregs_(num_vregs), link_(link), method_(method), dex_pc_(dex_pc) {
366 if (has_reference_array) {
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700367#if defined(ART_USE_PORTABLE_COMPILER)
368 CHECK_LT(num_vregs, static_cast<uint32_t>(kHasReferenceArray));
TDYa127ce4cc0d2012-11-18 16:59:53 -0800369 number_of_vregs_ |= kHasReferenceArray;
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700370#endif
Ian Rogersef7d42f2014-01-06 12:55:46 -0800371 memset(vregs_, 0, num_vregs * (sizeof(uint32_t) + sizeof(StackReference<mirror::Object>)));
Mathieu Chartier67022432012-11-29 18:04:50 -0800372 } else {
Jeff Haoe701f482013-05-24 11:50:49 -0700373 memset(vregs_, 0, num_vregs * sizeof(uint32_t));
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700374 }
375 }
Elliott Hughes68e76522011-10-05 13:22:16 -0700376
Ian Rogersef7d42f2014-01-06 12:55:46 -0800377 const StackReference<mirror::Object>* References() const {
Mathieu Chartier67022432012-11-29 18:04:50 -0800378 DCHECK(HasReferenceArray());
TDYa127ce4cc0d2012-11-18 16:59:53 -0800379 const uint32_t* vreg_end = &vregs_[NumberOfVRegs()];
Ian Rogersef7d42f2014-01-06 12:55:46 -0800380 return reinterpret_cast<const StackReference<mirror::Object>*>(vreg_end);
TDYa127ce4cc0d2012-11-18 16:59:53 -0800381 }
382
Ian Rogersef7d42f2014-01-06 12:55:46 -0800383 StackReference<mirror::Object>* References() {
384 return const_cast<StackReference<mirror::Object>*>(const_cast<const ShadowFrame*>(this)->References());
TDYa127ce4cc0d2012-11-18 16:59:53 -0800385 }
386
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700387#if defined(ART_USE_PORTABLE_COMPILER)
TDYa127ce4cc0d2012-11-18 16:59:53 -0800388 enum ShadowFrameFlag {
389 kHasReferenceArray = 1ul << 31
390 };
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700391 // TODO: make const in the portable case.
TDYa127ce4cc0d2012-11-18 16:59:53 -0800392 uint32_t number_of_vregs_;
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700393#else
394 const uint32_t number_of_vregs_;
395#endif
Ian Rogers5438ad82012-10-15 17:22:44 -0700396 // Link to previous shadow frame or NULL.
Ian Rogers0399dde2012-06-06 17:09:28 -0700397 ShadowFrame* link_;
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700398#if defined(ART_USE_PORTABLE_COMPILER)
399 // TODO: make const in the portable case.
Brian Carlstromea46f952013-07-30 01:26:50 -0700400 mirror::ArtMethod* method_;
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700401#else
Brian Carlstromea46f952013-07-30 01:26:50 -0700402 mirror::ArtMethod* const method_;
Ian Rogers8a01a3a2013-05-06 13:25:44 -0700403#endif
Ian Rogers0399dde2012-06-06 17:09:28 -0700404 uint32_t dex_pc_;
TDYa127ce4cc0d2012-11-18 16:59:53 -0800405 uint32_t vregs_[0];
Elliott Hughes68e76522011-10-05 13:22:16 -0700406
Ian Rogers0399dde2012-06-06 17:09:28 -0700407 DISALLOW_IMPLICIT_CONSTRUCTORS(ShadowFrame);
Elliott Hughes68e76522011-10-05 13:22:16 -0700408};
409
Ian Rogers0399dde2012-06-06 17:09:28 -0700410// The managed stack is used to record fragments of managed code stacks. Managed code stacks
411// may either be shadow frames or lists of frames using fixed frame sizes. Transition records are
412// necessary for transitions between code using different frame layouts and transitions into native
413// code.
Ian Rogersdf1ce912012-11-27 17:07:11 -0800414class PACKED(4) ManagedStack {
Ian Rogers0399dde2012-06-06 17:09:28 -0700415 public:
Ian Rogersca190662012-06-26 15:45:57 -0700416 ManagedStack()
417 : link_(NULL), top_shadow_frame_(NULL), top_quick_frame_(NULL), top_quick_frame_pc_(0) {}
Ian Rogers81d425b2012-09-27 16:03:43 -0700418
419 void PushManagedStackFragment(ManagedStack* fragment) {
420 // Copy this top fragment into given fragment.
421 memcpy(fragment, this, sizeof(ManagedStack));
422 // Clear this fragment, which has become the top.
423 memset(this, 0, sizeof(ManagedStack));
424 // Link our top fragment onto the given fragment.
425 link_ = fragment;
426 }
427
428 void PopManagedStackFragment(const ManagedStack& fragment) {
429 DCHECK(&fragment == link_);
430 // Copy this given fragment back to the top.
431 memcpy(this, &fragment, sizeof(ManagedStack));
432 }
Ian Rogers0399dde2012-06-06 17:09:28 -0700433
434 ManagedStack* GetLink() const {
435 return link_;
436 }
437
Brian Carlstromea46f952013-07-30 01:26:50 -0700438 mirror::ArtMethod** GetTopQuickFrame() const {
Ian Rogers0399dde2012-06-06 17:09:28 -0700439 return top_quick_frame_;
440 }
441
Brian Carlstromea46f952013-07-30 01:26:50 -0700442 void SetTopQuickFrame(mirror::ArtMethod** top) {
Sebastien Hertza7b0c422013-04-05 16:19:39 +0200443 DCHECK(top_shadow_frame_ == NULL);
Ian Rogers0399dde2012-06-06 17:09:28 -0700444 top_quick_frame_ = top;
445 }
446
447 uintptr_t GetTopQuickFramePc() const {
448 return top_quick_frame_pc_;
449 }
450
451 void SetTopQuickFramePc(uintptr_t pc) {
Sebastien Hertza7b0c422013-04-05 16:19:39 +0200452 DCHECK(top_shadow_frame_ == NULL);
Ian Rogers0399dde2012-06-06 17:09:28 -0700453 top_quick_frame_pc_ = pc;
454 }
455
456 static size_t TopQuickFrameOffset() {
457 return OFFSETOF_MEMBER(ManagedStack, top_quick_frame_);
458 }
459
460 static size_t TopQuickFramePcOffset() {
461 return OFFSETOF_MEMBER(ManagedStack, top_quick_frame_pc_);
462 }
463
464 ShadowFrame* PushShadowFrame(ShadowFrame* new_top_frame) {
Sebastien Hertza7b0c422013-04-05 16:19:39 +0200465 DCHECK(top_quick_frame_ == NULL);
Ian Rogers0399dde2012-06-06 17:09:28 -0700466 ShadowFrame* old_frame = top_shadow_frame_;
467 top_shadow_frame_ = new_top_frame;
468 new_top_frame->SetLink(old_frame);
469 return old_frame;
470 }
471
472 ShadowFrame* PopShadowFrame() {
Sebastien Hertza7b0c422013-04-05 16:19:39 +0200473 DCHECK(top_quick_frame_ == NULL);
Ian Rogers0399dde2012-06-06 17:09:28 -0700474 CHECK(top_shadow_frame_ != NULL);
475 ShadowFrame* frame = top_shadow_frame_;
476 top_shadow_frame_ = frame->GetLink();
477 return frame;
478 }
479
480 ShadowFrame* GetTopShadowFrame() const {
481 return top_shadow_frame_;
482 }
483
Jeff Hao11ffc2d2013-02-01 11:52:17 -0800484 void SetTopShadowFrame(ShadowFrame* top) {
Sebastien Hertza7b0c422013-04-05 16:19:39 +0200485 DCHECK(top_quick_frame_ == NULL);
Jeff Hao11ffc2d2013-02-01 11:52:17 -0800486 top_shadow_frame_ = top;
487 }
488
Ian Rogers0399dde2012-06-06 17:09:28 -0700489 static size_t TopShadowFrameOffset() {
490 return OFFSETOF_MEMBER(ManagedStack, top_shadow_frame_);
491 }
492
Ian Rogersef7d42f2014-01-06 12:55:46 -0800493 size_t NumJniShadowFrameReferences() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers0399dde2012-06-06 17:09:28 -0700494
Ian Rogersef7d42f2014-01-06 12:55:46 -0800495 bool ShadowFramesContain(StackReference<mirror::Object>* shadow_frame_entry) const;
Ian Rogers0399dde2012-06-06 17:09:28 -0700496
497 private:
498 ManagedStack* link_;
499 ShadowFrame* top_shadow_frame_;
Brian Carlstromea46f952013-07-30 01:26:50 -0700500 mirror::ArtMethod** top_quick_frame_;
Ian Rogers0399dde2012-06-06 17:09:28 -0700501 uintptr_t top_quick_frame_pc_;
502};
503
504class StackVisitor {
505 protected:
Ian Rogers7a22fa62013-01-23 12:16:16 -0800506 StackVisitor(Thread* thread, Context* context) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers0399dde2012-06-06 17:09:28 -0700507
508 public:
509 virtual ~StackVisitor() {}
510
511 // Return 'true' if we should continue to visit more frames, 'false' to stop.
Ian Rogersb726dcb2012-09-05 08:57:23 -0700512 virtual bool VisitFrame() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) = 0;
Ian Rogers0399dde2012-06-06 17:09:28 -0700513
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700514 void WalkStack(bool include_transitions = false)
Ian Rogersb726dcb2012-09-05 08:57:23 -0700515 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers0399dde2012-06-06 17:09:28 -0700516
Ian Rogersef7d42f2014-01-06 12:55:46 -0800517 mirror::ArtMethod* GetMethod() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
518 if (cur_shadow_frame_ != nullptr) {
Ian Rogers0399dde2012-06-06 17:09:28 -0700519 return cur_shadow_frame_->GetMethod();
Ian Rogersef7d42f2014-01-06 12:55:46 -0800520 } else if (cur_quick_frame_ != nullptr) {
Ian Rogers0399dde2012-06-06 17:09:28 -0700521 return *cur_quick_frame_;
522 } else {
Ian Rogersef7d42f2014-01-06 12:55:46 -0800523 return nullptr;
Ian Rogers0399dde2012-06-06 17:09:28 -0700524 }
525 }
526
527 bool IsShadowFrame() const {
Ian Rogersef7d42f2014-01-06 12:55:46 -0800528 return cur_shadow_frame_ != nullptr;
Ian Rogers0399dde2012-06-06 17:09:28 -0700529 }
530
Dave Allisonb373e092014-02-20 16:06:36 -0800531 uint32_t GetDexPc(bool abort_on_failure = true) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers0c7abda2012-09-19 13:33:42 -0700532
Ian Rogers62d6c772013-02-27 08:32:07 -0800533 mirror::Object* GetThisObject() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
534
Ian Rogers0c7abda2012-09-19 13:33:42 -0700535 size_t GetNativePcOffset() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
536
Ian Rogersef7d42f2014-01-06 12:55:46 -0800537 uintptr_t* CalleeSaveAddress(int num, size_t frame_size) const
538 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers0399dde2012-06-06 17:09:28 -0700539 // Callee saves are held at the top of the frame
Ian Rogersef7d42f2014-01-06 12:55:46 -0800540 DCHECK(GetMethod() != nullptr);
Ian Rogers0399dde2012-06-06 17:09:28 -0700541 byte* save_addr =
542 reinterpret_cast<byte*>(cur_quick_frame_) + frame_size - ((num + 1) * kPointerSize);
Andreas Gampebf6b92a2014-03-05 16:11:04 -0800543#if defined(__i386__) || defined(__x86_64__)
Ian Rogers0399dde2012-06-06 17:09:28 -0700544 save_addr -= kPointerSize; // account for return address
545#endif
Mathieu Chartier67022432012-11-29 18:04:50 -0800546 return reinterpret_cast<uintptr_t*>(save_addr);
Ian Rogers0399dde2012-06-06 17:09:28 -0700547 }
548
Elliott Hughes08fc03a2012-06-26 17:34:00 -0700549 // Returns the height of the stack in the managed stack frames, including transitions.
Ian Rogersb726dcb2012-09-05 08:57:23 -0700550 size_t GetFrameHeight() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers62d6c772013-02-27 08:32:07 -0800551 return GetNumFrames() - cur_depth_ - 1;
Ian Rogers0399dde2012-06-06 17:09:28 -0700552 }
553
Elliott Hughes08fc03a2012-06-26 17:34:00 -0700554 // Returns a frame ID for JDWP use, starting from 1.
Ian Rogersb726dcb2012-09-05 08:57:23 -0700555 size_t GetFrameId() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers0399dde2012-06-06 17:09:28 -0700556 return GetFrameHeight() + 1;
557 }
558
Ian Rogersb726dcb2012-09-05 08:57:23 -0700559 size_t GetNumFrames() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers0399dde2012-06-06 17:09:28 -0700560 if (num_frames_ == 0) {
Ian Rogers7a22fa62013-01-23 12:16:16 -0800561 num_frames_ = ComputeNumFrames(thread_);
Ian Rogers0399dde2012-06-06 17:09:28 -0700562 }
563 return num_frames_;
564 }
565
Brian Carlstromea46f952013-07-30 01:26:50 -0700566 uint32_t GetVReg(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind) const
Ian Rogers2bcb4a42012-11-08 10:39:18 -0800567 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers0399dde2012-06-06 17:09:28 -0700568
Brian Carlstromea46f952013-07-30 01:26:50 -0700569 void SetVReg(mirror::ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind)
Ian Rogersb726dcb2012-09-05 08:57:23 -0700570 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers0399dde2012-06-06 17:09:28 -0700571
Mathieu Chartier815873e2014-02-13 18:02:13 -0800572 uintptr_t* GetGPRAddress(uint32_t reg) const;
Ian Rogers0399dde2012-06-06 17:09:28 -0700573 uintptr_t GetGPR(uint32_t reg) const;
Mathieu Chartier67022432012-11-29 18:04:50 -0800574 void SetGPR(uint32_t reg, uintptr_t value);
Ian Rogers0399dde2012-06-06 17:09:28 -0700575
Mathieu Chartier423d2a32013-09-12 17:33:56 -0700576 // This is a fast-path for getting/setting values in a quick frame.
577 uint32_t* GetVRegAddr(mirror::ArtMethod** cur_quick_frame, const DexFile::CodeItem* code_item,
Ian Rogersef7d42f2014-01-06 12:55:46 -0800578 uint32_t core_spills, uint32_t fp_spills, size_t frame_size,
579 uint16_t vreg) const {
Ian Rogers0399dde2012-06-06 17:09:28 -0700580 int offset = GetVRegOffset(code_item, core_spills, fp_spills, frame_size, vreg);
Ian Rogers0ec569a2012-07-01 16:43:46 -0700581 DCHECK_EQ(cur_quick_frame, GetCurrentQuickFrame());
582 byte* vreg_addr = reinterpret_cast<byte*>(cur_quick_frame) + offset;
Mathieu Chartier423d2a32013-09-12 17:33:56 -0700583 return reinterpret_cast<uint32_t*>(vreg_addr);
Ian Rogers0399dde2012-06-06 17:09:28 -0700584 }
585
Ian Rogersef7d42f2014-01-06 12:55:46 -0800586 uintptr_t GetReturnPc() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers0399dde2012-06-06 17:09:28 -0700587
Ian Rogersef7d42f2014-01-06 12:55:46 -0800588 void SetReturnPc(uintptr_t new_ret_pc) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers0399dde2012-06-06 17:09:28 -0700589
590 /*
591 * Return sp-relative offset for a Dalvik virtual register, compiler
592 * spill or Method* in bytes using Method*.
Razvan A Lupusoruda7a69b2014-01-08 15:09:50 -0800593 * Note that (reg >= 0) refers to a Dalvik register, (reg == -1)
594 * denotes an invalid Dalvik register, (reg == -2) denotes Method*
595 * and (reg <= -3) denotes a compiler temporary. A compiler temporary
596 * can be thought of as a virtual register that does not exist in the
597 * dex but holds intermediate values to help optimizations and code
598 * generation. A special compiler temporary is one whose location
599 * in frame is well known while non-special ones do not have a requirement
600 * on location in frame as long as code generator itself knows how
601 * to access them.
Ian Rogers0399dde2012-06-06 17:09:28 -0700602 *
603 * +------------------------+
604 * | IN[ins-1] | {Note: resides in caller's frame}
605 * | . |
606 * | IN[0] |
607 * | caller's Method* |
608 * +========================+ {Note: start of callee's frame}
609 * | core callee-save spill | {variable sized}
610 * +------------------------+
611 * | fp callee-save spill |
612 * +------------------------+
613 * | filler word | {For compatibility, if V[locals-1] used as wide
614 * +------------------------+
615 * | V[locals-1] |
616 * | V[locals-2] |
617 * | . |
618 * | . | ... (reg == 2)
619 * | V[1] | ... (reg == 1)
620 * | V[0] | ... (reg == 0) <---- "locals_start"
621 * +------------------------+
Razvan A Lupusoruda7a69b2014-01-08 15:09:50 -0800622 * | Compiler temp region | ... (reg <= -3)
623 * | |
624 * | |
Ian Rogers0399dde2012-06-06 17:09:28 -0700625 * +------------------------+
626 * | stack alignment padding| {0 to (kStackAlignWords-1) of padding}
627 * +------------------------+
628 * | OUT[outs-1] |
629 * | OUT[outs-2] |
630 * | . |
631 * | OUT[0] |
Razvan A Lupusoruda7a69b2014-01-08 15:09:50 -0800632 * | curMethod* | ... (reg == -2) <<== sp, 16-byte aligned
Ian Rogers0399dde2012-06-06 17:09:28 -0700633 * +========================+
634 */
635 static int GetVRegOffset(const DexFile::CodeItem* code_item,
Ian Rogersb23a7722012-10-09 16:54:26 -0700636 uint32_t core_spills, uint32_t fp_spills,
637 size_t frame_size, int reg) {
Ian Rogers0399dde2012-06-06 17:09:28 -0700638 DCHECK_EQ(frame_size & (kStackAlignment - 1), 0U);
Razvan A Lupusoruda7a69b2014-01-08 15:09:50 -0800639 DCHECK_NE(reg, static_cast<int>(kVRegInvalid));
640
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700641 int num_spills = __builtin_popcount(core_spills) + __builtin_popcount(fp_spills) + 1; // Filler.
Ian Rogers0399dde2012-06-06 17:09:28 -0700642 int num_ins = code_item->ins_size_;
643 int num_regs = code_item->registers_size_ - num_ins;
644 int locals_start = frame_size - ((num_spills + num_regs) * sizeof(uint32_t));
Razvan A Lupusoruda7a69b2014-01-08 15:09:50 -0800645 if (reg == static_cast<int>(kVRegMethodPtrBaseReg)) {
646 // The current method pointer corresponds to special location on stack.
647 return 0;
648 } else if (reg <= static_cast<int>(kVRegNonSpecialTempBaseReg)) {
649 /*
650 * Special temporaries may have custom locations and the logic above deals with that.
651 * However, non-special temporaries are placed relative to the locals. Since the
652 * virtual register numbers for temporaries "grow" in negative direction, reg number
653 * will always be <= to the temp base reg. Thus, the logic ensures that the first
654 * temp is at offset -4 bytes from locals, the second is at -8 bytes from locals,
655 * and so on.
656 */
657 int relative_offset = (reg + std::abs(static_cast<int>(kVRegNonSpecialTempBaseReg)) - 1) * sizeof(uint32_t);
658 return locals_start + relative_offset;
659 } else if (reg < num_regs) {
660 return locals_start + (reg * sizeof(uint32_t));
Ian Rogers0399dde2012-06-06 17:09:28 -0700661 } else {
Razvan A Lupusoru3bc01742014-02-06 13:18:43 -0800662 // Handle ins.
663 return frame_size + ((reg - num_regs) * sizeof(uint32_t)) + sizeof(StackReference<mirror::ArtMethod>);
Ian Rogers0399dde2012-06-06 17:09:28 -0700664 }
665 }
666
Razvan A Lupusoru3bc01742014-02-06 13:18:43 -0800667 static int GetOutVROffset(uint16_t out_num) {
668 // According to stack model, the first out is above the Method ptr.
669 return sizeof(StackReference<mirror::ArtMethod>) + (out_num * sizeof(uint32_t));
670 }
671
Ian Rogers0399dde2012-06-06 17:09:28 -0700672 uintptr_t GetCurrentQuickFramePc() const {
673 return cur_quick_frame_pc_;
674 }
675
Brian Carlstromea46f952013-07-30 01:26:50 -0700676 mirror::ArtMethod** GetCurrentQuickFrame() const {
Ian Rogers0399dde2012-06-06 17:09:28 -0700677 return cur_quick_frame_;
678 }
679
680 ShadowFrame* GetCurrentShadowFrame() const {
681 return cur_shadow_frame_;
682 }
683
Elliott Hughes08fc03a2012-06-26 17:34:00 -0700684 StackIndirectReferenceTable* GetCurrentSirt() const {
Brian Carlstromea46f952013-07-30 01:26:50 -0700685 mirror::ArtMethod** sp = GetCurrentQuickFrame();
Brian Carlstrom7934ac22013-07-26 10:54:15 -0700686 ++sp; // Skip Method*; SIRT comes next;
Elliott Hughes08fc03a2012-06-26 17:34:00 -0700687 return reinterpret_cast<StackIndirectReferenceTable*>(sp);
688 }
689
Ian Rogers40e3bac2012-11-20 00:09:14 -0800690 std::string DescribeLocation() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
691
Ian Rogers7a22fa62013-01-23 12:16:16 -0800692 static size_t ComputeNumFrames(Thread* thread) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers306057f2012-11-26 12:45:53 -0800693
Ian Rogers7a22fa62013-01-23 12:16:16 -0800694 static void DescribeStack(Thread* thread) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers306057f2012-11-26 12:45:53 -0800695
Ian Rogers0399dde2012-06-06 17:09:28 -0700696 private:
Sebastien Hertz74e256b2013-10-04 10:40:37 +0200697 instrumentation::InstrumentationStackFrame& GetInstrumentationStackFrame(uint32_t depth) const;
Ian Rogers0399dde2012-06-06 17:09:28 -0700698
Ian Rogersb726dcb2012-09-05 08:57:23 -0700699 void SanityCheckFrame() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Ian Rogers0399dde2012-06-06 17:09:28 -0700700
Ian Rogers7a22fa62013-01-23 12:16:16 -0800701 Thread* const thread_;
Ian Rogers0399dde2012-06-06 17:09:28 -0700702 ShadowFrame* cur_shadow_frame_;
Brian Carlstromea46f952013-07-30 01:26:50 -0700703 mirror::ArtMethod** cur_quick_frame_;
Ian Rogers0399dde2012-06-06 17:09:28 -0700704 uintptr_t cur_quick_frame_pc_;
705 // Lazily computed, number of frames in the stack.
706 size_t num_frames_;
707 // Depth of the frame we're currently at.
708 size_t cur_depth_;
Brian Carlstrom0cd7ec22013-07-17 23:40:20 -0700709
Ian Rogers0399dde2012-06-06 17:09:28 -0700710 protected:
711 Context* const context_;
712};
713
Elliott Hughes68e76522011-10-05 13:22:16 -0700714} // namespace art
715
Brian Carlstromfc0e3212013-07-17 14:40:12 -0700716#endif // ART_RUNTIME_STACK_H_