blob: 6b5218dff0d3a9debb67c680663192715f94e5e3 [file] [log] [blame]
Ian Rogers2fa6b2e2012-10-17 00:10:17 -07001/*
2 * Copyright (C) 2012 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
Andreas Gampe3cfa4d02015-10-06 17:04:01 -070017#include "interpreter.h"
Ian Rogersb0fa5dc2014-04-28 16:47:08 -070018
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +010019#include <limits>
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080020
Andreas Gampe103992b2016-01-04 15:32:43 -080021#include "common_throws.h"
Andreas Gampe3cfa4d02015-10-06 17:04:01 -070022#include "interpreter_common.h"
Ian Rogersb0fa5dc2014-04-28 16:47:08 -070023#include "mirror/string-inl.h"
Andreas Gampe2969bcd2015-03-09 12:57:41 -070024#include "scoped_thread_state_change.h"
25#include "ScopedLocalRef.h"
Andreas Gampeb3025922015-09-01 14:45:00 -070026#include "stack.h"
Andreas Gampe2969bcd2015-03-09 12:57:41 -070027#include "unstarted_runtime.h"
buzbee1452bee2015-03-06 14:43:04 -080028#include "mterp/mterp.h"
Ian Rogersb0fa5dc2014-04-28 16:47:08 -070029
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070030namespace art {
31namespace interpreter {
32
Ian Rogersfc0e94b2013-09-23 23:51:32 -070033static void InterpreterJni(Thread* self, ArtMethod* method, const StringPiece& shorty,
Jeff Hao5d917302013-02-27 17:57:33 -080034 Object* receiver, uint32_t* args, JValue* result)
Mathieu Chartier90443472015-07-16 20:32:27 -070035 SHARED_REQUIRES(Locks::mutator_lock_) {
Ian Rogers64b6d142012-10-29 16:34:15 -070036 // TODO: The following enters JNI code using a typedef-ed function rather than the JNI compiler,
37 // it should be removed and JNI compiled stubs used instead.
38 ScopedObjectAccessUnchecked soa(self);
39 if (method->IsStatic()) {
40 if (shorty == "L") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +010041 typedef jobject (fntype)(JNIEnv*, jclass);
Mathieu Chartier2d721012014-11-10 11:08:06 -080042 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -070043 ScopedLocalRef<jclass> klass(soa.Env(),
44 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
Ian Rogers556d6372012-11-20 12:19:36 -080045 jobject jresult;
46 {
47 ScopedThreadStateChange tsc(self, kNative);
48 jresult = fn(soa.Env(), klass.get());
49 }
50 result->SetL(soa.Decode<Object*>(jresult));
Ian Rogers64b6d142012-10-29 16:34:15 -070051 } else if (shorty == "V") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +010052 typedef void (fntype)(JNIEnv*, jclass);
Mathieu Chartier2d721012014-11-10 11:08:06 -080053 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -070054 ScopedLocalRef<jclass> klass(soa.Env(),
55 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
56 ScopedThreadStateChange tsc(self, kNative);
57 fn(soa.Env(), klass.get());
58 } else if (shorty == "Z") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +010059 typedef jboolean (fntype)(JNIEnv*, jclass);
Mathieu Chartier2d721012014-11-10 11:08:06 -080060 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -070061 ScopedLocalRef<jclass> klass(soa.Env(),
62 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
63 ScopedThreadStateChange tsc(self, kNative);
64 result->SetZ(fn(soa.Env(), klass.get()));
65 } else if (shorty == "BI") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +010066 typedef jbyte (fntype)(JNIEnv*, jclass, jint);
Mathieu Chartier2d721012014-11-10 11:08:06 -080067 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -070068 ScopedLocalRef<jclass> klass(soa.Env(),
69 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
70 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -080071 result->SetB(fn(soa.Env(), klass.get(), args[0]));
Ian Rogers64b6d142012-10-29 16:34:15 -070072 } else if (shorty == "II") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +010073 typedef jint (fntype)(JNIEnv*, jclass, jint);
Mathieu Chartier2d721012014-11-10 11:08:06 -080074 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -070075 ScopedLocalRef<jclass> klass(soa.Env(),
76 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
77 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -080078 result->SetI(fn(soa.Env(), klass.get(), args[0]));
Ian Rogers64b6d142012-10-29 16:34:15 -070079 } else if (shorty == "LL") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +010080 typedef jobject (fntype)(JNIEnv*, jclass, jobject);
Mathieu Chartier2d721012014-11-10 11:08:06 -080081 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -070082 ScopedLocalRef<jclass> klass(soa.Env(),
83 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
84 ScopedLocalRef<jobject> arg0(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -070085 soa.AddLocalReference<jobject>(
86 reinterpret_cast<Object*>(args[0])));
Ian Rogers556d6372012-11-20 12:19:36 -080087 jobject jresult;
88 {
89 ScopedThreadStateChange tsc(self, kNative);
90 jresult = fn(soa.Env(), klass.get(), arg0.get());
91 }
92 result->SetL(soa.Decode<Object*>(jresult));
Ian Rogers64b6d142012-10-29 16:34:15 -070093 } else if (shorty == "IIZ") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +010094 typedef jint (fntype)(JNIEnv*, jclass, jint, jboolean);
Mathieu Chartier2d721012014-11-10 11:08:06 -080095 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -070096 ScopedLocalRef<jclass> klass(soa.Env(),
97 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
98 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -080099 result->SetI(fn(soa.Env(), klass.get(), args[0], args[1]));
Ian Rogers64b6d142012-10-29 16:34:15 -0700100 } else if (shorty == "ILI") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100101 typedef jint (fntype)(JNIEnv*, jclass, jobject, jint);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800102 fntype* const fn = reinterpret_cast<fntype*>(const_cast<void*>(
103 method->GetEntryPointFromJni()));
Ian Rogers64b6d142012-10-29 16:34:15 -0700104 ScopedLocalRef<jclass> klass(soa.Env(),
105 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
106 ScopedLocalRef<jobject> arg0(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700107 soa.AddLocalReference<jobject>(
108 reinterpret_cast<Object*>(args[0])));
Ian Rogers64b6d142012-10-29 16:34:15 -0700109 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -0800110 result->SetI(fn(soa.Env(), klass.get(), arg0.get(), args[1]));
Ian Rogers64b6d142012-10-29 16:34:15 -0700111 } else if (shorty == "SIZ") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100112 typedef jshort (fntype)(JNIEnv*, jclass, jint, jboolean);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700113 fntype* const fn =
114 reinterpret_cast<fntype*>(const_cast<void*>(method->GetEntryPointFromJni()));
Ian Rogers64b6d142012-10-29 16:34:15 -0700115 ScopedLocalRef<jclass> klass(soa.Env(),
116 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
117 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -0800118 result->SetS(fn(soa.Env(), klass.get(), args[0], args[1]));
Ian Rogers64b6d142012-10-29 16:34:15 -0700119 } else if (shorty == "VIZ") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100120 typedef void (fntype)(JNIEnv*, jclass, jint, jboolean);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800121 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -0700122 ScopedLocalRef<jclass> klass(soa.Env(),
123 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
124 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -0800125 fn(soa.Env(), klass.get(), args[0], args[1]);
Ian Rogers64b6d142012-10-29 16:34:15 -0700126 } else if (shorty == "ZLL") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100127 typedef jboolean (fntype)(JNIEnv*, jclass, jobject, jobject);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800128 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -0700129 ScopedLocalRef<jclass> klass(soa.Env(),
130 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
131 ScopedLocalRef<jobject> arg0(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700132 soa.AddLocalReference<jobject>(
133 reinterpret_cast<Object*>(args[0])));
Ian Rogers64b6d142012-10-29 16:34:15 -0700134 ScopedLocalRef<jobject> arg1(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700135 soa.AddLocalReference<jobject>(
136 reinterpret_cast<Object*>(args[1])));
Ian Rogers64b6d142012-10-29 16:34:15 -0700137 ScopedThreadStateChange tsc(self, kNative);
138 result->SetZ(fn(soa.Env(), klass.get(), arg0.get(), arg1.get()));
139 } else if (shorty == "ZILL") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100140 typedef jboolean (fntype)(JNIEnv*, jclass, jint, jobject, jobject);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800141 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -0700142 ScopedLocalRef<jclass> klass(soa.Env(),
143 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
144 ScopedLocalRef<jobject> arg1(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700145 soa.AddLocalReference<jobject>(
146 reinterpret_cast<Object*>(args[1])));
Ian Rogers64b6d142012-10-29 16:34:15 -0700147 ScopedLocalRef<jobject> arg2(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700148 soa.AddLocalReference<jobject>(
149 reinterpret_cast<Object*>(args[2])));
Ian Rogers64b6d142012-10-29 16:34:15 -0700150 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -0800151 result->SetZ(fn(soa.Env(), klass.get(), args[0], arg1.get(), arg2.get()));
Ian Rogers64b6d142012-10-29 16:34:15 -0700152 } else if (shorty == "VILII") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100153 typedef void (fntype)(JNIEnv*, jclass, jint, jobject, jint, jint);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800154 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -0700155 ScopedLocalRef<jclass> klass(soa.Env(),
156 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
157 ScopedLocalRef<jobject> arg1(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700158 soa.AddLocalReference<jobject>(
159 reinterpret_cast<Object*>(args[1])));
Ian Rogers64b6d142012-10-29 16:34:15 -0700160 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -0800161 fn(soa.Env(), klass.get(), args[0], arg1.get(), args[2], args[3]);
Ian Rogers64b6d142012-10-29 16:34:15 -0700162 } else if (shorty == "VLILII") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100163 typedef void (fntype)(JNIEnv*, jclass, jobject, jint, jobject, jint, jint);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800164 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -0700165 ScopedLocalRef<jclass> klass(soa.Env(),
166 soa.AddLocalReference<jclass>(method->GetDeclaringClass()));
167 ScopedLocalRef<jobject> arg0(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700168 soa.AddLocalReference<jobject>(
169 reinterpret_cast<Object*>(args[0])));
Ian Rogers64b6d142012-10-29 16:34:15 -0700170 ScopedLocalRef<jobject> arg2(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700171 soa.AddLocalReference<jobject>(
172 reinterpret_cast<Object*>(args[2])));
Ian Rogers64b6d142012-10-29 16:34:15 -0700173 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -0800174 fn(soa.Env(), klass.get(), arg0.get(), args[1], arg2.get(), args[3], args[4]);
Ian Rogers64b6d142012-10-29 16:34:15 -0700175 } else {
176 LOG(FATAL) << "Do something with static native method: " << PrettyMethod(method)
177 << " shorty: " << shorty;
178 }
179 } else {
180 if (shorty == "L") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100181 typedef jobject (fntype)(JNIEnv*, jobject);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800182 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -0700183 ScopedLocalRef<jobject> rcvr(soa.Env(),
184 soa.AddLocalReference<jobject>(receiver));
Ian Rogers556d6372012-11-20 12:19:36 -0800185 jobject jresult;
186 {
187 ScopedThreadStateChange tsc(self, kNative);
188 jresult = fn(soa.Env(), rcvr.get());
189 }
190 result->SetL(soa.Decode<Object*>(jresult));
Jeff Hao3dd9f762013-07-08 13:09:25 -0700191 } else if (shorty == "V") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100192 typedef void (fntype)(JNIEnv*, jobject);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800193 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Jeff Hao3dd9f762013-07-08 13:09:25 -0700194 ScopedLocalRef<jobject> rcvr(soa.Env(),
195 soa.AddLocalReference<jobject>(receiver));
196 ScopedThreadStateChange tsc(self, kNative);
197 fn(soa.Env(), rcvr.get());
Ian Rogers64b6d142012-10-29 16:34:15 -0700198 } else if (shorty == "LL") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100199 typedef jobject (fntype)(JNIEnv*, jobject, jobject);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800200 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -0700201 ScopedLocalRef<jobject> rcvr(soa.Env(),
202 soa.AddLocalReference<jobject>(receiver));
203 ScopedLocalRef<jobject> arg0(soa.Env(),
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700204 soa.AddLocalReference<jobject>(
205 reinterpret_cast<Object*>(args[0])));
Ian Rogers556d6372012-11-20 12:19:36 -0800206 jobject jresult;
207 {
208 ScopedThreadStateChange tsc(self, kNative);
209 jresult = fn(soa.Env(), rcvr.get(), arg0.get());
Ian Rogers556d6372012-11-20 12:19:36 -0800210 }
211 result->SetL(soa.Decode<Object*>(jresult));
Ian Rogers64b6d142012-10-29 16:34:15 -0700212 ScopedThreadStateChange tsc(self, kNative);
Ian Rogers64b6d142012-10-29 16:34:15 -0700213 } else if (shorty == "III") {
Bernhard Rosenkränzer46053622013-12-12 02:15:52 +0100214 typedef jint (fntype)(JNIEnv*, jobject, jint, jint);
Mathieu Chartier2d721012014-11-10 11:08:06 -0800215 fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
Ian Rogers64b6d142012-10-29 16:34:15 -0700216 ScopedLocalRef<jobject> rcvr(soa.Env(),
217 soa.AddLocalReference<jobject>(receiver));
218 ScopedThreadStateChange tsc(self, kNative);
Jeff Hao5d917302013-02-27 17:57:33 -0800219 result->SetI(fn(soa.Env(), rcvr.get(), args[0], args[1]));
Ian Rogers64b6d142012-10-29 16:34:15 -0700220 } else {
221 LOG(FATAL) << "Do something with native method: " << PrettyMethod(method)
222 << " shorty: " << shorty;
223 }
224 }
225}
226
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200227enum InterpreterImplKind {
buzbee1452bee2015-03-06 14:43:04 -0800228 kSwitchImplKind, // Switch-based interpreter implementation.
229 kComputedGotoImplKind, // Computed-goto-based interpreter implementation.
230 kMterpImplKind // Assembly interpreter
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200231};
Andreas Gampe277ccbd2014-11-03 21:36:10 -0800232static std::ostream& operator<<(std::ostream& os, const InterpreterImplKind& rhs) {
buzbee1452bee2015-03-06 14:43:04 -0800233 os << ((rhs == kSwitchImplKind)
234 ? "Switch-based interpreter"
235 : (rhs == kComputedGotoImplKind)
236 ? "Computed-goto-based interpreter"
237 : "Asm interpreter");
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700238 return os;
239}
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700240
Sebastien Hertzfa888d02014-09-30 12:00:11 +0200241#if !defined(__clang__)
buzbee1452bee2015-03-06 14:43:04 -0800242#if defined(__arm__)
243// TODO: remove when all targets implemented.
244static constexpr InterpreterImplKind kInterpreterImplKind = kMterpImplKind;
245#else
Ian Rogersb48b9eb2014-02-28 16:20:21 -0800246static constexpr InterpreterImplKind kInterpreterImplKind = kComputedGotoImplKind;
buzbee1452bee2015-03-06 14:43:04 -0800247#endif
Sebastien Hertzfa888d02014-09-30 12:00:11 +0200248#else
249// Clang 3.4 fails to build the goto interpreter implementation.
buzbee1452bee2015-03-06 14:43:04 -0800250#if defined(__arm__)
251static constexpr InterpreterImplKind kInterpreterImplKind = kMterpImplKind;
252#else
253static constexpr InterpreterImplKind kInterpreterImplKind = kSwitchImplKind;
254#endif
Sebastien Hertzfa888d02014-09-30 12:00:11 +0200255template<bool do_access_check, bool transaction_active>
Ian Rogerse94652f2014-12-02 11:13:19 -0800256JValue ExecuteGotoImpl(Thread*, const DexFile::CodeItem*, ShadowFrame&, JValue) {
Sebastien Hertzfa888d02014-09-30 12:00:11 +0200257 LOG(FATAL) << "UNREACHABLE";
Ian Rogers2c4257b2014-10-24 14:20:06 -0700258 UNREACHABLE();
Sebastien Hertzfa888d02014-09-30 12:00:11 +0200259}
260// Explicit definitions of ExecuteGotoImpl.
Mathieu Chartier90443472015-07-16 20:32:27 -0700261template<> SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -0800262JValue ExecuteGotoImpl<true, false>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzfa888d02014-09-30 12:00:11 +0200263 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -0700264template<> SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -0800265JValue ExecuteGotoImpl<false, false>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzfa888d02014-09-30 12:00:11 +0200266 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -0700267template<> SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -0800268JValue ExecuteGotoImpl<true, true>(Thread* self, const DexFile::CodeItem* code_item,
269 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -0700270template<> SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -0800271JValue ExecuteGotoImpl<false, true>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzfa888d02014-09-30 12:00:11 +0200272 ShadowFrame& shadow_frame, JValue result_register);
Sebastien Hertzfa888d02014-09-30 12:00:11 +0200273#endif
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700274
Ian Rogerse94652f2014-12-02 11:13:19 -0800275static JValue Execute(Thread* self, const DexFile::CodeItem* code_item, ShadowFrame& shadow_frame,
276 JValue result_register)
Mathieu Chartier90443472015-07-16 20:32:27 -0700277 SHARED_REQUIRES(Locks::mutator_lock_);
Sebastien Hertz233ea8e2013-06-06 11:57:09 +0200278
Ian Rogerse94652f2014-12-02 11:13:19 -0800279static inline JValue Execute(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertz233ea8e2013-06-06 11:57:09 +0200280 ShadowFrame& shadow_frame, JValue result_register) {
buzbee1452bee2015-03-06 14:43:04 -0800281 DCHECK(!shadow_frame.GetMethod()->IsAbstract());
Ian Rogers848871b2013-08-05 10:56:33 -0700282 DCHECK(!shadow_frame.GetMethod()->IsNative());
Sebastien Hertz4e99b3d2014-06-24 14:35:40 +0200283 shadow_frame.GetMethod()->GetDeclaringClass()->AssertInitializedOrInitializingInThread(self);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200284
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100285 bool transaction_active = Runtime::Current()->IsActiveTransaction();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200286 if (LIKELY(shadow_frame.GetMethod()->IsPreverified())) {
Sebastien Hertz233ea8e2013-06-06 11:57:09 +0200287 // Enter the "without access check" interpreter.
buzbee1452bee2015-03-06 14:43:04 -0800288 if (kInterpreterImplKind == kMterpImplKind) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100289 if (transaction_active) {
buzbee1452bee2015-03-06 14:43:04 -0800290 // No Mterp variant - just use the switch interpreter.
291 return ExecuteSwitchImpl<false, true>(self, code_item, shadow_frame, result_register,
292 false);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100293 } else {
buzbee1452bee2015-03-06 14:43:04 -0800294 const instrumentation::Instrumentation* const instrumentation =
295 Runtime::Current()->GetInstrumentation();
296 while (true) {
buzbee64320f92016-01-12 12:45:51 -0800297 if (instrumentation->IsActive() || !Runtime::Current()->IsStarted()) {
buzbee1452bee2015-03-06 14:43:04 -0800298 // TODO: allow JIT profiling instrumentation. Now, just punt on all instrumentation.
299#if !defined(__clang__)
300 return ExecuteGotoImpl<false, false>(self, code_item, shadow_frame, result_register);
301#else
302 return ExecuteSwitchImpl<false, false>(self, code_item, shadow_frame, result_register,
303 false);
304#endif
305 }
306 bool returned = ExecuteMterpImpl(self, code_item, &shadow_frame, &result_register);
307 if (returned) {
308 return result_register;
309 } else {
310 // Mterp didn't like that instruction. Single-step it with the reference interpreter.
311 JValue res = ExecuteSwitchImpl<false, false>(self, code_item, shadow_frame,
312 result_register, true);
313 if (shadow_frame.GetDexPC() == DexFile::kDexNoIndex) {
314 // Single-stepped a return or an exception not handled locally. Return to caller.
315 return res;
316 }
317 }
318 }
319 }
320 } else if (kInterpreterImplKind == kSwitchImplKind) {
321 if (transaction_active) {
322 return ExecuteSwitchImpl<false, true>(self, code_item, shadow_frame, result_register,
323 false);
324 } else {
325 return ExecuteSwitchImpl<false, false>(self, code_item, shadow_frame, result_register,
326 false);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100327 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200328 } else {
329 DCHECK_EQ(kInterpreterImplKind, kComputedGotoImplKind);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100330 if (transaction_active) {
Ian Rogerse94652f2014-12-02 11:13:19 -0800331 return ExecuteGotoImpl<false, true>(self, code_item, shadow_frame, result_register);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100332 } else {
Ian Rogerse94652f2014-12-02 11:13:19 -0800333 return ExecuteGotoImpl<false, false>(self, code_item, shadow_frame, result_register);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100334 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200335 }
Sebastien Hertz233ea8e2013-06-06 11:57:09 +0200336 } else {
337 // Enter the "with access check" interpreter.
buzbee1452bee2015-03-06 14:43:04 -0800338 if (kInterpreterImplKind == kMterpImplKind) {
339 // No access check variants for Mterp. Just use the switch version.
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100340 if (transaction_active) {
buzbee1452bee2015-03-06 14:43:04 -0800341 return ExecuteSwitchImpl<true, true>(self, code_item, shadow_frame, result_register,
342 false);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100343 } else {
buzbee1452bee2015-03-06 14:43:04 -0800344 return ExecuteSwitchImpl<true, false>(self, code_item, shadow_frame, result_register,
345 false);
346 }
347 } else if (kInterpreterImplKind == kSwitchImplKind) {
348 if (transaction_active) {
349 return ExecuteSwitchImpl<true, true>(self, code_item, shadow_frame, result_register,
350 false);
351 } else {
352 return ExecuteSwitchImpl<true, false>(self, code_item, shadow_frame, result_register,
353 false);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100354 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200355 } else {
356 DCHECK_EQ(kInterpreterImplKind, kComputedGotoImplKind);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100357 if (transaction_active) {
Ian Rogerse94652f2014-12-02 11:13:19 -0800358 return ExecuteGotoImpl<true, true>(self, code_item, shadow_frame, result_register);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100359 } else {
Ian Rogerse94652f2014-12-02 11:13:19 -0800360 return ExecuteGotoImpl<true, false>(self, code_item, shadow_frame, result_register);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100361 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200362 }
Sebastien Hertz233ea8e2013-06-06 11:57:09 +0200363 }
364}
365
Brian Carlstromea46f952013-07-30 01:26:50 -0700366void EnterInterpreterFromInvoke(Thread* self, ArtMethod* method, Object* receiver,
Jeff Hao6474d192013-03-26 14:08:09 -0700367 uint32_t* args, JValue* result) {
Ian Rogers64b6d142012-10-29 16:34:15 -0700368 DCHECK_EQ(self, Thread::Current());
Nicolas Geoffray535a3fb2014-07-22 15:17:38 +0100369 bool implicit_check = !Runtime::Current()->ExplicitStackOverflowChecks();
370 if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEndForInterpreter(implicit_check))) {
jeffhaod7521322012-11-21 15:38:24 -0800371 ThrowStackOverflowError(self);
372 return;
373 }
374
Mathieu Chartiere861ebd2013-10-09 15:01:21 -0700375 const char* old_cause = self->StartAssertNoThreadSuspension("EnterInterpreterFromInvoke");
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700376 const DexFile::CodeItem* code_item = method->GetCodeItem();
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700377 uint16_t num_regs;
378 uint16_t num_ins;
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700379 if (code_item != nullptr) {
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700380 num_regs = code_item->registers_size_;
381 num_ins = code_item->ins_size_;
Alex Light9139e002015-10-09 15:59:48 -0700382 } else if (!method->IsInvokable()) {
Mathieu Chartiere861ebd2013-10-09 15:01:21 -0700383 self->EndAssertNoThreadSuspension(old_cause);
Alex Light9139e002015-10-09 15:59:48 -0700384 method->ThrowInvocationTimeError();
jeffhao0a9bb732012-11-26 12:28:49 -0800385 return;
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700386 } else {
387 DCHECK(method->IsNative());
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700388 num_regs = num_ins = ArtMethod::NumArgRegisters(method->GetShorty());
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700389 if (!method->IsStatic()) {
390 num_regs++;
391 num_ins++;
392 }
393 }
394 // Set up shadow frame with matching number of reference slots to vregs.
395 ShadowFrame* last_shadow_frame = self->GetManagedStack()->GetTopShadowFrame();
Andreas Gampeb3025922015-09-01 14:45:00 -0700396 ShadowFrameAllocaUniquePtr shadow_frame_unique_ptr =
Andreas Gampe03ec9302015-08-27 17:41:47 -0700397 CREATE_SHADOW_FRAME(num_regs, last_shadow_frame, method, /* dex pc */ 0);
Andreas Gampeb3025922015-09-01 14:45:00 -0700398 ShadowFrame* shadow_frame = shadow_frame_unique_ptr.get();
Jeff Hao66135192013-05-14 11:02:41 -0700399 self->PushShadowFrame(shadow_frame);
Mathieu Chartiere861ebd2013-10-09 15:01:21 -0700400
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700401 size_t cur_reg = num_regs - num_ins;
402 if (!method->IsStatic()) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700403 CHECK(receiver != nullptr);
TDYa127ce4cc0d2012-11-18 16:59:53 -0800404 shadow_frame->SetVRegReference(cur_reg, receiver);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700405 ++cur_reg;
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700406 }
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700407 uint32_t shorty_len = 0;
408 const char* shorty = method->GetShorty(&shorty_len);
Jeff Hao5d917302013-02-27 17:57:33 -0800409 for (size_t shorty_pos = 0, arg_pos = 0; cur_reg < num_regs; ++shorty_pos, ++arg_pos, cur_reg++) {
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700410 DCHECK_LT(shorty_pos + 1, shorty_len);
Jeff Hao5d917302013-02-27 17:57:33 -0800411 switch (shorty[shorty_pos + 1]) {
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700412 case 'L': {
Ian Rogersef7d42f2014-01-06 12:55:46 -0800413 Object* o = reinterpret_cast<StackReference<Object>*>(&args[arg_pos])->AsMirrorPtr();
TDYa127ce4cc0d2012-11-18 16:59:53 -0800414 shadow_frame->SetVRegReference(cur_reg, o);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700415 break;
416 }
Jeff Hao5d917302013-02-27 17:57:33 -0800417 case 'J': case 'D': {
418 uint64_t wide_value = (static_cast<uint64_t>(args[arg_pos + 1]) << 32) | args[arg_pos];
419 shadow_frame->SetVRegLong(cur_reg, wide_value);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700420 cur_reg++;
Jeff Hao5d917302013-02-27 17:57:33 -0800421 arg_pos++;
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700422 break;
Jeff Hao5d917302013-02-27 17:57:33 -0800423 }
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700424 default:
Jeff Hao5d917302013-02-27 17:57:33 -0800425 shadow_frame->SetVReg(cur_reg, args[arg_pos]);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700426 break;
427 }
428 }
Mathieu Chartier92246bb2014-02-25 18:22:39 -0800429 self->EndAssertNoThreadSuspension(old_cause);
430 // Do this after populating the shadow frame in case EnsureInitialized causes a GC.
Ian Rogers6c5cb212014-06-18 16:07:20 -0700431 if (method->IsStatic() && UNLIKELY(!method->GetDeclaringClass()->IsInitialized())) {
Mathieu Chartier92246bb2014-02-25 18:22:39 -0800432 ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
Mathieu Chartiereb8167a2014-05-07 15:43:14 -0700433 StackHandleScope<1> hs(self);
434 Handle<mirror::Class> h_class(hs.NewHandle(method->GetDeclaringClass()));
Ian Rogers7b078e82014-09-10 14:44:24 -0700435 if (UNLIKELY(!class_linker->EnsureInitialized(self, h_class, true, true))) {
Mathieu Chartier92246bb2014-02-25 18:22:39 -0800436 CHECK(self->IsExceptionPending());
437 self->PopShadowFrame();
438 return;
439 }
440 }
Ian Rogers64b6d142012-10-29 16:34:15 -0700441 if (LIKELY(!method->IsNative())) {
Ian Rogerse94652f2014-12-02 11:13:19 -0800442 JValue r = Execute(self, code_item, *shadow_frame, JValue());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700443 if (result != nullptr) {
Jeff Hao6474d192013-03-26 14:08:09 -0700444 *result = r;
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700445 }
446 } else {
Ian Rogers64b6d142012-10-29 16:34:15 -0700447 // We don't expect to be asked to interpret native code (which is entered via a JNI compiler
448 // generated stub) except during testing and image writing.
Mathieu Chartier92246bb2014-02-25 18:22:39 -0800449 // Update args to be the args in the shadow frame since the input ones could hold stale
450 // references pointers due to moving GC.
451 args = shadow_frame->GetVRegArgs(method->IsStatic() ? 0 : 1);
Ian Rogers64b6d142012-10-29 16:34:15 -0700452 if (!Runtime::Current()->IsStarted()) {
Andreas Gampe799681b2015-05-15 19:24:12 -0700453 UnstartedRuntime::Jni(self, method, receiver, args, result);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700454 } else {
Jeff Hao6474d192013-03-26 14:08:09 -0700455 InterpreterJni(self, method, shorty, receiver, args, result);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700456 }
457 }
458 self->PopShadowFrame();
459}
460
Nicolas Geoffray73be1e82015-09-17 15:22:56 +0100461void EnterInterpreterFromDeoptimize(Thread* self,
462 ShadowFrame* shadow_frame,
463 bool from_code,
464 JValue* ret_val)
Mathieu Chartier90443472015-07-16 20:32:27 -0700465 SHARED_REQUIRES(Locks::mutator_lock_) {
Jeff Hao11ffc2d2013-02-01 11:52:17 -0800466 JValue value;
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700467 // Set value to last known result in case the shadow frame chain is empty.
468 value.SetJ(ret_val->GetJ());
Sebastien Hertz520633b2015-09-08 17:03:36 +0200469 // Are we executing the first shadow frame?
470 bool first = true;
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700471 while (shadow_frame != nullptr) {
Ian Rogers62d6c772013-02-27 08:32:07 -0800472 self->SetTopOfShadowStack(shadow_frame);
Ian Rogerse94652f2014-12-02 11:13:19 -0800473 const DexFile::CodeItem* code_item = shadow_frame->GetMethod()->GetCodeItem();
Sebastien Hertz270a0e12015-01-16 19:49:09 +0100474 const uint32_t dex_pc = shadow_frame->GetDexPC();
Nicolas Geoffray73be1e82015-09-17 15:22:56 +0100475 uint32_t new_dex_pc = dex_pc;
Sebastien Hertz270a0e12015-01-16 19:49:09 +0100476 if (UNLIKELY(self->IsExceptionPending())) {
Sebastien Hertz520633b2015-09-08 17:03:36 +0200477 // If we deoptimize from the QuickExceptionHandler, we already reported the exception to
478 // the instrumentation. To prevent from reporting it a second time, we simply pass a
479 // null Instrumentation*.
Sebastien Hertz270a0e12015-01-16 19:49:09 +0100480 const instrumentation::Instrumentation* const instrumentation =
Sebastien Hertz520633b2015-09-08 17:03:36 +0200481 first ? nullptr : Runtime::Current()->GetInstrumentation();
Sebastien Hertz270a0e12015-01-16 19:49:09 +0100482 uint32_t found_dex_pc = FindNextInstructionFollowingException(self, *shadow_frame, dex_pc,
483 instrumentation);
484 new_dex_pc = found_dex_pc; // the dex pc of a matching catch handler
485 // or DexFile::kDexNoIndex if there is none.
Nicolas Geoffray73be1e82015-09-17 15:22:56 +0100486 } else if (!from_code) {
487 // For the debugger and full deoptimization stack, we must go past the invoke
488 // instruction, as it already executed.
Mingyao Yangd43b3ac2015-04-01 14:03:04 -0700489 // TODO: should be tested more once b/17586779 is fixed.
Nicolas Geoffray73be1e82015-09-17 15:22:56 +0100490 const Instruction* instr = Instruction::At(&code_item->insns_[dex_pc]);
491 DCHECK(instr->IsInvoke());
492 new_dex_pc = dex_pc + instr->SizeInCodeUnits();
493 } else {
494 // Nothing to do, the dex_pc is the one at which the code requested
495 // the deoptimization.
Sebastien Hertz270a0e12015-01-16 19:49:09 +0100496 }
497 if (new_dex_pc != DexFile::kDexNoIndex) {
498 shadow_frame->SetDexPC(new_dex_pc);
499 value = Execute(self, code_item, *shadow_frame, value);
500 }
Jeff Hao11ffc2d2013-02-01 11:52:17 -0800501 ShadowFrame* old_frame = shadow_frame;
502 shadow_frame = shadow_frame->GetLink();
Christopher Ferris241a9582015-04-27 15:19:41 -0700503 ShadowFrame::DeleteDeoptimizedFrame(old_frame);
Nicolas Geoffray73be1e82015-09-17 15:22:56 +0100504 // Following deoptimizations of shadow frames must pass the invoke instruction.
505 from_code = false;
Sebastien Hertz520633b2015-09-08 17:03:36 +0200506 first = false;
Jeff Hao11ffc2d2013-02-01 11:52:17 -0800507 }
508 ret_val->SetJ(value.GetJ());
509}
510
Ian Rogerse94652f2014-12-02 11:13:19 -0800511JValue EnterInterpreterFromEntryPoint(Thread* self, const DexFile::CodeItem* code_item,
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700512 ShadowFrame* shadow_frame) {
Ian Rogersf3e98552013-03-20 15:49:49 -0700513 DCHECK_EQ(self, Thread::Current());
Nicolas Geoffray535a3fb2014-07-22 15:17:38 +0100514 bool implicit_check = !Runtime::Current()->ExplicitStackOverflowChecks();
515 if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEndForInterpreter(implicit_check))) {
Ian Rogersf3e98552013-03-20 15:49:49 -0700516 ThrowStackOverflowError(self);
517 return JValue();
518 }
519
Ian Rogerse94652f2014-12-02 11:13:19 -0800520 return Execute(self, code_item, *shadow_frame, JValue());
Ian Rogers7db619b2013-01-16 18:35:48 -0800521}
522
Andreas Gampe3cfa4d02015-10-06 17:04:01 -0700523void ArtInterpreterToInterpreterBridge(Thread* self, const DexFile::CodeItem* code_item,
524 ShadowFrame* shadow_frame, JValue* result) {
Nicolas Geoffray535a3fb2014-07-22 15:17:38 +0100525 bool implicit_check = !Runtime::Current()->ExplicitStackOverflowChecks();
526 if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEndForInterpreter(implicit_check))) {
Jeff Hao16743632013-05-08 10:59:04 -0700527 ThrowStackOverflowError(self);
Jeff Hao69510672013-05-21 17:34:55 -0700528 return;
Jeff Hao16743632013-05-08 10:59:04 -0700529 }
530
Mathieu Chartiere861ebd2013-10-09 15:01:21 -0700531 self->PushShadowFrame(shadow_frame);
Alex Lighteb7c1442015-08-31 13:17:42 -0700532 ArtMethod* method = shadow_frame->GetMethod();
Sebastien Hertzc61124b2013-09-10 11:44:19 +0200533 // Ensure static methods are initialized.
Alex Lighteb7c1442015-08-31 13:17:42 -0700534 const bool is_static = method->IsStatic();
Ian Rogerse94652f2014-12-02 11:13:19 -0800535 if (is_static) {
Alex Lighteb7c1442015-08-31 13:17:42 -0700536 mirror::Class* declaring_class = method->GetDeclaringClass();
Ian Rogers6c5cb212014-06-18 16:07:20 -0700537 if (UNLIKELY(!declaring_class->IsInitialized())) {
Mathieu Chartier0cd81352014-05-22 16:48:55 -0700538 StackHandleScope<1> hs(self);
539 HandleWrapper<Class> h_declaring_class(hs.NewHandleWrapper(&declaring_class));
540 if (UNLIKELY(!Runtime::Current()->GetClassLinker()->EnsureInitialized(
Ian Rogers7b078e82014-09-10 14:44:24 -0700541 self, h_declaring_class, true, true))) {
Mathieu Chartier0cd81352014-05-22 16:48:55 -0700542 DCHECK(self->IsExceptionPending());
Mathieu Chartiere861ebd2013-10-09 15:01:21 -0700543 self->PopShadowFrame();
Sebastien Hertzc61124b2013-09-10 11:44:19 +0200544 return;
545 }
Mathieu Chartier0cd81352014-05-22 16:48:55 -0700546 CHECK(h_declaring_class->IsInitializing());
Jeff Hao16743632013-05-08 10:59:04 -0700547 }
Jeff Hao16743632013-05-08 10:59:04 -0700548 }
Jeff Hao16743632013-05-08 10:59:04 -0700549
Ian Rogerse94652f2014-12-02 11:13:19 -0800550 if (LIKELY(!shadow_frame->GetMethod()->IsNative())) {
551 result->SetJ(Execute(self, code_item, *shadow_frame, JValue()).GetJ());
Jeff Hao16743632013-05-08 10:59:04 -0700552 } else {
553 // We don't expect to be asked to interpret native code (which is entered via a JNI compiler
554 // generated stub) except during testing and image writing.
555 CHECK(!Runtime::Current()->IsStarted());
Ian Rogerse94652f2014-12-02 11:13:19 -0800556 Object* receiver = is_static ? nullptr : shadow_frame->GetVRegReference(0);
557 uint32_t* args = shadow_frame->GetVRegArgs(is_static ? 0 : 1);
Andreas Gampe799681b2015-05-15 19:24:12 -0700558 UnstartedRuntime::Jni(self, shadow_frame->GetMethod(), receiver, args, result);
Jeff Hao16743632013-05-08 10:59:04 -0700559 }
560
561 self->PopShadowFrame();
Jeff Hao16743632013-05-08 10:59:04 -0700562}
563
buzbee1452bee2015-03-06 14:43:04 -0800564void CheckInterpreterAsmConstants() {
565 CheckMterpAsmConstants();
566}
567
568void InitInterpreterTls(Thread* self) {
569 InitMterpTls(self);
570}
571
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700572} // namespace interpreter
573} // namespace art