blob: 78afe56104e41b7e196331d5a630382acc810e93 [file] [log] [blame]
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001/*
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 Gampe5e26eb12016-08-22 17:54:17 -070017#include "interpreter_switch_impl.h"
18
Andreas Gampe542451c2016-07-26 09:02:02 -070019#include "base/enums.h"
Alex Lighteb7c1442015-08-31 13:17:42 -070020#include "experimental_flags.h"
Sebastien Hertz8ece0502013-08-07 11:26:41 +020021#include "interpreter_common.h"
Nicolas Geoffrayb331feb2016-02-05 16:51:53 +000022#include "jit/jit.h"
Mathieu Chartier28bd2e42016-10-04 13:54:57 -070023#include "jvalue-inl.h"
Ian Rogersf72a11d2014-10-30 15:41:08 -070024#include "safe_math.h"
Sebastien Hertz8ece0502013-08-07 11:26:41 +020025
26namespace art {
27namespace interpreter {
28
29#define HANDLE_PENDING_EXCEPTION() \
30 do { \
Sebastien Hertz82aeddb2014-05-20 20:09:45 +020031 DCHECK(self->IsExceptionPending()); \
Ian Rogers7b078e82014-09-10 14:44:24 -070032 self->AllowThreadSuspension(); \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020033 uint32_t found_dex_pc = FindNextInstructionFollowingException(self, shadow_frame, \
34 inst->GetDexPc(insns), \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020035 instrumentation); \
36 if (found_dex_pc == DexFile::kDexNoIndex) { \
Andreas Gampe03ec9302015-08-27 17:41:47 -070037 /* Structured locking is to be enforced for abnormal termination, too. */ \
Andreas Gampe56fdd0e2016-04-28 14:56:54 -070038 DoMonitorCheckOnExit<do_assignability_check>(self, &shadow_frame); \
buzbee1452bee2015-03-06 14:43:04 -080039 if (interpret_one_instruction) { \
buzbee93e94f22016-04-07 13:52:48 -070040 /* Signal mterp to return to caller */ \
buzbee1452bee2015-03-06 14:43:04 -080041 shadow_frame.SetDexPC(DexFile::kDexNoIndex); \
42 } \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020043 return JValue(); /* Handled in caller. */ \
44 } else { \
45 int32_t displacement = static_cast<int32_t>(found_dex_pc) - static_cast<int32_t>(dex_pc); \
46 inst = inst->RelativeAt(displacement); \
47 } \
48 } while (false)
49
50#define POSSIBLY_HANDLE_PENDING_EXCEPTION(_is_exception_pending, _next_function) \
51 do { \
52 if (UNLIKELY(_is_exception_pending)) { \
53 HANDLE_PENDING_EXCEPTION(); \
54 } else { \
55 inst = inst->_next_function(); \
56 } \
57 } while (false)
58
Andreas Gampe03ec9302015-08-27 17:41:47 -070059#define HANDLE_MONITOR_CHECKS() \
Andreas Gampe56fdd0e2016-04-28 14:56:54 -070060 if (!DoMonitorCheckOnExit<do_assignability_check>(self, &shadow_frame)) { \
Andreas Gampe03ec9302015-08-27 17:41:47 -070061 HANDLE_PENDING_EXCEPTION(); \
62 }
63
Sebastien Hertz8ece0502013-08-07 11:26:41 +020064// Code to run before each dex instruction.
Sebastien Hertz8379b222014-02-24 17:38:15 +010065#define PREAMBLE() \
66 do { \
Sebastien Hertz9d6bf692015-04-10 12:12:33 +020067 if (UNLIKELY(instrumentation->HasDexPcListeners())) { \
Sebastien Hertz8379b222014-02-24 17:38:15 +010068 instrumentation->DexPcMovedEvent(self, shadow_frame.GetThisObject(code_item->ins_size_), \
69 shadow_frame.GetMethod(), dex_pc); \
70 } \
71 } while (false)
Sebastien Hertz8ece0502013-08-07 11:26:41 +020072
Nicolas Geoffrayb331feb2016-02-05 16:51:53 +000073#define BRANCH_INSTRUMENTATION(offset) \
74 do { \
Nicolas Geoffray274fe4a2016-04-12 16:33:24 +010075 if (UNLIKELY(instrumentation->HasBranchListeners())) { \
76 instrumentation->Branch(self, method, dex_pc, offset); \
77 } \
Nicolas Geoffrayb331feb2016-02-05 16:51:53 +000078 JValue result; \
79 if (jit::Jit::MaybeDoOnStackReplacement(self, method, dex_pc, offset, &result)) { \
buzbee93e94f22016-04-07 13:52:48 -070080 if (interpret_one_instruction) { \
81 /* OSR has completed execution of the method. Signal mterp to return to caller */ \
82 shadow_frame.SetDexPC(DexFile::kDexNoIndex); \
83 } \
Nicolas Geoffrayb331feb2016-02-05 16:51:53 +000084 return result; \
85 } \
Nicolas Geoffray3108daf2015-11-24 16:32:33 +000086 } while (false)
87
Bill Buzbee1d011d92016-04-04 16:59:29 +000088#define HOTNESS_UPDATE() \
89 do { \
Nicolas Geoffray274fe4a2016-04-12 16:33:24 +010090 if (jit != nullptr) { \
Nicolas Geoffray71cd50f2016-04-14 15:00:33 +010091 jit->AddSamples(self, method, 1, /*with_backedges*/ true); \
Bill Buzbee1d011d92016-04-04 16:59:29 +000092 } \
93 } while (false)
94
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +010095template<bool do_access_check, bool transaction_active>
Ian Rogerse94652f2014-12-02 11:13:19 -080096JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item,
buzbee1452bee2015-03-06 14:43:04 -080097 ShadowFrame& shadow_frame, JValue result_register,
98 bool interpret_one_instruction) {
Igor Murashkinc449e8b2015-06-10 15:56:42 -070099 constexpr bool do_assignability_check = do_access_check;
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200100 if (UNLIKELY(!shadow_frame.HasReferenceArray())) {
101 LOG(FATAL) << "Invalid shadow frame for interpreter use";
102 return JValue();
103 }
104 self->VerifyStack();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200105
106 uint32_t dex_pc = shadow_frame.GetDexPC();
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700107 const auto* const instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200108 const uint16_t* const insns = code_item->insns_;
109 const Instruction* inst = Instruction::At(insns + dex_pc);
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200110 uint16_t inst_data;
Bill Buzbee1d011d92016-04-04 16:59:29 +0000111 ArtMethod* method = shadow_frame.GetMethod();
112 jit::Jit* jit = Runtime::Current()->GetJit();
Igor Murashkin6918bf12015-09-27 19:19:06 -0700113
buzbee1452bee2015-03-06 14:43:04 -0800114 do {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200115 dex_pc = inst->GetDexPc(insns);
116 shadow_frame.SetDexPC(dex_pc);
Ian Rogerse94652f2014-12-02 11:13:19 -0800117 TraceExecution(shadow_frame, inst, dex_pc);
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200118 inst_data = inst->Fetch16(0);
119 switch (inst->Opcode(inst_data)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200120 case Instruction::NOP:
121 PREAMBLE();
122 inst = inst->Next_1xx();
123 break;
124 case Instruction::MOVE:
125 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200126 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
127 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200128 inst = inst->Next_1xx();
129 break;
130 case Instruction::MOVE_FROM16:
131 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200132 shadow_frame.SetVReg(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200133 shadow_frame.GetVReg(inst->VRegB_22x()));
134 inst = inst->Next_2xx();
135 break;
136 case Instruction::MOVE_16:
137 PREAMBLE();
138 shadow_frame.SetVReg(inst->VRegA_32x(),
139 shadow_frame.GetVReg(inst->VRegB_32x()));
140 inst = inst->Next_3xx();
141 break;
142 case Instruction::MOVE_WIDE:
143 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200144 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data),
145 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200146 inst = inst->Next_1xx();
147 break;
148 case Instruction::MOVE_WIDE_FROM16:
149 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200150 shadow_frame.SetVRegLong(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200151 shadow_frame.GetVRegLong(inst->VRegB_22x()));
152 inst = inst->Next_2xx();
153 break;
154 case Instruction::MOVE_WIDE_16:
155 PREAMBLE();
156 shadow_frame.SetVRegLong(inst->VRegA_32x(),
157 shadow_frame.GetVRegLong(inst->VRegB_32x()));
158 inst = inst->Next_3xx();
159 break;
160 case Instruction::MOVE_OBJECT:
161 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200162 shadow_frame.SetVRegReference(inst->VRegA_12x(inst_data),
163 shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200164 inst = inst->Next_1xx();
165 break;
166 case Instruction::MOVE_OBJECT_FROM16:
167 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200168 shadow_frame.SetVRegReference(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200169 shadow_frame.GetVRegReference(inst->VRegB_22x()));
170 inst = inst->Next_2xx();
171 break;
172 case Instruction::MOVE_OBJECT_16:
173 PREAMBLE();
174 shadow_frame.SetVRegReference(inst->VRegA_32x(),
175 shadow_frame.GetVRegReference(inst->VRegB_32x()));
176 inst = inst->Next_3xx();
177 break;
178 case Instruction::MOVE_RESULT:
179 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200180 shadow_frame.SetVReg(inst->VRegA_11x(inst_data), result_register.GetI());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200181 inst = inst->Next_1xx();
182 break;
183 case Instruction::MOVE_RESULT_WIDE:
184 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200185 shadow_frame.SetVRegLong(inst->VRegA_11x(inst_data), result_register.GetJ());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200186 inst = inst->Next_1xx();
187 break;
188 case Instruction::MOVE_RESULT_OBJECT:
189 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200190 shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), result_register.GetL());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200191 inst = inst->Next_1xx();
192 break;
193 case Instruction::MOVE_EXCEPTION: {
194 PREAMBLE();
Nicolas Geoffray14691c52015-03-05 10:40:17 +0000195 Throwable* exception = self->GetException();
Sebastien Hertz270a0e12015-01-16 19:49:09 +0100196 DCHECK(exception != nullptr) << "No pending exception on MOVE_EXCEPTION instruction";
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200197 shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), exception);
Sebastien Hertz5c004902014-05-21 10:07:42 +0200198 self->ClearException();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200199 inst = inst->Next_1xx();
200 break;
201 }
Mathieu Chartierd7cbf8a2015-03-19 12:43:20 -0700202 case Instruction::RETURN_VOID_NO_BARRIER: {
Sebastien Hertz9d6bf692015-04-10 12:12:33 +0200203 PREAMBLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200204 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700205 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700206 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200207 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200208 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200209 shadow_frame.GetMethod(), inst->GetDexPc(insns),
210 result);
211 }
buzbee1452bee2015-03-06 14:43:04 -0800212 if (interpret_one_instruction) {
buzbee93e94f22016-04-07 13:52:48 -0700213 /* Signal mterp to return to caller */
buzbee1452bee2015-03-06 14:43:04 -0800214 shadow_frame.SetDexPC(DexFile::kDexNoIndex);
215 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200216 return result;
217 }
Mathieu Chartierd7cbf8a2015-03-19 12:43:20 -0700218 case Instruction::RETURN_VOID: {
Sebastien Hertz9d6bf692015-04-10 12:12:33 +0200219 PREAMBLE();
Hans Boehm30359612014-05-21 17:46:23 -0700220 QuasiAtomic::ThreadFenceForConstructor();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200221 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700222 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700223 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200224 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200225 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200226 shadow_frame.GetMethod(), inst->GetDexPc(insns),
227 result);
228 }
buzbee1452bee2015-03-06 14:43:04 -0800229 if (interpret_one_instruction) {
buzbee93e94f22016-04-07 13:52:48 -0700230 /* Signal mterp to return to caller */
buzbee1452bee2015-03-06 14:43:04 -0800231 shadow_frame.SetDexPC(DexFile::kDexNoIndex);
232 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200233 return result;
234 }
235 case Instruction::RETURN: {
Sebastien Hertz9d6bf692015-04-10 12:12:33 +0200236 PREAMBLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200237 JValue result;
238 result.SetJ(0);
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200239 result.SetI(shadow_frame.GetVReg(inst->VRegA_11x(inst_data)));
Ian Rogers7b078e82014-09-10 14:44:24 -0700240 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700241 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200242 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200243 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200244 shadow_frame.GetMethod(), inst->GetDexPc(insns),
245 result);
246 }
buzbee1452bee2015-03-06 14:43:04 -0800247 if (interpret_one_instruction) {
buzbee93e94f22016-04-07 13:52:48 -0700248 /* Signal mterp to return to caller */
buzbee1452bee2015-03-06 14:43:04 -0800249 shadow_frame.SetDexPC(DexFile::kDexNoIndex);
250 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200251 return result;
252 }
253 case Instruction::RETURN_WIDE: {
Sebastien Hertz9d6bf692015-04-10 12:12:33 +0200254 PREAMBLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200255 JValue result;
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200256 result.SetJ(shadow_frame.GetVRegLong(inst->VRegA_11x(inst_data)));
Ian Rogers7b078e82014-09-10 14:44:24 -0700257 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700258 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200259 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200260 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200261 shadow_frame.GetMethod(), inst->GetDexPc(insns),
262 result);
263 }
buzbee1452bee2015-03-06 14:43:04 -0800264 if (interpret_one_instruction) {
buzbee93e94f22016-04-07 13:52:48 -0700265 /* Signal mterp to return to caller */
buzbee1452bee2015-03-06 14:43:04 -0800266 shadow_frame.SetDexPC(DexFile::kDexNoIndex);
267 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200268 return result;
269 }
270 case Instruction::RETURN_OBJECT: {
Sebastien Hertz9d6bf692015-04-10 12:12:33 +0200271 PREAMBLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200272 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700273 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700274 HANDLE_MONITOR_CHECKS();
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700275 const size_t ref_idx = inst->VRegA_11x(inst_data);
276 Object* obj_result = shadow_frame.GetVRegReference(ref_idx);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700277 if (do_assignability_check && obj_result != nullptr) {
Andreas Gampe542451c2016-07-26 09:02:02 -0700278 PointerSize pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
Vladimir Marko05792b92015-08-03 11:56:49 +0100279 Class* return_type = shadow_frame.GetMethod()->GetReturnType(true /* resolve */,
280 pointer_size);
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700281 // Re-load since it might have moved.
282 obj_result = shadow_frame.GetVRegReference(ref_idx);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700283 if (return_type == nullptr) {
Jeff Haoa3faaf42013-09-03 19:07:00 -0700284 // Return the pending exception.
285 HANDLE_PENDING_EXCEPTION();
286 }
287 if (!obj_result->VerifierInstanceOf(return_type)) {
288 // This should never happen.
Ian Rogers1ff3c982014-08-12 02:30:58 -0700289 std::string temp1, temp2;
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000290 self->ThrowNewExceptionF("Ljava/lang/VirtualMachineError;",
Jeff Haoa3faaf42013-09-03 19:07:00 -0700291 "Returning '%s' that is not instance of return type '%s'",
Ian Rogers1ff3c982014-08-12 02:30:58 -0700292 obj_result->GetClass()->GetDescriptor(&temp1),
293 return_type->GetDescriptor(&temp2));
Jeff Haoa3faaf42013-09-03 19:07:00 -0700294 HANDLE_PENDING_EXCEPTION();
295 }
296 }
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700297 result.SetL(obj_result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200298 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200299 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200300 shadow_frame.GetMethod(), inst->GetDexPc(insns),
301 result);
302 }
buzbee1452bee2015-03-06 14:43:04 -0800303 if (interpret_one_instruction) {
buzbee93e94f22016-04-07 13:52:48 -0700304 /* Signal mterp to return to caller */
buzbee1452bee2015-03-06 14:43:04 -0800305 shadow_frame.SetDexPC(DexFile::kDexNoIndex);
306 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200307 return result;
308 }
309 case Instruction::CONST_4: {
310 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200311 uint4_t dst = inst->VRegA_11n(inst_data);
312 int4_t val = inst->VRegB_11n(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200313 shadow_frame.SetVReg(dst, val);
314 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700315 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200316 }
317 inst = inst->Next_1xx();
318 break;
319 }
320 case Instruction::CONST_16: {
321 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200322 uint8_t dst = inst->VRegA_21s(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200323 int16_t val = inst->VRegB_21s();
324 shadow_frame.SetVReg(dst, val);
325 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700326 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200327 }
328 inst = inst->Next_2xx();
329 break;
330 }
331 case Instruction::CONST: {
332 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200333 uint8_t dst = inst->VRegA_31i(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200334 int32_t val = inst->VRegB_31i();
335 shadow_frame.SetVReg(dst, val);
336 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700337 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200338 }
339 inst = inst->Next_3xx();
340 break;
341 }
342 case Instruction::CONST_HIGH16: {
343 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200344 uint8_t dst = inst->VRegA_21h(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200345 int32_t val = static_cast<int32_t>(inst->VRegB_21h() << 16);
346 shadow_frame.SetVReg(dst, val);
347 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700348 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200349 }
350 inst = inst->Next_2xx();
351 break;
352 }
353 case Instruction::CONST_WIDE_16:
354 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200355 shadow_frame.SetVRegLong(inst->VRegA_21s(inst_data), inst->VRegB_21s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200356 inst = inst->Next_2xx();
357 break;
358 case Instruction::CONST_WIDE_32:
359 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200360 shadow_frame.SetVRegLong(inst->VRegA_31i(inst_data), inst->VRegB_31i());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200361 inst = inst->Next_3xx();
362 break;
363 case Instruction::CONST_WIDE:
364 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200365 shadow_frame.SetVRegLong(inst->VRegA_51l(inst_data), inst->VRegB_51l());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200366 inst = inst->Next_51l();
367 break;
368 case Instruction::CONST_WIDE_HIGH16:
Sebastien Hertz3c5aec12014-06-04 09:41:21 +0200369 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200370 shadow_frame.SetVRegLong(inst->VRegA_21h(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200371 static_cast<uint64_t>(inst->VRegB_21h()) << 48);
372 inst = inst->Next_2xx();
373 break;
374 case Instruction::CONST_STRING: {
375 PREAMBLE();
Ian Rogers6786a582014-10-28 12:49:06 -0700376 String* s = ResolveString(self, shadow_frame, inst->VRegB_21c());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700377 if (UNLIKELY(s == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200378 HANDLE_PENDING_EXCEPTION();
379 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200380 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200381 inst = inst->Next_2xx();
382 }
383 break;
384 }
385 case Instruction::CONST_STRING_JUMBO: {
386 PREAMBLE();
Ian Rogers6786a582014-10-28 12:49:06 -0700387 String* s = ResolveString(self, shadow_frame, inst->VRegB_31c());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700388 if (UNLIKELY(s == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200389 HANDLE_PENDING_EXCEPTION();
390 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200391 shadow_frame.SetVRegReference(inst->VRegA_31c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200392 inst = inst->Next_3xx();
393 }
394 break;
395 }
396 case Instruction::CONST_CLASS: {
397 PREAMBLE();
398 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
399 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700400 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200401 HANDLE_PENDING_EXCEPTION();
402 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200403 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), c);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200404 inst = inst->Next_2xx();
405 }
406 break;
407 }
408 case Instruction::MONITOR_ENTER: {
409 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200410 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700411 if (UNLIKELY(obj == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000412 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200413 HANDLE_PENDING_EXCEPTION();
414 } else {
Andreas Gampe03ec9302015-08-27 17:41:47 -0700415 DoMonitorEnter<do_assignability_check>(self, &shadow_frame, obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200416 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx);
417 }
418 break;
419 }
420 case Instruction::MONITOR_EXIT: {
421 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200422 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700423 if (UNLIKELY(obj == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000424 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200425 HANDLE_PENDING_EXCEPTION();
426 } else {
Andreas Gampe03ec9302015-08-27 17:41:47 -0700427 DoMonitorExit<do_assignability_check>(self, &shadow_frame, obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200428 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx);
429 }
430 break;
431 }
432 case Instruction::CHECK_CAST: {
433 PREAMBLE();
434 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
435 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700436 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200437 HANDLE_PENDING_EXCEPTION();
438 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200439 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_21c(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700440 if (UNLIKELY(obj != nullptr && !obj->InstanceOf(c))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200441 ThrowClassCastException(c, obj->GetClass());
442 HANDLE_PENDING_EXCEPTION();
443 } else {
444 inst = inst->Next_2xx();
445 }
446 }
447 break;
448 }
449 case Instruction::INSTANCE_OF: {
450 PREAMBLE();
451 Class* c = ResolveVerifyAndClinit(inst->VRegC_22c(), shadow_frame.GetMethod(),
452 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700453 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200454 HANDLE_PENDING_EXCEPTION();
455 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200456 Object* obj = shadow_frame.GetVRegReference(inst->VRegB_22c(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700457 shadow_frame.SetVReg(inst->VRegA_22c(inst_data),
458 (obj != nullptr && obj->InstanceOf(c)) ? 1 : 0);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200459 inst = inst->Next_2xx();
460 }
461 break;
462 }
463 case Instruction::ARRAY_LENGTH: {
464 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200465 Object* array = shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700466 if (UNLIKELY(array == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000467 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200468 HANDLE_PENDING_EXCEPTION();
469 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200470 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), array->AsArray()->GetLength());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200471 inst = inst->Next_1xx();
472 }
473 break;
474 }
475 case Instruction::NEW_INSTANCE: {
476 PREAMBLE();
Jeff Hao848f70a2014-01-15 13:49:50 -0800477 Object* obj = nullptr;
478 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
479 self, false, do_access_check);
480 if (LIKELY(c != nullptr)) {
481 if (UNLIKELY(c->IsStringClass())) {
482 gc::AllocatorType allocator_type = Runtime::Current()->GetHeap()->GetCurrentAllocator();
jessicahandojo3aaa37b2016-07-29 14:46:37 -0700483 obj = mirror::String::AllocEmptyString<true>(self, allocator_type);
Jeff Hao848f70a2014-01-15 13:49:50 -0800484 } else {
485 obj = AllocObjectFromCode<do_access_check, true>(
486 inst->VRegB_21c(), shadow_frame.GetMethod(), self,
487 Runtime::Current()->GetHeap()->GetCurrentAllocator());
488 }
489 }
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700490 if (UNLIKELY(obj == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200491 HANDLE_PENDING_EXCEPTION();
492 } else {
Sebastien Hertz4e99b3d2014-06-24 14:35:40 +0200493 obj->GetClass()->AssertInitializedOrInitializingInThread(self);
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700494 // Don't allow finalizable objects to be allocated during a transaction since these can't
495 // be finalized without a started runtime.
496 if (transaction_active && obj->GetClass()->IsFinalizable()) {
Sebastien Hertz45b15972015-04-03 16:07:05 +0200497 AbortTransactionF(self, "Allocating finalizable object in transaction: %s",
David Sehr709b0702016-10-13 09:12:37 -0700498 obj->PrettyTypeOf().c_str());
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700499 HANDLE_PENDING_EXCEPTION();
500 break;
501 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200502 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200503 inst = inst->Next_2xx();
504 }
505 break;
506 }
507 case Instruction::NEW_ARRAY: {
508 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200509 int32_t length = shadow_frame.GetVReg(inst->VRegB_22c(inst_data));
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800510 Object* obj = AllocArrayFromCode<do_access_check, true>(
Andreas Gampe1cc7dba2014-12-17 18:43:01 -0800511 inst->VRegC_22c(), length, shadow_frame.GetMethod(), self,
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800512 Runtime::Current()->GetHeap()->GetCurrentAllocator());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700513 if (UNLIKELY(obj == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200514 HANDLE_PENDING_EXCEPTION();
515 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200516 shadow_frame.SetVRegReference(inst->VRegA_22c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200517 inst = inst->Next_2xx();
518 }
519 break;
520 }
521 case Instruction::FILLED_NEW_ARRAY: {
522 PREAMBLE();
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100523 bool success =
524 DoFilledNewArray<false, do_access_check, transaction_active>(inst, shadow_frame, self,
525 &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200526 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
527 break;
528 }
529 case Instruction::FILLED_NEW_ARRAY_RANGE: {
530 PREAMBLE();
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100531 bool success =
532 DoFilledNewArray<true, do_access_check, transaction_active>(inst, shadow_frame,
533 self, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200534 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
535 break;
536 }
537 case Instruction::FILL_ARRAY_DATA: {
538 PREAMBLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200539 const uint16_t* payload_addr = reinterpret_cast<const uint16_t*>(inst) + inst->VRegB_31t();
540 const Instruction::ArrayDataPayload* payload =
541 reinterpret_cast<const Instruction::ArrayDataPayload*>(payload_addr);
Ian Rogers832336b2014-10-08 15:35:22 -0700542 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_31t(inst_data));
543 bool success = FillArrayData(obj, payload);
544 if (!success) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200545 HANDLE_PENDING_EXCEPTION();
546 break;
547 }
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100548 if (transaction_active) {
Ian Rogers832336b2014-10-08 15:35:22 -0700549 RecordArrayElementsInTransaction(obj->AsArray(), payload->element_count);
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100550 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200551 inst = inst->Next_3xx();
552 break;
553 }
554 case Instruction::THROW: {
555 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200556 Object* exception = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700557 if (UNLIKELY(exception == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000558 ThrowNullPointerException("throw with null exception");
Jeff Haoa3faaf42013-09-03 19:07:00 -0700559 } else if (do_assignability_check && !exception->GetClass()->IsThrowableClass()) {
560 // This should never happen.
Ian Rogers1ff3c982014-08-12 02:30:58 -0700561 std::string temp;
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000562 self->ThrowNewExceptionF("Ljava/lang/VirtualMachineError;",
Jeff Haoa3faaf42013-09-03 19:07:00 -0700563 "Throwing '%s' that is not instance of Throwable",
Ian Rogers1ff3c982014-08-12 02:30:58 -0700564 exception->GetClass()->GetDescriptor(&temp));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200565 } else {
Nicolas Geoffray14691c52015-03-05 10:40:17 +0000566 self->SetException(exception->AsThrowable());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200567 }
568 HANDLE_PENDING_EXCEPTION();
569 break;
570 }
571 case Instruction::GOTO: {
572 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200573 int8_t offset = inst->VRegA_10t(inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000574 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200575 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000576 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700577 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200578 }
579 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200580 break;
581 }
582 case Instruction::GOTO_16: {
583 PREAMBLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200584 int16_t offset = inst->VRegA_20t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000585 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200586 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000587 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700588 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200589 }
590 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200591 break;
592 }
593 case Instruction::GOTO_32: {
594 PREAMBLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200595 int32_t offset = inst->VRegA_30t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000596 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200597 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000598 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700599 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200600 }
601 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200602 break;
603 }
604 case Instruction::PACKED_SWITCH: {
605 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200606 int32_t offset = DoPackedSwitch(inst, shadow_frame, inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000607 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200608 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000609 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700610 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200611 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200612 inst = inst->RelativeAt(offset);
613 break;
614 }
615 case Instruction::SPARSE_SWITCH: {
616 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200617 int32_t offset = DoSparseSwitch(inst, shadow_frame, inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000618 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200619 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000620 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700621 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200622 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200623 inst = inst->RelativeAt(offset);
624 break;
625 }
Ian Rogers647b1a82014-10-10 11:02:11 -0700626
Ian Rogers647b1a82014-10-10 11:02:11 -0700627#pragma clang diagnostic push
628#pragma clang diagnostic ignored "-Wfloat-equal"
Ian Rogers647b1a82014-10-10 11:02:11 -0700629
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200630 case Instruction::CMPL_FLOAT: {
631 PREAMBLE();
632 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
633 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
634 int32_t result;
635 if (val1 > val2) {
636 result = 1;
637 } else if (val1 == val2) {
638 result = 0;
639 } else {
640 result = -1;
641 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200642 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200643 inst = inst->Next_2xx();
644 break;
645 }
646 case Instruction::CMPG_FLOAT: {
647 PREAMBLE();
648 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
649 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
650 int32_t result;
651 if (val1 < val2) {
652 result = -1;
653 } else if (val1 == val2) {
654 result = 0;
655 } else {
656 result = 1;
657 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200658 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200659 inst = inst->Next_2xx();
660 break;
661 }
662 case Instruction::CMPL_DOUBLE: {
663 PREAMBLE();
664 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
665 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
666 int32_t result;
667 if (val1 > val2) {
668 result = 1;
669 } else if (val1 == val2) {
670 result = 0;
671 } else {
672 result = -1;
673 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200674 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200675 inst = inst->Next_2xx();
676 break;
677 }
678
679 case Instruction::CMPG_DOUBLE: {
680 PREAMBLE();
681 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
682 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
683 int32_t result;
684 if (val1 < val2) {
685 result = -1;
686 } else if (val1 == val2) {
687 result = 0;
688 } else {
689 result = 1;
690 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200691 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200692 inst = inst->Next_2xx();
693 break;
694 }
Ian Rogers647b1a82014-10-10 11:02:11 -0700695
Ian Rogers647b1a82014-10-10 11:02:11 -0700696#pragma clang diagnostic pop
Ian Rogers647b1a82014-10-10 11:02:11 -0700697
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200698 case Instruction::CMP_LONG: {
699 PREAMBLE();
700 int64_t val1 = shadow_frame.GetVRegLong(inst->VRegB_23x());
701 int64_t val2 = shadow_frame.GetVRegLong(inst->VRegC_23x());
702 int32_t result;
703 if (val1 > val2) {
704 result = 1;
705 } else if (val1 == val2) {
706 result = 0;
707 } else {
708 result = -1;
709 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200710 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200711 inst = inst->Next_2xx();
712 break;
713 }
714 case Instruction::IF_EQ: {
715 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700716 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) ==
717 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200718 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000719 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200720 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000721 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700722 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200723 }
724 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200725 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800726 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200727 inst = inst->Next_2xx();
728 }
729 break;
730 }
731 case Instruction::IF_NE: {
732 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700733 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) !=
734 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200735 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000736 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200737 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000738 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700739 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200740 }
741 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200742 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800743 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200744 inst = inst->Next_2xx();
745 }
746 break;
747 }
748 case Instruction::IF_LT: {
749 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700750 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <
751 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200752 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000753 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200754 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000755 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700756 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200757 }
758 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200759 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800760 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200761 inst = inst->Next_2xx();
762 }
763 break;
764 }
765 case Instruction::IF_GE: {
766 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700767 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >=
768 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200769 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000770 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200771 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000772 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700773 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200774 }
775 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200776 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800777 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200778 inst = inst->Next_2xx();
779 }
780 break;
781 }
782 case Instruction::IF_GT: {
783 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700784 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >
785 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200786 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000787 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200788 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000789 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700790 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200791 }
792 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200793 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800794 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200795 inst = inst->Next_2xx();
796 }
797 break;
798 }
799 case Instruction::IF_LE: {
800 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700801 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <=
802 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200803 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000804 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200805 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000806 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700807 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200808 }
809 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200810 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800811 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200812 inst = inst->Next_2xx();
813 }
814 break;
815 }
816 case Instruction::IF_EQZ: {
817 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200818 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) == 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200819 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000820 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200821 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000822 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700823 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200824 }
825 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200826 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800827 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200828 inst = inst->Next_2xx();
829 }
830 break;
831 }
832 case Instruction::IF_NEZ: {
833 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200834 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) != 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200835 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000836 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200837 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000838 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700839 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200840 }
841 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200842 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800843 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200844 inst = inst->Next_2xx();
845 }
846 break;
847 }
848 case Instruction::IF_LTZ: {
849 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200850 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) < 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200851 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000852 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200853 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000854 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700855 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200856 }
857 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200858 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800859 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200860 inst = inst->Next_2xx();
861 }
862 break;
863 }
864 case Instruction::IF_GEZ: {
865 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200866 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) >= 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200867 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000868 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200869 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000870 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700871 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200872 }
873 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200874 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800875 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200876 inst = inst->Next_2xx();
877 }
878 break;
879 }
880 case Instruction::IF_GTZ: {
881 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200882 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) > 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200883 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000884 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200885 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000886 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700887 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200888 }
889 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200890 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800891 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200892 inst = inst->Next_2xx();
893 }
894 break;
895 }
896 case Instruction::IF_LEZ: {
897 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200898 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) <= 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200899 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000900 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200901 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000902 HOTNESS_UPDATE();
Ian Rogers7b078e82014-09-10 14:44:24 -0700903 self->AllowThreadSuspension();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200904 }
905 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200906 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800907 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200908 inst = inst->Next_2xx();
909 }
910 break;
911 }
912 case Instruction::AGET_BOOLEAN: {
913 PREAMBLE();
914 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700915 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000916 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200917 HANDLE_PENDING_EXCEPTION();
918 break;
919 }
920 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
921 BooleanArray* array = a->AsBooleanArray();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -0700922 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzabff6432014-01-27 18:01:39 +0100923 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200924 inst = inst->Next_2xx();
925 } else {
926 HANDLE_PENDING_EXCEPTION();
927 }
928 break;
929 }
930 case Instruction::AGET_BYTE: {
931 PREAMBLE();
932 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700933 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000934 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200935 HANDLE_PENDING_EXCEPTION();
936 break;
937 }
938 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
939 ByteArray* array = a->AsByteArray();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -0700940 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzabff6432014-01-27 18:01:39 +0100941 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200942 inst = inst->Next_2xx();
943 } else {
944 HANDLE_PENDING_EXCEPTION();
945 }
946 break;
947 }
948 case Instruction::AGET_CHAR: {
949 PREAMBLE();
950 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700951 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000952 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200953 HANDLE_PENDING_EXCEPTION();
954 break;
955 }
956 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
957 CharArray* array = a->AsCharArray();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -0700958 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzabff6432014-01-27 18:01:39 +0100959 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200960 inst = inst->Next_2xx();
961 } else {
962 HANDLE_PENDING_EXCEPTION();
963 }
964 break;
965 }
966 case Instruction::AGET_SHORT: {
967 PREAMBLE();
968 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700969 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000970 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200971 HANDLE_PENDING_EXCEPTION();
972 break;
973 }
974 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
975 ShortArray* array = a->AsShortArray();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -0700976 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzabff6432014-01-27 18:01:39 +0100977 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200978 inst = inst->Next_2xx();
979 } else {
980 HANDLE_PENDING_EXCEPTION();
981 }
982 break;
983 }
984 case Instruction::AGET: {
985 PREAMBLE();
986 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700987 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000988 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200989 HANDLE_PENDING_EXCEPTION();
990 break;
991 }
992 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
David Sehr709b0702016-10-13 09:12:37 -0700993 DCHECK(a->IsIntArray() || a->IsFloatArray()) << a->PrettyTypeOf();
Mathieu Chartiere401d142015-04-22 13:56:20 -0700994 auto* array = down_cast<IntArray*>(a);
Ian Rogersb0fa5dc2014-04-28 16:47:08 -0700995 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzabff6432014-01-27 18:01:39 +0100996 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200997 inst = inst->Next_2xx();
998 } else {
999 HANDLE_PENDING_EXCEPTION();
1000 }
1001 break;
1002 }
1003 case Instruction::AGET_WIDE: {
1004 PREAMBLE();
1005 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001006 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001007 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001008 HANDLE_PENDING_EXCEPTION();
1009 break;
1010 }
1011 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
David Sehr709b0702016-10-13 09:12:37 -07001012 DCHECK(a->IsLongArray() || a->IsDoubleArray()) << a->PrettyTypeOf();
Mathieu Chartiere401d142015-04-22 13:56:20 -07001013 auto* array = down_cast<LongArray*>(a);
Ian Rogersb0fa5dc2014-04-28 16:47:08 -07001014 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzabff6432014-01-27 18:01:39 +01001015 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001016 inst = inst->Next_2xx();
1017 } else {
1018 HANDLE_PENDING_EXCEPTION();
1019 }
1020 break;
1021 }
1022 case Instruction::AGET_OBJECT: {
1023 PREAMBLE();
1024 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001025 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001026 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001027 HANDLE_PENDING_EXCEPTION();
1028 break;
1029 }
1030 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1031 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -07001032 if (array->CheckIsValidIndex(index)) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001033 shadow_frame.SetVRegReference(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001034 inst = inst->Next_2xx();
1035 } else {
1036 HANDLE_PENDING_EXCEPTION();
1037 }
1038 break;
1039 }
1040 case Instruction::APUT_BOOLEAN: {
1041 PREAMBLE();
1042 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001043 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001044 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001045 HANDLE_PENDING_EXCEPTION();
1046 break;
1047 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001048 uint8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001049 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1050 BooleanArray* array = a->AsBooleanArray();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -07001051 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001052 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001053 inst = inst->Next_2xx();
1054 } else {
1055 HANDLE_PENDING_EXCEPTION();
1056 }
1057 break;
1058 }
1059 case Instruction::APUT_BYTE: {
1060 PREAMBLE();
1061 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001062 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001063 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001064 HANDLE_PENDING_EXCEPTION();
1065 break;
1066 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001067 int8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001068 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1069 ByteArray* array = a->AsByteArray();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -07001070 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001071 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001072 inst = inst->Next_2xx();
1073 } else {
1074 HANDLE_PENDING_EXCEPTION();
1075 }
1076 break;
1077 }
1078 case Instruction::APUT_CHAR: {
1079 PREAMBLE();
1080 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001081 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001082 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001083 HANDLE_PENDING_EXCEPTION();
1084 break;
1085 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001086 uint16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001087 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1088 CharArray* array = a->AsCharArray();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -07001089 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001090 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001091 inst = inst->Next_2xx();
1092 } else {
1093 HANDLE_PENDING_EXCEPTION();
1094 }
1095 break;
1096 }
1097 case Instruction::APUT_SHORT: {
1098 PREAMBLE();
1099 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001100 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001101 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001102 HANDLE_PENDING_EXCEPTION();
1103 break;
1104 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001105 int16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001106 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1107 ShortArray* array = a->AsShortArray();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -07001108 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001109 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001110 inst = inst->Next_2xx();
1111 } else {
1112 HANDLE_PENDING_EXCEPTION();
1113 }
1114 break;
1115 }
1116 case Instruction::APUT: {
1117 PREAMBLE();
1118 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001119 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001120 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001121 HANDLE_PENDING_EXCEPTION();
1122 break;
1123 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001124 int32_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001125 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
David Sehr709b0702016-10-13 09:12:37 -07001126 DCHECK(a->IsIntArray() || a->IsFloatArray()) << a->PrettyTypeOf();
Mathieu Chartiere401d142015-04-22 13:56:20 -07001127 auto* array = down_cast<IntArray*>(a);
Ian Rogersb0fa5dc2014-04-28 16:47:08 -07001128 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001129 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001130 inst = inst->Next_2xx();
1131 } else {
1132 HANDLE_PENDING_EXCEPTION();
1133 }
1134 break;
1135 }
1136 case Instruction::APUT_WIDE: {
1137 PREAMBLE();
1138 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001139 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001140 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001141 HANDLE_PENDING_EXCEPTION();
1142 break;
1143 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001144 int64_t val = shadow_frame.GetVRegLong(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001145 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
David Sehr709b0702016-10-13 09:12:37 -07001146 DCHECK(a->IsLongArray() || a->IsDoubleArray()) << a->PrettyTypeOf();
Mathieu Chartiere401d142015-04-22 13:56:20 -07001147 LongArray* array = down_cast<LongArray*>(a);
Ian Rogersb0fa5dc2014-04-28 16:47:08 -07001148 if (array->CheckIsValidIndex(index)) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001149 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001150 inst = inst->Next_2xx();
1151 } else {
1152 HANDLE_PENDING_EXCEPTION();
1153 }
1154 break;
1155 }
1156 case Instruction::APUT_OBJECT: {
1157 PREAMBLE();
1158 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001159 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001160 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001161 HANDLE_PENDING_EXCEPTION();
1162 break;
1163 }
1164 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001165 Object* val = shadow_frame.GetVRegReference(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001166 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Ian Rogersb0fa5dc2014-04-28 16:47:08 -07001167 if (array->CheckIsValidIndex(index) && array->CheckAssignable(val)) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001168 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001169 inst = inst->Next_2xx();
1170 } else {
1171 HANDLE_PENDING_EXCEPTION();
1172 }
1173 break;
1174 }
1175 case Instruction::IGET_BOOLEAN: {
1176 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001177 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimBoolean, do_access_check>(
1178 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001179 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1180 break;
1181 }
1182 case Instruction::IGET_BYTE: {
1183 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001184 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimByte, do_access_check>(
1185 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001186 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1187 break;
1188 }
1189 case Instruction::IGET_CHAR: {
1190 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001191 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimChar, do_access_check>(
1192 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001193 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1194 break;
1195 }
1196 case Instruction::IGET_SHORT: {
1197 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001198 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimShort, do_access_check>(
1199 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001200 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1201 break;
1202 }
1203 case Instruction::IGET: {
1204 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001205 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimInt, do_access_check>(
1206 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001207 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1208 break;
1209 }
1210 case Instruction::IGET_WIDE: {
1211 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001212 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimLong, do_access_check>(
1213 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001214 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1215 break;
1216 }
1217 case Instruction::IGET_OBJECT: {
1218 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001219 bool success = DoFieldGet<InstanceObjectRead, Primitive::kPrimNot, do_access_check>(
1220 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001221 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1222 break;
1223 }
1224 case Instruction::IGET_QUICK: {
1225 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001226 bool success = DoIGetQuick<Primitive::kPrimInt>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001227 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1228 break;
1229 }
1230 case Instruction::IGET_WIDE_QUICK: {
1231 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001232 bool success = DoIGetQuick<Primitive::kPrimLong>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001233 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1234 break;
1235 }
1236 case Instruction::IGET_OBJECT_QUICK: {
1237 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001238 bool success = DoIGetQuick<Primitive::kPrimNot>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001239 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1240 break;
1241 }
Mathieu Chartierffc605c2014-12-10 10:35:44 -08001242 case Instruction::IGET_BOOLEAN_QUICK: {
1243 PREAMBLE();
1244 bool success = DoIGetQuick<Primitive::kPrimBoolean>(shadow_frame, inst, inst_data);
1245 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1246 break;
1247 }
1248 case Instruction::IGET_BYTE_QUICK: {
1249 PREAMBLE();
1250 bool success = DoIGetQuick<Primitive::kPrimByte>(shadow_frame, inst, inst_data);
1251 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1252 break;
1253 }
1254 case Instruction::IGET_CHAR_QUICK: {
1255 PREAMBLE();
1256 bool success = DoIGetQuick<Primitive::kPrimChar>(shadow_frame, inst, inst_data);
1257 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1258 break;
1259 }
1260 case Instruction::IGET_SHORT_QUICK: {
1261 PREAMBLE();
1262 bool success = DoIGetQuick<Primitive::kPrimShort>(shadow_frame, inst, inst_data);
1263 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1264 break;
1265 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001266 case Instruction::SGET_BOOLEAN: {
1267 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001268 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimBoolean, do_access_check>(
1269 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001270 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1271 break;
1272 }
1273 case Instruction::SGET_BYTE: {
1274 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001275 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimByte, do_access_check>(
1276 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001277 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1278 break;
1279 }
1280 case Instruction::SGET_CHAR: {
1281 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001282 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimChar, do_access_check>(
1283 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001284 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1285 break;
1286 }
1287 case Instruction::SGET_SHORT: {
1288 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001289 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimShort, do_access_check>(
1290 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001291 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1292 break;
1293 }
1294 case Instruction::SGET: {
1295 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001296 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimInt, do_access_check>(
1297 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001298 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1299 break;
1300 }
1301 case Instruction::SGET_WIDE: {
1302 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001303 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimLong, do_access_check>(
1304 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001305 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1306 break;
1307 }
1308 case Instruction::SGET_OBJECT: {
1309 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001310 bool success = DoFieldGet<StaticObjectRead, Primitive::kPrimNot, do_access_check>(
1311 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001312 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1313 break;
1314 }
1315 case Instruction::IPUT_BOOLEAN: {
1316 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001317 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimBoolean, do_access_check,
1318 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001319 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1320 break;
1321 }
1322 case Instruction::IPUT_BYTE: {
1323 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001324 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimByte, do_access_check,
1325 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001326 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1327 break;
1328 }
1329 case Instruction::IPUT_CHAR: {
1330 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001331 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimChar, do_access_check,
1332 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001333 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1334 break;
1335 }
1336 case Instruction::IPUT_SHORT: {
1337 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001338 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimShort, do_access_check,
1339 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001340 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1341 break;
1342 }
1343 case Instruction::IPUT: {
1344 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001345 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimInt, do_access_check,
1346 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001347 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1348 break;
1349 }
1350 case Instruction::IPUT_WIDE: {
1351 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001352 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimLong, do_access_check,
1353 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001354 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1355 break;
1356 }
1357 case Instruction::IPUT_OBJECT: {
1358 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001359 bool success = DoFieldPut<InstanceObjectWrite, Primitive::kPrimNot, do_access_check,
1360 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001361 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1362 break;
1363 }
1364 case Instruction::IPUT_QUICK: {
1365 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001366 bool success = DoIPutQuick<Primitive::kPrimInt, transaction_active>(
1367 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001368 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1369 break;
1370 }
Fred Shih37f05ef2014-07-16 18:38:08 -07001371 case Instruction::IPUT_BOOLEAN_QUICK: {
1372 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001373 bool success = DoIPutQuick<Primitive::kPrimBoolean, transaction_active>(
1374 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001375 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1376 break;
1377 }
1378 case Instruction::IPUT_BYTE_QUICK: {
1379 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001380 bool success = DoIPutQuick<Primitive::kPrimByte, transaction_active>(
1381 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001382 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1383 break;
1384 }
1385 case Instruction::IPUT_CHAR_QUICK: {
1386 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001387 bool success = DoIPutQuick<Primitive::kPrimChar, transaction_active>(
1388 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001389 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1390 break;
1391 }
1392 case Instruction::IPUT_SHORT_QUICK: {
1393 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001394 bool success = DoIPutQuick<Primitive::kPrimShort, transaction_active>(
1395 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001396 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1397 break;
1398 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001399 case Instruction::IPUT_WIDE_QUICK: {
1400 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001401 bool success = DoIPutQuick<Primitive::kPrimLong, transaction_active>(
1402 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001403 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1404 break;
1405 }
1406 case Instruction::IPUT_OBJECT_QUICK: {
1407 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001408 bool success = DoIPutQuick<Primitive::kPrimNot, transaction_active>(
1409 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001410 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1411 break;
1412 }
1413 case Instruction::SPUT_BOOLEAN: {
1414 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001415 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimBoolean, do_access_check,
1416 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001417 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1418 break;
1419 }
1420 case Instruction::SPUT_BYTE: {
1421 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001422 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimByte, do_access_check,
1423 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001424 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1425 break;
1426 }
1427 case Instruction::SPUT_CHAR: {
1428 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001429 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimChar, do_access_check,
1430 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001431 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1432 break;
1433 }
1434 case Instruction::SPUT_SHORT: {
1435 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001436 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimShort, do_access_check,
1437 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001438 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1439 break;
1440 }
1441 case Instruction::SPUT: {
1442 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001443 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimInt, do_access_check,
1444 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001445 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1446 break;
1447 }
1448 case Instruction::SPUT_WIDE: {
1449 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001450 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimLong, do_access_check,
1451 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001452 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1453 break;
1454 }
1455 case Instruction::SPUT_OBJECT: {
1456 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001457 bool success = DoFieldPut<StaticObjectWrite, Primitive::kPrimNot, do_access_check,
1458 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001459 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1460 break;
1461 }
1462 case Instruction::INVOKE_VIRTUAL: {
1463 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001464 bool success = DoInvoke<kVirtual, false, do_access_check>(
1465 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001466 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1467 break;
1468 }
1469 case Instruction::INVOKE_VIRTUAL_RANGE: {
1470 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001471 bool success = DoInvoke<kVirtual, true, do_access_check>(
1472 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001473 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1474 break;
1475 }
1476 case Instruction::INVOKE_SUPER: {
1477 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001478 bool success = DoInvoke<kSuper, false, do_access_check>(
1479 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001480 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1481 break;
1482 }
1483 case Instruction::INVOKE_SUPER_RANGE: {
1484 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001485 bool success = DoInvoke<kSuper, true, do_access_check>(
1486 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001487 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1488 break;
1489 }
1490 case Instruction::INVOKE_DIRECT: {
1491 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001492 bool success = DoInvoke<kDirect, false, do_access_check>(
1493 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001494 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1495 break;
1496 }
1497 case Instruction::INVOKE_DIRECT_RANGE: {
1498 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001499 bool success = DoInvoke<kDirect, true, do_access_check>(
1500 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001501 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1502 break;
1503 }
1504 case Instruction::INVOKE_INTERFACE: {
1505 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001506 bool success = DoInvoke<kInterface, false, do_access_check>(
1507 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001508 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1509 break;
1510 }
1511 case Instruction::INVOKE_INTERFACE_RANGE: {
1512 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001513 bool success = DoInvoke<kInterface, true, do_access_check>(
1514 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001515 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1516 break;
1517 }
1518 case Instruction::INVOKE_STATIC: {
1519 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001520 bool success = DoInvoke<kStatic, false, do_access_check>(
1521 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001522 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1523 break;
1524 }
1525 case Instruction::INVOKE_STATIC_RANGE: {
1526 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001527 bool success = DoInvoke<kStatic, true, do_access_check>(
1528 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001529 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1530 break;
1531 }
1532 case Instruction::INVOKE_VIRTUAL_QUICK: {
1533 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001534 bool success = DoInvokeVirtualQuick<false>(
1535 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001536 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1537 break;
1538 }
1539 case Instruction::INVOKE_VIRTUAL_RANGE_QUICK: {
1540 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001541 bool success = DoInvokeVirtualQuick<true>(
1542 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001543 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1544 break;
1545 }
Narayan Kamath9823e782016-08-03 12:46:58 +01001546 case Instruction::INVOKE_POLYMORPHIC: {
1547 PREAMBLE();
1548 bool success = DoInvokePolymorphic<false, do_access_check>(
1549 self, shadow_frame, inst, inst_data, &result_register);
1550 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_4xx);
1551 break;
1552 }
1553 case Instruction::INVOKE_POLYMORPHIC_RANGE: {
1554 PREAMBLE();
1555 bool success = DoInvokePolymorphic<true, do_access_check>(
1556 self, shadow_frame, inst, inst_data, &result_register);
1557 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_4xx);
1558 break;
1559 break;
1560 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001561 case Instruction::NEG_INT:
1562 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001563 shadow_frame.SetVReg(
1564 inst->VRegA_12x(inst_data), -shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001565 inst = inst->Next_1xx();
1566 break;
1567 case Instruction::NOT_INT:
1568 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001569 shadow_frame.SetVReg(
1570 inst->VRegA_12x(inst_data), ~shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001571 inst = inst->Next_1xx();
1572 break;
1573 case Instruction::NEG_LONG:
1574 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001575 shadow_frame.SetVRegLong(
1576 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001577 inst = inst->Next_1xx();
1578 break;
1579 case Instruction::NOT_LONG:
1580 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001581 shadow_frame.SetVRegLong(
1582 inst->VRegA_12x(inst_data), ~shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001583 inst = inst->Next_1xx();
1584 break;
1585 case Instruction::NEG_FLOAT:
1586 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001587 shadow_frame.SetVRegFloat(
1588 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001589 inst = inst->Next_1xx();
1590 break;
1591 case Instruction::NEG_DOUBLE:
1592 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001593 shadow_frame.SetVRegDouble(
1594 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001595 inst = inst->Next_1xx();
1596 break;
1597 case Instruction::INT_TO_LONG:
1598 PREAMBLE();
Ian Rogers450dcb52013-09-20 17:36:02 -07001599 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data),
1600 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001601 inst = inst->Next_1xx();
1602 break;
1603 case Instruction::INT_TO_FLOAT:
1604 PREAMBLE();
Ian Rogers450dcb52013-09-20 17:36:02 -07001605 shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data),
1606 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001607 inst = inst->Next_1xx();
1608 break;
1609 case Instruction::INT_TO_DOUBLE:
1610 PREAMBLE();
Ian Rogers450dcb52013-09-20 17:36:02 -07001611 shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data),
1612 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001613 inst = inst->Next_1xx();
1614 break;
1615 case Instruction::LONG_TO_INT:
1616 PREAMBLE();
Ian Rogers450dcb52013-09-20 17:36:02 -07001617 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1618 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001619 inst = inst->Next_1xx();
1620 break;
1621 case Instruction::LONG_TO_FLOAT:
1622 PREAMBLE();
Ian Rogers450dcb52013-09-20 17:36:02 -07001623 shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data),
1624 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001625 inst = inst->Next_1xx();
1626 break;
1627 case Instruction::LONG_TO_DOUBLE:
1628 PREAMBLE();
Ian Rogers450dcb52013-09-20 17:36:02 -07001629 shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data),
1630 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001631 inst = inst->Next_1xx();
1632 break;
1633 case Instruction::FLOAT_TO_INT: {
1634 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001635 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001636 int32_t result = art_float_to_integral<int32_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001637 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001638 inst = inst->Next_1xx();
1639 break;
1640 }
1641 case Instruction::FLOAT_TO_LONG: {
1642 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001643 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001644 int64_t result = art_float_to_integral<int64_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001645 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001646 inst = inst->Next_1xx();
1647 break;
1648 }
1649 case Instruction::FLOAT_TO_DOUBLE:
1650 PREAMBLE();
Ian Rogers450dcb52013-09-20 17:36:02 -07001651 shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data),
1652 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001653 inst = inst->Next_1xx();
1654 break;
1655 case Instruction::DOUBLE_TO_INT: {
1656 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001657 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001658 int32_t result = art_float_to_integral<int32_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001659 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001660 inst = inst->Next_1xx();
1661 break;
1662 }
1663 case Instruction::DOUBLE_TO_LONG: {
1664 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001665 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001666 int64_t result = art_float_to_integral<int64_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001667 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001668 inst = inst->Next_1xx();
1669 break;
1670 }
1671 case Instruction::DOUBLE_TO_FLOAT:
1672 PREAMBLE();
Ian Rogers450dcb52013-09-20 17:36:02 -07001673 shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data),
1674 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001675 inst = inst->Next_1xx();
1676 break;
1677 case Instruction::INT_TO_BYTE:
1678 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001679 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), static_cast<int8_t>(
1680 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001681 inst = inst->Next_1xx();
1682 break;
1683 case Instruction::INT_TO_CHAR:
1684 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001685 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), static_cast<uint16_t>(
1686 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001687 inst = inst->Next_1xx();
1688 break;
1689 case Instruction::INT_TO_SHORT:
1690 PREAMBLE();
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001691 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), static_cast<int16_t>(
1692 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001693 inst = inst->Next_1xx();
1694 break;
Ian Rogersf72a11d2014-10-30 15:41:08 -07001695 case Instruction::ADD_INT: {
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001696 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001697 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001698 SafeAdd(shadow_frame.GetVReg(inst->VRegB_23x()),
1699 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001700 inst = inst->Next_2xx();
1701 break;
Ian Rogersf72a11d2014-10-30 15:41:08 -07001702 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001703 case Instruction::SUB_INT:
1704 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001705 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001706 SafeSub(shadow_frame.GetVReg(inst->VRegB_23x()),
1707 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001708 inst = inst->Next_2xx();
1709 break;
1710 case Instruction::MUL_INT:
1711 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001712 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001713 SafeMul(shadow_frame.GetVReg(inst->VRegB_23x()),
1714 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001715 inst = inst->Next_2xx();
1716 break;
1717 case Instruction::DIV_INT: {
1718 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001719 bool success = DoIntDivide(shadow_frame, inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001720 shadow_frame.GetVReg(inst->VRegB_23x()),
1721 shadow_frame.GetVReg(inst->VRegC_23x()));
1722 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1723 break;
1724 }
1725 case Instruction::REM_INT: {
1726 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001727 bool success = DoIntRemainder(shadow_frame, inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001728 shadow_frame.GetVReg(inst->VRegB_23x()),
1729 shadow_frame.GetVReg(inst->VRegC_23x()));
1730 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1731 break;
1732 }
1733 case Instruction::SHL_INT:
1734 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001735 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001736 shadow_frame.GetVReg(inst->VRegB_23x()) <<
1737 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1738 inst = inst->Next_2xx();
1739 break;
1740 case Instruction::SHR_INT:
1741 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001742 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001743 shadow_frame.GetVReg(inst->VRegB_23x()) >>
1744 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1745 inst = inst->Next_2xx();
1746 break;
1747 case Instruction::USHR_INT:
1748 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001749 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001750 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_23x())) >>
1751 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1752 inst = inst->Next_2xx();
1753 break;
1754 case Instruction::AND_INT:
1755 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001756 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001757 shadow_frame.GetVReg(inst->VRegB_23x()) &
1758 shadow_frame.GetVReg(inst->VRegC_23x()));
1759 inst = inst->Next_2xx();
1760 break;
1761 case Instruction::OR_INT:
1762 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001763 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001764 shadow_frame.GetVReg(inst->VRegB_23x()) |
1765 shadow_frame.GetVReg(inst->VRegC_23x()));
1766 inst = inst->Next_2xx();
1767 break;
1768 case Instruction::XOR_INT:
1769 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001770 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001771 shadow_frame.GetVReg(inst->VRegB_23x()) ^
1772 shadow_frame.GetVReg(inst->VRegC_23x()));
1773 inst = inst->Next_2xx();
1774 break;
1775 case Instruction::ADD_LONG:
1776 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001777 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001778 SafeAdd(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1779 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001780 inst = inst->Next_2xx();
1781 break;
1782 case Instruction::SUB_LONG:
1783 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001784 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001785 SafeSub(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1786 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001787 inst = inst->Next_2xx();
1788 break;
1789 case Instruction::MUL_LONG:
1790 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001791 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001792 SafeMul(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1793 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001794 inst = inst->Next_2xx();
1795 break;
1796 case Instruction::DIV_LONG:
1797 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001798 DoLongDivide(shadow_frame, inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001799 shadow_frame.GetVRegLong(inst->VRegB_23x()),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001800 shadow_frame.GetVRegLong(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001801 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_2xx);
1802 break;
1803 case Instruction::REM_LONG:
1804 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001805 DoLongRemainder(shadow_frame, inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001806 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1807 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1808 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_2xx);
1809 break;
1810 case Instruction::AND_LONG:
1811 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001812 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001813 shadow_frame.GetVRegLong(inst->VRegB_23x()) &
1814 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1815 inst = inst->Next_2xx();
1816 break;
1817 case Instruction::OR_LONG:
1818 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001819 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001820 shadow_frame.GetVRegLong(inst->VRegB_23x()) |
1821 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1822 inst = inst->Next_2xx();
1823 break;
1824 case Instruction::XOR_LONG:
1825 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001826 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001827 shadow_frame.GetVRegLong(inst->VRegB_23x()) ^
1828 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1829 inst = inst->Next_2xx();
1830 break;
1831 case Instruction::SHL_LONG:
1832 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001833 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001834 shadow_frame.GetVRegLong(inst->VRegB_23x()) <<
1835 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1836 inst = inst->Next_2xx();
1837 break;
1838 case Instruction::SHR_LONG:
1839 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001840 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001841 shadow_frame.GetVRegLong(inst->VRegB_23x()) >>
1842 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1843 inst = inst->Next_2xx();
1844 break;
1845 case Instruction::USHR_LONG:
1846 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001847 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001848 static_cast<uint64_t>(shadow_frame.GetVRegLong(inst->VRegB_23x())) >>
1849 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1850 inst = inst->Next_2xx();
1851 break;
1852 case Instruction::ADD_FLOAT:
1853 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001854 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001855 shadow_frame.GetVRegFloat(inst->VRegB_23x()) +
1856 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1857 inst = inst->Next_2xx();
1858 break;
1859 case Instruction::SUB_FLOAT:
1860 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001861 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001862 shadow_frame.GetVRegFloat(inst->VRegB_23x()) -
1863 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1864 inst = inst->Next_2xx();
1865 break;
1866 case Instruction::MUL_FLOAT:
1867 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001868 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001869 shadow_frame.GetVRegFloat(inst->VRegB_23x()) *
1870 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1871 inst = inst->Next_2xx();
1872 break;
1873 case Instruction::DIV_FLOAT:
1874 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001875 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001876 shadow_frame.GetVRegFloat(inst->VRegB_23x()) /
1877 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1878 inst = inst->Next_2xx();
1879 break;
1880 case Instruction::REM_FLOAT:
1881 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001882 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001883 fmodf(shadow_frame.GetVRegFloat(inst->VRegB_23x()),
1884 shadow_frame.GetVRegFloat(inst->VRegC_23x())));
1885 inst = inst->Next_2xx();
1886 break;
1887 case Instruction::ADD_DOUBLE:
1888 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001889 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001890 shadow_frame.GetVRegDouble(inst->VRegB_23x()) +
1891 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1892 inst = inst->Next_2xx();
1893 break;
1894 case Instruction::SUB_DOUBLE:
1895 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001896 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001897 shadow_frame.GetVRegDouble(inst->VRegB_23x()) -
1898 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1899 inst = inst->Next_2xx();
1900 break;
1901 case Instruction::MUL_DOUBLE:
1902 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001903 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001904 shadow_frame.GetVRegDouble(inst->VRegB_23x()) *
1905 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1906 inst = inst->Next_2xx();
1907 break;
1908 case Instruction::DIV_DOUBLE:
1909 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001910 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001911 shadow_frame.GetVRegDouble(inst->VRegB_23x()) /
1912 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1913 inst = inst->Next_2xx();
1914 break;
1915 case Instruction::REM_DOUBLE:
1916 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001917 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001918 fmod(shadow_frame.GetVRegDouble(inst->VRegB_23x()),
1919 shadow_frame.GetVRegDouble(inst->VRegC_23x())));
1920 inst = inst->Next_2xx();
1921 break;
1922 case Instruction::ADD_INT_2ADDR: {
1923 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001924 uint4_t vregA = inst->VRegA_12x(inst_data);
Ian Rogersf72a11d2014-10-30 15:41:08 -07001925 shadow_frame.SetVReg(vregA, SafeAdd(shadow_frame.GetVReg(vregA),
1926 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001927 inst = inst->Next_1xx();
1928 break;
1929 }
1930 case Instruction::SUB_INT_2ADDR: {
1931 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001932 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001933 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07001934 SafeSub(shadow_frame.GetVReg(vregA),
1935 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001936 inst = inst->Next_1xx();
1937 break;
1938 }
1939 case Instruction::MUL_INT_2ADDR: {
1940 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001941 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001942 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07001943 SafeMul(shadow_frame.GetVReg(vregA),
1944 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001945 inst = inst->Next_1xx();
1946 break;
1947 }
1948 case Instruction::DIV_INT_2ADDR: {
1949 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001950 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001951 bool success = DoIntDivide(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001952 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001953 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_1xx);
1954 break;
1955 }
1956 case Instruction::REM_INT_2ADDR: {
1957 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001958 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001959 bool success = DoIntRemainder(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001960 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001961 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_1xx);
1962 break;
1963 }
1964 case Instruction::SHL_INT_2ADDR: {
1965 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001966 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001967 shadow_frame.SetVReg(vregA,
1968 shadow_frame.GetVReg(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001969 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001970 inst = inst->Next_1xx();
1971 break;
1972 }
1973 case Instruction::SHR_INT_2ADDR: {
1974 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001975 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001976 shadow_frame.SetVReg(vregA,
1977 shadow_frame.GetVReg(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001978 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001979 inst = inst->Next_1xx();
1980 break;
1981 }
1982 case Instruction::USHR_INT_2ADDR: {
1983 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001984 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001985 shadow_frame.SetVReg(vregA,
1986 static_cast<uint32_t>(shadow_frame.GetVReg(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001987 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001988 inst = inst->Next_1xx();
1989 break;
1990 }
1991 case Instruction::AND_INT_2ADDR: {
1992 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001993 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001994 shadow_frame.SetVReg(vregA,
1995 shadow_frame.GetVReg(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001996 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001997 inst = inst->Next_1xx();
1998 break;
1999 }
2000 case Instruction::OR_INT_2ADDR: {
2001 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002002 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002003 shadow_frame.SetVReg(vregA,
2004 shadow_frame.GetVReg(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002005 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002006 inst = inst->Next_1xx();
2007 break;
2008 }
2009 case Instruction::XOR_INT_2ADDR: {
2010 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002011 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002012 shadow_frame.SetVReg(vregA,
2013 shadow_frame.GetVReg(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002014 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002015 inst = inst->Next_1xx();
2016 break;
2017 }
2018 case Instruction::ADD_LONG_2ADDR: {
2019 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002020 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002021 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002022 SafeAdd(shadow_frame.GetVRegLong(vregA),
2023 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002024 inst = inst->Next_1xx();
2025 break;
2026 }
2027 case Instruction::SUB_LONG_2ADDR: {
2028 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002029 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002030 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002031 SafeSub(shadow_frame.GetVRegLong(vregA),
2032 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002033 inst = inst->Next_1xx();
2034 break;
2035 }
2036 case Instruction::MUL_LONG_2ADDR: {
2037 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002038 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002039 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002040 SafeMul(shadow_frame.GetVRegLong(vregA),
2041 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002042 inst = inst->Next_1xx();
2043 break;
2044 }
2045 case Instruction::DIV_LONG_2ADDR: {
2046 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002047 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002048 DoLongDivide(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002049 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002050 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx);
2051 break;
2052 }
2053 case Instruction::REM_LONG_2ADDR: {
2054 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002055 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002056 DoLongRemainder(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002057 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002058 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx);
2059 break;
2060 }
2061 case Instruction::AND_LONG_2ADDR: {
2062 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002063 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002064 shadow_frame.SetVRegLong(vregA,
2065 shadow_frame.GetVRegLong(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002066 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002067 inst = inst->Next_1xx();
2068 break;
2069 }
2070 case Instruction::OR_LONG_2ADDR: {
2071 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002072 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002073 shadow_frame.SetVRegLong(vregA,
2074 shadow_frame.GetVRegLong(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002075 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002076 inst = inst->Next_1xx();
2077 break;
2078 }
2079 case Instruction::XOR_LONG_2ADDR: {
2080 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002081 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002082 shadow_frame.SetVRegLong(vregA,
2083 shadow_frame.GetVRegLong(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002084 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002085 inst = inst->Next_1xx();
2086 break;
2087 }
2088 case Instruction::SHL_LONG_2ADDR: {
2089 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002090 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002091 shadow_frame.SetVRegLong(vregA,
2092 shadow_frame.GetVRegLong(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002093 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002094 inst = inst->Next_1xx();
2095 break;
2096 }
2097 case Instruction::SHR_LONG_2ADDR: {
2098 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002099 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002100 shadow_frame.SetVRegLong(vregA,
2101 shadow_frame.GetVRegLong(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002102 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002103 inst = inst->Next_1xx();
2104 break;
2105 }
2106 case Instruction::USHR_LONG_2ADDR: {
2107 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002108 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002109 shadow_frame.SetVRegLong(vregA,
2110 static_cast<uint64_t>(shadow_frame.GetVRegLong(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002111 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002112 inst = inst->Next_1xx();
2113 break;
2114 }
2115 case Instruction::ADD_FLOAT_2ADDR: {
2116 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002117 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002118 shadow_frame.SetVRegFloat(vregA,
2119 shadow_frame.GetVRegFloat(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002120 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002121 inst = inst->Next_1xx();
2122 break;
2123 }
2124 case Instruction::SUB_FLOAT_2ADDR: {
2125 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002126 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002127 shadow_frame.SetVRegFloat(vregA,
2128 shadow_frame.GetVRegFloat(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002129 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002130 inst = inst->Next_1xx();
2131 break;
2132 }
2133 case Instruction::MUL_FLOAT_2ADDR: {
2134 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002135 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002136 shadow_frame.SetVRegFloat(vregA,
2137 shadow_frame.GetVRegFloat(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002138 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002139 inst = inst->Next_1xx();
2140 break;
2141 }
2142 case Instruction::DIV_FLOAT_2ADDR: {
2143 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002144 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002145 shadow_frame.SetVRegFloat(vregA,
2146 shadow_frame.GetVRegFloat(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002147 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002148 inst = inst->Next_1xx();
2149 break;
2150 }
2151 case Instruction::REM_FLOAT_2ADDR: {
2152 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002153 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002154 shadow_frame.SetVRegFloat(vregA,
2155 fmodf(shadow_frame.GetVRegFloat(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002156 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002157 inst = inst->Next_1xx();
2158 break;
2159 }
2160 case Instruction::ADD_DOUBLE_2ADDR: {
2161 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002162 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002163 shadow_frame.SetVRegDouble(vregA,
2164 shadow_frame.GetVRegDouble(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002165 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002166 inst = inst->Next_1xx();
2167 break;
2168 }
2169 case Instruction::SUB_DOUBLE_2ADDR: {
2170 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002171 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002172 shadow_frame.SetVRegDouble(vregA,
2173 shadow_frame.GetVRegDouble(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002174 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002175 inst = inst->Next_1xx();
2176 break;
2177 }
2178 case Instruction::MUL_DOUBLE_2ADDR: {
2179 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002180 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002181 shadow_frame.SetVRegDouble(vregA,
2182 shadow_frame.GetVRegDouble(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002183 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002184 inst = inst->Next_1xx();
2185 break;
2186 }
2187 case Instruction::DIV_DOUBLE_2ADDR: {
2188 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002189 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002190 shadow_frame.SetVRegDouble(vregA,
2191 shadow_frame.GetVRegDouble(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002192 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002193 inst = inst->Next_1xx();
2194 break;
2195 }
2196 case Instruction::REM_DOUBLE_2ADDR: {
2197 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002198 uint4_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002199 shadow_frame.SetVRegDouble(vregA,
2200 fmod(shadow_frame.GetVRegDouble(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002201 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002202 inst = inst->Next_1xx();
2203 break;
2204 }
2205 case Instruction::ADD_INT_LIT16:
2206 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002207 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002208 SafeAdd(shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2209 inst->VRegC_22s()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002210 inst = inst->Next_2xx();
2211 break;
Ian Rogersf72a11d2014-10-30 15:41:08 -07002212 case Instruction::RSUB_INT_LIT16:
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002213 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002214 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002215 SafeSub(inst->VRegC_22s(),
2216 shadow_frame.GetVReg(inst->VRegB_22s(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002217 inst = inst->Next_2xx();
2218 break;
2219 case Instruction::MUL_INT_LIT16:
2220 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002221 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002222 SafeMul(shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2223 inst->VRegC_22s()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002224 inst = inst->Next_2xx();
2225 break;
2226 case Instruction::DIV_INT_LIT16: {
2227 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002228 bool success = DoIntDivide(shadow_frame, inst->VRegA_22s(inst_data),
Mathieu Chartier2cebb242015-04-21 16:50:40 -07002229 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2230 inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002231 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
2232 break;
2233 }
2234 case Instruction::REM_INT_LIT16: {
2235 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002236 bool success = DoIntRemainder(shadow_frame, inst->VRegA_22s(inst_data),
Mathieu Chartier2cebb242015-04-21 16:50:40 -07002237 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2238 inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002239 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
2240 break;
2241 }
2242 case Instruction::AND_INT_LIT16:
2243 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002244 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2245 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) &
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002246 inst->VRegC_22s());
2247 inst = inst->Next_2xx();
2248 break;
2249 case Instruction::OR_INT_LIT16:
2250 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002251 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2252 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) |
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002253 inst->VRegC_22s());
2254 inst = inst->Next_2xx();
2255 break;
2256 case Instruction::XOR_INT_LIT16:
2257 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002258 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2259 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) ^
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002260 inst->VRegC_22s());
2261 inst = inst->Next_2xx();
2262 break;
2263 case Instruction::ADD_INT_LIT8:
2264 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002265 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002266 SafeAdd(shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002267 inst = inst->Next_2xx();
2268 break;
2269 case Instruction::RSUB_INT_LIT8:
2270 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002271 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002272 SafeSub(inst->VRegC_22b(), shadow_frame.GetVReg(inst->VRegB_22b())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002273 inst = inst->Next_2xx();
2274 break;
2275 case Instruction::MUL_INT_LIT8:
2276 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002277 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002278 SafeMul(shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002279 inst = inst->Next_2xx();
2280 break;
2281 case Instruction::DIV_INT_LIT8: {
2282 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002283 bool success = DoIntDivide(shadow_frame, inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002284 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
2285 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
2286 break;
2287 }
2288 case Instruction::REM_INT_LIT8: {
2289 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002290 bool success = DoIntRemainder(shadow_frame, inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002291 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
2292 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
2293 break;
2294 }
2295 case Instruction::AND_INT_LIT8:
2296 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002297 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002298 shadow_frame.GetVReg(inst->VRegB_22b()) &
2299 inst->VRegC_22b());
2300 inst = inst->Next_2xx();
2301 break;
2302 case Instruction::OR_INT_LIT8:
2303 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002304 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002305 shadow_frame.GetVReg(inst->VRegB_22b()) |
2306 inst->VRegC_22b());
2307 inst = inst->Next_2xx();
2308 break;
2309 case Instruction::XOR_INT_LIT8:
2310 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002311 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002312 shadow_frame.GetVReg(inst->VRegB_22b()) ^
2313 inst->VRegC_22b());
2314 inst = inst->Next_2xx();
2315 break;
2316 case Instruction::SHL_INT_LIT8:
2317 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002318 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002319 shadow_frame.GetVReg(inst->VRegB_22b()) <<
2320 (inst->VRegC_22b() & 0x1f));
2321 inst = inst->Next_2xx();
2322 break;
2323 case Instruction::SHR_INT_LIT8:
2324 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002325 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002326 shadow_frame.GetVReg(inst->VRegB_22b()) >>
2327 (inst->VRegC_22b() & 0x1f));
2328 inst = inst->Next_2xx();
2329 break;
2330 case Instruction::USHR_INT_LIT8:
2331 PREAMBLE();
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002332 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002333 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_22b())) >>
2334 (inst->VRegC_22b() & 0x1f));
2335 inst = inst->Next_2xx();
2336 break;
2337 case Instruction::UNUSED_3E ... Instruction::UNUSED_43:
Narayan Kamath8ec3bd22016-08-03 12:46:23 +01002338 case Instruction::UNUSED_F3 ... Instruction::UNUSED_F9:
2339 case Instruction::UNUSED_FC ... Instruction::UNUSED_FF:
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002340 case Instruction::UNUSED_79:
2341 case Instruction::UNUSED_7A:
Ian Rogerse94652f2014-12-02 11:13:19 -08002342 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002343 }
buzbee1452bee2015-03-06 14:43:04 -08002344 } while (!interpret_one_instruction);
2345 // Record where we stopped.
2346 shadow_frame.SetDexPC(inst->GetDexPc(insns));
buzbeed6b48db2016-01-28 15:48:55 -08002347 return result_register;
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002348} // NOLINT(readability/fn_size)
2349
2350// Explicit definitions of ExecuteSwitchImpl.
Andreas Gampe5e26eb12016-08-22 17:54:17 -07002351template HOT_ATTR
Ian Rogerse94652f2014-12-02 11:13:19 -08002352JValue ExecuteSwitchImpl<true, false>(Thread* self, const DexFile::CodeItem* code_item,
buzbee1452bee2015-03-06 14:43:04 -08002353 ShadowFrame& shadow_frame, JValue result_register,
2354 bool interpret_one_instruction);
Andreas Gampe5e26eb12016-08-22 17:54:17 -07002355template HOT_ATTR
Ian Rogerse94652f2014-12-02 11:13:19 -08002356JValue ExecuteSwitchImpl<false, false>(Thread* self, const DexFile::CodeItem* code_item,
buzbee1452bee2015-03-06 14:43:04 -08002357 ShadowFrame& shadow_frame, JValue result_register,
2358 bool interpret_one_instruction);
Andreas Gampe5e26eb12016-08-22 17:54:17 -07002359template
Ian Rogerse94652f2014-12-02 11:13:19 -08002360JValue ExecuteSwitchImpl<true, true>(Thread* self, const DexFile::CodeItem* code_item,
buzbee1452bee2015-03-06 14:43:04 -08002361 ShadowFrame& shadow_frame, JValue result_register,
2362 bool interpret_one_instruction);
Andreas Gampe5e26eb12016-08-22 17:54:17 -07002363template
Ian Rogerse94652f2014-12-02 11:13:19 -08002364JValue ExecuteSwitchImpl<false, true>(Thread* self, const DexFile::CodeItem* code_item,
buzbee1452bee2015-03-06 14:43:04 -08002365 ShadowFrame& shadow_frame, JValue result_register,
2366 bool interpret_one_instruction);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002367
2368} // namespace interpreter
2369} // namespace art