blob: 2f0b5e91c498569d55d3eb5e15f81b62721c0831 [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
17#include "interpreter_common.h"
18
19namespace art {
20namespace interpreter {
21
22#define HANDLE_PENDING_EXCEPTION() \
23 do { \
24 CHECK(self->IsExceptionPending()); \
Sebastien Hertz1eda2262013-09-09 16:53:14 +020025 if (UNLIKELY(self->TestAllFlags())) { \
26 CheckSuspend(self); \
27 } \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020028 uint32_t found_dex_pc = FindNextInstructionFollowingException(self, shadow_frame, \
29 inst->GetDexPc(insns), \
30 this_object_ref, \
31 instrumentation); \
32 if (found_dex_pc == DexFile::kDexNoIndex) { \
33 return JValue(); /* Handled in caller. */ \
34 } else { \
35 int32_t displacement = static_cast<int32_t>(found_dex_pc) - static_cast<int32_t>(dex_pc); \
36 inst = inst->RelativeAt(displacement); \
37 } \
38 } while (false)
39
40#define POSSIBLY_HANDLE_PENDING_EXCEPTION(_is_exception_pending, _next_function) \
41 do { \
42 if (UNLIKELY(_is_exception_pending)) { \
43 HANDLE_PENDING_EXCEPTION(); \
44 } else { \
45 inst = inst->_next_function(); \
46 } \
47 } while (false)
48
49// Code to run before each dex instruction.
50#define PREAMBLE()
51
52template<bool do_access_check>
53static JValue ExecuteSwitchImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item,
54 ShadowFrame& shadow_frame, JValue result_register) {
55 if (UNLIKELY(!shadow_frame.HasReferenceArray())) {
56 LOG(FATAL) << "Invalid shadow frame for interpreter use";
57 return JValue();
58 }
59 self->VerifyStack();
60 instrumentation::Instrumentation* const instrumentation = Runtime::Current()->GetInstrumentation();
61
62 // As the 'this' object won't change during the execution of current code, we
63 // want to cache it in local variables. Nevertheless, in order to let the
64 // garbage collector access it, we store it into sirt references.
65 SirtRef<Object> this_object_ref(self, shadow_frame.GetThisObject(code_item->ins_size_));
66
67 uint32_t dex_pc = shadow_frame.GetDexPC();
68 if (LIKELY(dex_pc == 0)) { // We are entering the method as opposed to deoptimizing..
69 if (UNLIKELY(instrumentation->HasMethodEntryListeners())) {
70 instrumentation->MethodEnterEvent(self, this_object_ref.get(),
71 shadow_frame.GetMethod(), 0);
72 }
73 }
74 const uint16_t* const insns = code_item->insns_;
75 const Instruction* inst = Instruction::At(insns + dex_pc);
76 while (true) {
77 dex_pc = inst->GetDexPc(insns);
78 shadow_frame.SetDexPC(dex_pc);
Sebastien Hertz8ece0502013-08-07 11:26:41 +020079 if (UNLIKELY(instrumentation->HasDexPcListeners())) {
80 instrumentation->DexPcMovedEvent(self, this_object_ref.get(),
81 shadow_frame.GetMethod(), dex_pc);
82 }
83 TraceExecution(shadow_frame, inst, dex_pc, mh);
84 switch (inst->Opcode()) {
85 case Instruction::NOP:
86 PREAMBLE();
87 inst = inst->Next_1xx();
88 break;
89 case Instruction::MOVE:
90 PREAMBLE();
91 shadow_frame.SetVReg(inst->VRegA_12x(),
92 shadow_frame.GetVReg(inst->VRegB_12x()));
93 inst = inst->Next_1xx();
94 break;
95 case Instruction::MOVE_FROM16:
96 PREAMBLE();
97 shadow_frame.SetVReg(inst->VRegA_22x(),
98 shadow_frame.GetVReg(inst->VRegB_22x()));
99 inst = inst->Next_2xx();
100 break;
101 case Instruction::MOVE_16:
102 PREAMBLE();
103 shadow_frame.SetVReg(inst->VRegA_32x(),
104 shadow_frame.GetVReg(inst->VRegB_32x()));
105 inst = inst->Next_3xx();
106 break;
107 case Instruction::MOVE_WIDE:
108 PREAMBLE();
109 shadow_frame.SetVRegLong(inst->VRegA_12x(),
110 shadow_frame.GetVRegLong(inst->VRegB_12x()));
111 inst = inst->Next_1xx();
112 break;
113 case Instruction::MOVE_WIDE_FROM16:
114 PREAMBLE();
115 shadow_frame.SetVRegLong(inst->VRegA_22x(),
116 shadow_frame.GetVRegLong(inst->VRegB_22x()));
117 inst = inst->Next_2xx();
118 break;
119 case Instruction::MOVE_WIDE_16:
120 PREAMBLE();
121 shadow_frame.SetVRegLong(inst->VRegA_32x(),
122 shadow_frame.GetVRegLong(inst->VRegB_32x()));
123 inst = inst->Next_3xx();
124 break;
125 case Instruction::MOVE_OBJECT:
126 PREAMBLE();
127 shadow_frame.SetVRegReference(inst->VRegA_12x(),
128 shadow_frame.GetVRegReference(inst->VRegB_12x()));
129 inst = inst->Next_1xx();
130 break;
131 case Instruction::MOVE_OBJECT_FROM16:
132 PREAMBLE();
133 shadow_frame.SetVRegReference(inst->VRegA_22x(),
134 shadow_frame.GetVRegReference(inst->VRegB_22x()));
135 inst = inst->Next_2xx();
136 break;
137 case Instruction::MOVE_OBJECT_16:
138 PREAMBLE();
139 shadow_frame.SetVRegReference(inst->VRegA_32x(),
140 shadow_frame.GetVRegReference(inst->VRegB_32x()));
141 inst = inst->Next_3xx();
142 break;
143 case Instruction::MOVE_RESULT:
144 PREAMBLE();
145 shadow_frame.SetVReg(inst->VRegA_11x(), result_register.GetI());
146 inst = inst->Next_1xx();
147 break;
148 case Instruction::MOVE_RESULT_WIDE:
149 PREAMBLE();
150 shadow_frame.SetVRegLong(inst->VRegA_11x(), result_register.GetJ());
151 inst = inst->Next_1xx();
152 break;
153 case Instruction::MOVE_RESULT_OBJECT:
154 PREAMBLE();
155 shadow_frame.SetVRegReference(inst->VRegA_11x(), result_register.GetL());
156 inst = inst->Next_1xx();
157 break;
158 case Instruction::MOVE_EXCEPTION: {
159 PREAMBLE();
160 Throwable* exception = self->GetException(NULL);
161 self->ClearException();
162 shadow_frame.SetVRegReference(inst->VRegA_11x(), exception);
163 inst = inst->Next_1xx();
164 break;
165 }
166 case Instruction::RETURN_VOID: {
167 PREAMBLE();
168 JValue result;
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200169 if (UNLIKELY(self->TestAllFlags())) {
170 CheckSuspend(self);
171 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200172 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
173 instrumentation->MethodExitEvent(self, this_object_ref.get(),
174 shadow_frame.GetMethod(), inst->GetDexPc(insns),
175 result);
176 }
177 return result;
178 }
179 case Instruction::RETURN_VOID_BARRIER: {
180 PREAMBLE();
181 ANDROID_MEMBAR_STORE();
182 JValue result;
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200183 if (UNLIKELY(self->TestAllFlags())) {
184 CheckSuspend(self);
185 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200186 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
187 instrumentation->MethodExitEvent(self, this_object_ref.get(),
188 shadow_frame.GetMethod(), inst->GetDexPc(insns),
189 result);
190 }
191 return result;
192 }
193 case Instruction::RETURN: {
194 PREAMBLE();
195 JValue result;
196 result.SetJ(0);
197 result.SetI(shadow_frame.GetVReg(inst->VRegA_11x()));
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200198 if (UNLIKELY(self->TestAllFlags())) {
199 CheckSuspend(self);
200 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200201 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
202 instrumentation->MethodExitEvent(self, this_object_ref.get(),
203 shadow_frame.GetMethod(), inst->GetDexPc(insns),
204 result);
205 }
206 return result;
207 }
208 case Instruction::RETURN_WIDE: {
209 PREAMBLE();
210 JValue result;
211 result.SetJ(shadow_frame.GetVRegLong(inst->VRegA_11x()));
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200212 if (UNLIKELY(self->TestAllFlags())) {
213 CheckSuspend(self);
214 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200215 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
216 instrumentation->MethodExitEvent(self, this_object_ref.get(),
217 shadow_frame.GetMethod(), inst->GetDexPc(insns),
218 result);
219 }
220 return result;
221 }
222 case Instruction::RETURN_OBJECT: {
223 PREAMBLE();
224 JValue result;
225 result.SetJ(0);
226 result.SetL(shadow_frame.GetVRegReference(inst->VRegA_11x()));
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200227 if (UNLIKELY(self->TestAllFlags())) {
228 CheckSuspend(self);
229 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200230 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
231 instrumentation->MethodExitEvent(self, this_object_ref.get(),
232 shadow_frame.GetMethod(), inst->GetDexPc(insns),
233 result);
234 }
235 return result;
236 }
237 case Instruction::CONST_4: {
238 PREAMBLE();
239 uint4_t dst = inst->VRegA_11n();
240 int4_t val = inst->VRegB_11n();
241 shadow_frame.SetVReg(dst, val);
242 if (val == 0) {
243 shadow_frame.SetVRegReference(dst, NULL);
244 }
245 inst = inst->Next_1xx();
246 break;
247 }
248 case Instruction::CONST_16: {
249 PREAMBLE();
250 uint8_t dst = inst->VRegA_21s();
251 int16_t val = inst->VRegB_21s();
252 shadow_frame.SetVReg(dst, val);
253 if (val == 0) {
254 shadow_frame.SetVRegReference(dst, NULL);
255 }
256 inst = inst->Next_2xx();
257 break;
258 }
259 case Instruction::CONST: {
260 PREAMBLE();
261 uint8_t dst = inst->VRegA_31i();
262 int32_t val = inst->VRegB_31i();
263 shadow_frame.SetVReg(dst, val);
264 if (val == 0) {
265 shadow_frame.SetVRegReference(dst, NULL);
266 }
267 inst = inst->Next_3xx();
268 break;
269 }
270 case Instruction::CONST_HIGH16: {
271 PREAMBLE();
272 uint8_t dst = inst->VRegA_21h();
273 int32_t val = static_cast<int32_t>(inst->VRegB_21h() << 16);
274 shadow_frame.SetVReg(dst, val);
275 if (val == 0) {
276 shadow_frame.SetVRegReference(dst, NULL);
277 }
278 inst = inst->Next_2xx();
279 break;
280 }
281 case Instruction::CONST_WIDE_16:
282 PREAMBLE();
283 shadow_frame.SetVRegLong(inst->VRegA_21s(), inst->VRegB_21s());
284 inst = inst->Next_2xx();
285 break;
286 case Instruction::CONST_WIDE_32:
287 PREAMBLE();
288 shadow_frame.SetVRegLong(inst->VRegA_31i(), inst->VRegB_31i());
289 inst = inst->Next_3xx();
290 break;
291 case Instruction::CONST_WIDE:
292 PREAMBLE();
293 shadow_frame.SetVRegLong(inst->VRegA_51l(), inst->VRegB_51l());
294 inst = inst->Next_51l();
295 break;
296 case Instruction::CONST_WIDE_HIGH16:
297 shadow_frame.SetVRegLong(inst->VRegA_21h(),
298 static_cast<uint64_t>(inst->VRegB_21h()) << 48);
299 inst = inst->Next_2xx();
300 break;
301 case Instruction::CONST_STRING: {
302 PREAMBLE();
303 String* s = ResolveString(self, mh, inst->VRegB_21c());
304 if (UNLIKELY(s == NULL)) {
305 HANDLE_PENDING_EXCEPTION();
306 } else {
307 shadow_frame.SetVRegReference(inst->VRegA_21c(), s);
308 inst = inst->Next_2xx();
309 }
310 break;
311 }
312 case Instruction::CONST_STRING_JUMBO: {
313 PREAMBLE();
314 String* s = ResolveString(self, mh, inst->VRegB_31c());
315 if (UNLIKELY(s == NULL)) {
316 HANDLE_PENDING_EXCEPTION();
317 } else {
318 shadow_frame.SetVRegReference(inst->VRegA_31c(), s);
319 inst = inst->Next_3xx();
320 }
321 break;
322 }
323 case Instruction::CONST_CLASS: {
324 PREAMBLE();
325 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
326 self, false, do_access_check);
327 if (UNLIKELY(c == NULL)) {
328 HANDLE_PENDING_EXCEPTION();
329 } else {
330 shadow_frame.SetVRegReference(inst->VRegA_21c(), c);
331 inst = inst->Next_2xx();
332 }
333 break;
334 }
335 case Instruction::MONITOR_ENTER: {
336 PREAMBLE();
337 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x());
338 if (UNLIKELY(obj == NULL)) {
339 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
340 HANDLE_PENDING_EXCEPTION();
341 } else {
342 DoMonitorEnter(self, obj);
343 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx);
344 }
345 break;
346 }
347 case Instruction::MONITOR_EXIT: {
348 PREAMBLE();
349 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x());
350 if (UNLIKELY(obj == NULL)) {
351 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
352 HANDLE_PENDING_EXCEPTION();
353 } else {
354 DoMonitorExit(self, obj);
355 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx);
356 }
357 break;
358 }
359 case Instruction::CHECK_CAST: {
360 PREAMBLE();
361 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
362 self, false, do_access_check);
363 if (UNLIKELY(c == NULL)) {
364 HANDLE_PENDING_EXCEPTION();
365 } else {
366 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_21c());
367 if (UNLIKELY(obj != NULL && !obj->InstanceOf(c))) {
368 ThrowClassCastException(c, obj->GetClass());
369 HANDLE_PENDING_EXCEPTION();
370 } else {
371 inst = inst->Next_2xx();
372 }
373 }
374 break;
375 }
376 case Instruction::INSTANCE_OF: {
377 PREAMBLE();
378 Class* c = ResolveVerifyAndClinit(inst->VRegC_22c(), shadow_frame.GetMethod(),
379 self, false, do_access_check);
380 if (UNLIKELY(c == NULL)) {
381 HANDLE_PENDING_EXCEPTION();
382 } else {
383 Object* obj = shadow_frame.GetVRegReference(inst->VRegB_22c());
384 shadow_frame.SetVReg(inst->VRegA_22c(), (obj != NULL && obj->InstanceOf(c)) ? 1 : 0);
385 inst = inst->Next_2xx();
386 }
387 break;
388 }
389 case Instruction::ARRAY_LENGTH: {
390 PREAMBLE();
391 Object* array = shadow_frame.GetVRegReference(inst->VRegB_12x());
392 if (UNLIKELY(array == NULL)) {
393 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
394 HANDLE_PENDING_EXCEPTION();
395 } else {
396 shadow_frame.SetVReg(inst->VRegA_12x(), array->AsArray()->GetLength());
397 inst = inst->Next_1xx();
398 }
399 break;
400 }
401 case Instruction::NEW_INSTANCE: {
402 PREAMBLE();
403 Object* obj = AllocObjectFromCode(inst->VRegB_21c(), shadow_frame.GetMethod(),
404 self, do_access_check);
405 if (UNLIKELY(obj == NULL)) {
406 HANDLE_PENDING_EXCEPTION();
407 } else {
408 shadow_frame.SetVRegReference(inst->VRegA_21c(), obj);
409 inst = inst->Next_2xx();
410 }
411 break;
412 }
413 case Instruction::NEW_ARRAY: {
414 PREAMBLE();
415 int32_t length = shadow_frame.GetVReg(inst->VRegB_22c());
416 Object* obj = AllocArrayFromCode(inst->VRegC_22c(), shadow_frame.GetMethod(),
417 length, self, do_access_check);
418 if (UNLIKELY(obj == NULL)) {
419 HANDLE_PENDING_EXCEPTION();
420 } else {
421 shadow_frame.SetVRegReference(inst->VRegA_22c(), obj);
422 inst = inst->Next_2xx();
423 }
424 break;
425 }
426 case Instruction::FILLED_NEW_ARRAY: {
427 PREAMBLE();
428 bool success = DoFilledNewArray<false, do_access_check>(inst, shadow_frame,
429 self, &result_register);
430 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
431 break;
432 }
433 case Instruction::FILLED_NEW_ARRAY_RANGE: {
434 PREAMBLE();
435 bool success = DoFilledNewArray<true, do_access_check>(inst, shadow_frame,
436 self, &result_register);
437 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
438 break;
439 }
440 case Instruction::FILL_ARRAY_DATA: {
441 PREAMBLE();
442 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_31t());
443 if (UNLIKELY(obj == NULL)) {
444 ThrowNullPointerException(NULL, "null array in FILL_ARRAY_DATA");
445 HANDLE_PENDING_EXCEPTION();
446 break;
447 }
448 Array* array = obj->AsArray();
449 DCHECK(array->IsArrayInstance() && !array->IsObjectArray());
450 const uint16_t* payload_addr = reinterpret_cast<const uint16_t*>(inst) + inst->VRegB_31t();
451 const Instruction::ArrayDataPayload* payload =
452 reinterpret_cast<const Instruction::ArrayDataPayload*>(payload_addr);
453 if (UNLIKELY(static_cast<int32_t>(payload->element_count) > array->GetLength())) {
454 self->ThrowNewExceptionF(shadow_frame.GetCurrentLocationForThrow(),
455 "Ljava/lang/ArrayIndexOutOfBoundsException;",
456 "failed FILL_ARRAY_DATA; length=%d, index=%d",
457 array->GetLength(), payload->element_count);
458 HANDLE_PENDING_EXCEPTION();
459 break;
460 }
461 uint32_t size_in_bytes = payload->element_count * payload->element_width;
462 memcpy(array->GetRawData(payload->element_width), payload->data, size_in_bytes);
463 inst = inst->Next_3xx();
464 break;
465 }
466 case Instruction::THROW: {
467 PREAMBLE();
468 Object* exception = shadow_frame.GetVRegReference(inst->VRegA_11x());
469 if (UNLIKELY(exception == NULL)) {
470 ThrowNullPointerException(NULL, "throw with null exception");
471 } else {
472 self->SetException(shadow_frame.GetCurrentLocationForThrow(), exception->AsThrowable());
473 }
474 HANDLE_PENDING_EXCEPTION();
475 break;
476 }
477 case Instruction::GOTO: {
478 PREAMBLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200479 int8_t offset = inst->VRegA_10t();
480 if (IsBackwardBranch(offset)) {
481 if (UNLIKELY(self->TestAllFlags())) {
482 CheckSuspend(self);
483 }
484 }
485 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200486 break;
487 }
488 case Instruction::GOTO_16: {
489 PREAMBLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200490 int16_t offset = inst->VRegA_20t();
491 if (IsBackwardBranch(offset)) {
492 if (UNLIKELY(self->TestAllFlags())) {
493 CheckSuspend(self);
494 }
495 }
496 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200497 break;
498 }
499 case Instruction::GOTO_32: {
500 PREAMBLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200501 int32_t offset = inst->VRegA_30t();
502 if (IsBackwardBranch(offset)) {
503 if (UNLIKELY(self->TestAllFlags())) {
504 CheckSuspend(self);
505 }
506 }
507 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200508 break;
509 }
510 case Instruction::PACKED_SWITCH: {
511 PREAMBLE();
512 int32_t offset = DoPackedSwitch(inst, shadow_frame);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200513 if (IsBackwardBranch(offset)) {
514 if (UNLIKELY(self->TestAllFlags())) {
515 CheckSuspend(self);
516 }
517 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200518 inst = inst->RelativeAt(offset);
519 break;
520 }
521 case Instruction::SPARSE_SWITCH: {
522 PREAMBLE();
523 int32_t offset = DoSparseSwitch(inst, shadow_frame);
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200524 if (IsBackwardBranch(offset)) {
525 if (UNLIKELY(self->TestAllFlags())) {
526 CheckSuspend(self);
527 }
528 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200529 inst = inst->RelativeAt(offset);
530 break;
531 }
532 case Instruction::CMPL_FLOAT: {
533 PREAMBLE();
534 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
535 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
536 int32_t result;
537 if (val1 > val2) {
538 result = 1;
539 } else if (val1 == val2) {
540 result = 0;
541 } else {
542 result = -1;
543 }
544 shadow_frame.SetVReg(inst->VRegA_23x(), result);
545 inst = inst->Next_2xx();
546 break;
547 }
548 case Instruction::CMPG_FLOAT: {
549 PREAMBLE();
550 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
551 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
552 int32_t result;
553 if (val1 < val2) {
554 result = -1;
555 } else if (val1 == val2) {
556 result = 0;
557 } else {
558 result = 1;
559 }
560 shadow_frame.SetVReg(inst->VRegA_23x(), result);
561 inst = inst->Next_2xx();
562 break;
563 }
564 case Instruction::CMPL_DOUBLE: {
565 PREAMBLE();
566 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
567 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
568 int32_t result;
569 if (val1 > val2) {
570 result = 1;
571 } else if (val1 == val2) {
572 result = 0;
573 } else {
574 result = -1;
575 }
576 shadow_frame.SetVReg(inst->VRegA_23x(), result);
577 inst = inst->Next_2xx();
578 break;
579 }
580
581 case Instruction::CMPG_DOUBLE: {
582 PREAMBLE();
583 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
584 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
585 int32_t result;
586 if (val1 < val2) {
587 result = -1;
588 } else if (val1 == val2) {
589 result = 0;
590 } else {
591 result = 1;
592 }
593 shadow_frame.SetVReg(inst->VRegA_23x(), result);
594 inst = inst->Next_2xx();
595 break;
596 }
597 case Instruction::CMP_LONG: {
598 PREAMBLE();
599 int64_t val1 = shadow_frame.GetVRegLong(inst->VRegB_23x());
600 int64_t val2 = shadow_frame.GetVRegLong(inst->VRegC_23x());
601 int32_t result;
602 if (val1 > val2) {
603 result = 1;
604 } else if (val1 == val2) {
605 result = 0;
606 } else {
607 result = -1;
608 }
609 shadow_frame.SetVReg(inst->VRegA_23x(), result);
610 inst = inst->Next_2xx();
611 break;
612 }
613 case Instruction::IF_EQ: {
614 PREAMBLE();
615 if (shadow_frame.GetVReg(inst->VRegA_22t()) == shadow_frame.GetVReg(inst->VRegB_22t())) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200616 int16_t offset = inst->VRegC_22t();
617 if (IsBackwardBranch(offset)) {
618 if (UNLIKELY(self->TestAllFlags())) {
619 CheckSuspend(self);
620 }
621 }
622 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200623 } else {
624 inst = inst->Next_2xx();
625 }
626 break;
627 }
628 case Instruction::IF_NE: {
629 PREAMBLE();
630 if (shadow_frame.GetVReg(inst->VRegA_22t()) != shadow_frame.GetVReg(inst->VRegB_22t())) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200631 int16_t offset = inst->VRegC_22t();
632 if (IsBackwardBranch(offset)) {
633 if (UNLIKELY(self->TestAllFlags())) {
634 CheckSuspend(self);
635 }
636 }
637 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200638 } else {
639 inst = inst->Next_2xx();
640 }
641 break;
642 }
643 case Instruction::IF_LT: {
644 PREAMBLE();
645 if (shadow_frame.GetVReg(inst->VRegA_22t()) < shadow_frame.GetVReg(inst->VRegB_22t())) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200646 int16_t offset = inst->VRegC_22t();
647 if (IsBackwardBranch(offset)) {
648 if (UNLIKELY(self->TestAllFlags())) {
649 CheckSuspend(self);
650 }
651 }
652 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200653 } else {
654 inst = inst->Next_2xx();
655 }
656 break;
657 }
658 case Instruction::IF_GE: {
659 PREAMBLE();
660 if (shadow_frame.GetVReg(inst->VRegA_22t()) >= shadow_frame.GetVReg(inst->VRegB_22t())) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200661 int16_t offset = inst->VRegC_22t();
662 if (IsBackwardBranch(offset)) {
663 if (UNLIKELY(self->TestAllFlags())) {
664 CheckSuspend(self);
665 }
666 }
667 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200668 } else {
669 inst = inst->Next_2xx();
670 }
671 break;
672 }
673 case Instruction::IF_GT: {
674 PREAMBLE();
675 if (shadow_frame.GetVReg(inst->VRegA_22t()) > shadow_frame.GetVReg(inst->VRegB_22t())) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200676 int16_t offset = inst->VRegC_22t();
677 if (IsBackwardBranch(offset)) {
678 if (UNLIKELY(self->TestAllFlags())) {
679 CheckSuspend(self);
680 }
681 }
682 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200683 } else {
684 inst = inst->Next_2xx();
685 }
686 break;
687 }
688 case Instruction::IF_LE: {
689 PREAMBLE();
690 if (shadow_frame.GetVReg(inst->VRegA_22t()) <= shadow_frame.GetVReg(inst->VRegB_22t())) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200691 int16_t offset = inst->VRegC_22t();
692 if (IsBackwardBranch(offset)) {
693 if (UNLIKELY(self->TestAllFlags())) {
694 CheckSuspend(self);
695 }
696 }
697 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200698 } else {
699 inst = inst->Next_2xx();
700 }
701 break;
702 }
703 case Instruction::IF_EQZ: {
704 PREAMBLE();
705 if (shadow_frame.GetVReg(inst->VRegA_21t()) == 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200706 int16_t offset = inst->VRegB_21t();
707 if (IsBackwardBranch(offset)) {
708 if (UNLIKELY(self->TestAllFlags())) {
709 CheckSuspend(self);
710 }
711 }
712 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200713 } else {
714 inst = inst->Next_2xx();
715 }
716 break;
717 }
718 case Instruction::IF_NEZ: {
719 PREAMBLE();
720 if (shadow_frame.GetVReg(inst->VRegA_21t()) != 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200721 int16_t offset = inst->VRegB_21t();
722 if (IsBackwardBranch(offset)) {
723 if (UNLIKELY(self->TestAllFlags())) {
724 CheckSuspend(self);
725 }
726 }
727 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200728 } else {
729 inst = inst->Next_2xx();
730 }
731 break;
732 }
733 case Instruction::IF_LTZ: {
734 PREAMBLE();
735 if (shadow_frame.GetVReg(inst->VRegA_21t()) < 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200736 int16_t offset = inst->VRegB_21t();
737 if (IsBackwardBranch(offset)) {
738 if (UNLIKELY(self->TestAllFlags())) {
739 CheckSuspend(self);
740 }
741 }
742 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200743 } else {
744 inst = inst->Next_2xx();
745 }
746 break;
747 }
748 case Instruction::IF_GEZ: {
749 PREAMBLE();
750 if (shadow_frame.GetVReg(inst->VRegA_21t()) >= 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200751 int16_t offset = inst->VRegB_21t();
752 if (IsBackwardBranch(offset)) {
753 if (UNLIKELY(self->TestAllFlags())) {
754 CheckSuspend(self);
755 }
756 }
757 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200758 } else {
759 inst = inst->Next_2xx();
760 }
761 break;
762 }
763 case Instruction::IF_GTZ: {
764 PREAMBLE();
765 if (shadow_frame.GetVReg(inst->VRegA_21t()) > 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200766 int16_t offset = inst->VRegB_21t();
767 if (IsBackwardBranch(offset)) {
768 if (UNLIKELY(self->TestAllFlags())) {
769 CheckSuspend(self);
770 }
771 }
772 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200773 } else {
774 inst = inst->Next_2xx();
775 }
776 break;
777 }
778 case Instruction::IF_LEZ: {
779 PREAMBLE();
780 if (shadow_frame.GetVReg(inst->VRegA_21t()) <= 0) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200781 int16_t offset = inst->VRegB_21t();
782 if (IsBackwardBranch(offset)) {
783 if (UNLIKELY(self->TestAllFlags())) {
784 CheckSuspend(self);
785 }
786 }
787 inst = inst->RelativeAt(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200788 } else {
789 inst = inst->Next_2xx();
790 }
791 break;
792 }
793 case Instruction::AGET_BOOLEAN: {
794 PREAMBLE();
795 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
796 if (UNLIKELY(a == NULL)) {
797 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
798 HANDLE_PENDING_EXCEPTION();
799 break;
800 }
801 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
802 BooleanArray* array = a->AsBooleanArray();
803 if (LIKELY(array->IsValidIndex(index))) {
804 shadow_frame.SetVReg(inst->VRegA_23x(), array->GetData()[index]);
805 inst = inst->Next_2xx();
806 } else {
807 HANDLE_PENDING_EXCEPTION();
808 }
809 break;
810 }
811 case Instruction::AGET_BYTE: {
812 PREAMBLE();
813 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
814 if (UNLIKELY(a == NULL)) {
815 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
816 HANDLE_PENDING_EXCEPTION();
817 break;
818 }
819 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
820 ByteArray* array = a->AsByteArray();
821 if (LIKELY(array->IsValidIndex(index))) {
822 shadow_frame.SetVReg(inst->VRegA_23x(), array->GetData()[index]);
823 inst = inst->Next_2xx();
824 } else {
825 HANDLE_PENDING_EXCEPTION();
826 }
827 break;
828 }
829 case Instruction::AGET_CHAR: {
830 PREAMBLE();
831 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
832 if (UNLIKELY(a == NULL)) {
833 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
834 HANDLE_PENDING_EXCEPTION();
835 break;
836 }
837 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
838 CharArray* array = a->AsCharArray();
839 if (LIKELY(array->IsValidIndex(index))) {
840 shadow_frame.SetVReg(inst->VRegA_23x(), array->GetData()[index]);
841 inst = inst->Next_2xx();
842 } else {
843 HANDLE_PENDING_EXCEPTION();
844 }
845 break;
846 }
847 case Instruction::AGET_SHORT: {
848 PREAMBLE();
849 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
850 if (UNLIKELY(a == NULL)) {
851 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
852 HANDLE_PENDING_EXCEPTION();
853 break;
854 }
855 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
856 ShortArray* array = a->AsShortArray();
857 if (LIKELY(array->IsValidIndex(index))) {
858 shadow_frame.SetVReg(inst->VRegA_23x(), array->GetData()[index]);
859 inst = inst->Next_2xx();
860 } else {
861 HANDLE_PENDING_EXCEPTION();
862 }
863 break;
864 }
865 case Instruction::AGET: {
866 PREAMBLE();
867 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
868 if (UNLIKELY(a == NULL)) {
869 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
870 HANDLE_PENDING_EXCEPTION();
871 break;
872 }
873 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
874 IntArray* array = a->AsIntArray();
875 if (LIKELY(array->IsValidIndex(index))) {
876 shadow_frame.SetVReg(inst->VRegA_23x(), array->GetData()[index]);
877 inst = inst->Next_2xx();
878 } else {
879 HANDLE_PENDING_EXCEPTION();
880 }
881 break;
882 }
883 case Instruction::AGET_WIDE: {
884 PREAMBLE();
885 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
886 if (UNLIKELY(a == NULL)) {
887 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
888 HANDLE_PENDING_EXCEPTION();
889 break;
890 }
891 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
892 LongArray* array = a->AsLongArray();
893 if (LIKELY(array->IsValidIndex(index))) {
894 shadow_frame.SetVRegLong(inst->VRegA_23x(), array->GetData()[index]);
895 inst = inst->Next_2xx();
896 } else {
897 HANDLE_PENDING_EXCEPTION();
898 }
899 break;
900 }
901 case Instruction::AGET_OBJECT: {
902 PREAMBLE();
903 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
904 if (UNLIKELY(a == NULL)) {
905 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
906 HANDLE_PENDING_EXCEPTION();
907 break;
908 }
909 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
910 ObjectArray<Object>* array = a->AsObjectArray<Object>();
911 if (LIKELY(array->IsValidIndex(index))) {
912 shadow_frame.SetVRegReference(inst->VRegA_23x(), array->GetWithoutChecks(index));
913 inst = inst->Next_2xx();
914 } else {
915 HANDLE_PENDING_EXCEPTION();
916 }
917 break;
918 }
919 case Instruction::APUT_BOOLEAN: {
920 PREAMBLE();
921 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
922 if (UNLIKELY(a == NULL)) {
923 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
924 HANDLE_PENDING_EXCEPTION();
925 break;
926 }
927 uint8_t val = shadow_frame.GetVReg(inst->VRegA_23x());
928 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
929 BooleanArray* array = a->AsBooleanArray();
930 if (LIKELY(array->IsValidIndex(index))) {
931 array->GetData()[index] = val;
932 inst = inst->Next_2xx();
933 } else {
934 HANDLE_PENDING_EXCEPTION();
935 }
936 break;
937 }
938 case Instruction::APUT_BYTE: {
939 PREAMBLE();
940 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
941 if (UNLIKELY(a == NULL)) {
942 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
943 HANDLE_PENDING_EXCEPTION();
944 break;
945 }
946 int8_t val = shadow_frame.GetVReg(inst->VRegA_23x());
947 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
948 ByteArray* array = a->AsByteArray();
949 if (LIKELY(array->IsValidIndex(index))) {
950 array->GetData()[index] = val;
951 inst = inst->Next_2xx();
952 } else {
953 HANDLE_PENDING_EXCEPTION();
954 }
955 break;
956 }
957 case Instruction::APUT_CHAR: {
958 PREAMBLE();
959 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
960 if (UNLIKELY(a == NULL)) {
961 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
962 HANDLE_PENDING_EXCEPTION();
963 break;
964 }
965 uint16_t val = shadow_frame.GetVReg(inst->VRegA_23x());
966 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
967 CharArray* array = a->AsCharArray();
968 if (LIKELY(array->IsValidIndex(index))) {
969 array->GetData()[index] = val;
970 inst = inst->Next_2xx();
971 } else {
972 HANDLE_PENDING_EXCEPTION();
973 }
974 break;
975 }
976 case Instruction::APUT_SHORT: {
977 PREAMBLE();
978 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
979 if (UNLIKELY(a == NULL)) {
980 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
981 HANDLE_PENDING_EXCEPTION();
982 break;
983 }
984 int16_t val = shadow_frame.GetVReg(inst->VRegA_23x());
985 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
986 ShortArray* array = a->AsShortArray();
987 if (LIKELY(array->IsValidIndex(index))) {
988 array->GetData()[index] = val;
989 inst = inst->Next_2xx();
990 } else {
991 HANDLE_PENDING_EXCEPTION();
992 }
993 break;
994 }
995 case Instruction::APUT: {
996 PREAMBLE();
997 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
998 if (UNLIKELY(a == NULL)) {
999 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1000 HANDLE_PENDING_EXCEPTION();
1001 break;
1002 }
1003 int32_t val = shadow_frame.GetVReg(inst->VRegA_23x());
1004 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1005 IntArray* array = a->AsIntArray();
1006 if (LIKELY(array->IsValidIndex(index))) {
1007 array->GetData()[index] = val;
1008 inst = inst->Next_2xx();
1009 } else {
1010 HANDLE_PENDING_EXCEPTION();
1011 }
1012 break;
1013 }
1014 case Instruction::APUT_WIDE: {
1015 PREAMBLE();
1016 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1017 if (UNLIKELY(a == NULL)) {
1018 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1019 HANDLE_PENDING_EXCEPTION();
1020 break;
1021 }
1022 int64_t val = shadow_frame.GetVRegLong(inst->VRegA_23x());
1023 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1024 LongArray* array = a->AsLongArray();
1025 if (LIKELY(array->IsValidIndex(index))) {
1026 array->GetData()[index] = val;
1027 inst = inst->Next_2xx();
1028 } else {
1029 HANDLE_PENDING_EXCEPTION();
1030 }
1031 break;
1032 }
1033 case Instruction::APUT_OBJECT: {
1034 PREAMBLE();
1035 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1036 if (UNLIKELY(a == NULL)) {
1037 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1038 HANDLE_PENDING_EXCEPTION();
1039 break;
1040 }
1041 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1042 Object* val = shadow_frame.GetVRegReference(inst->VRegA_23x());
1043 ObjectArray<Object>* array = a->AsObjectArray<Object>();
1044 if (LIKELY(array->IsValidIndex(index) && array->CheckAssignable(val))) {
1045 array->SetWithoutChecks(index, val);
1046 inst = inst->Next_2xx();
1047 } else {
1048 HANDLE_PENDING_EXCEPTION();
1049 }
1050 break;
1051 }
1052 case Instruction::IGET_BOOLEAN: {
1053 PREAMBLE();
1054 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimBoolean, do_access_check>(self, shadow_frame, inst);
1055 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1056 break;
1057 }
1058 case Instruction::IGET_BYTE: {
1059 PREAMBLE();
1060 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimByte, do_access_check>(self, shadow_frame, inst);
1061 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1062 break;
1063 }
1064 case Instruction::IGET_CHAR: {
1065 PREAMBLE();
1066 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimChar, do_access_check>(self, shadow_frame, inst);
1067 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1068 break;
1069 }
1070 case Instruction::IGET_SHORT: {
1071 PREAMBLE();
1072 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimShort, do_access_check>(self, shadow_frame, inst);
1073 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1074 break;
1075 }
1076 case Instruction::IGET: {
1077 PREAMBLE();
1078 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimInt, do_access_check>(self, shadow_frame, inst);
1079 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1080 break;
1081 }
1082 case Instruction::IGET_WIDE: {
1083 PREAMBLE();
1084 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimLong, do_access_check>(self, shadow_frame, inst);
1085 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1086 break;
1087 }
1088 case Instruction::IGET_OBJECT: {
1089 PREAMBLE();
1090 bool success = DoFieldGet<InstanceObjectRead, Primitive::kPrimNot, do_access_check>(self, shadow_frame, inst);
1091 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1092 break;
1093 }
1094 case Instruction::IGET_QUICK: {
1095 PREAMBLE();
1096 bool success = DoIGetQuick<Primitive::kPrimInt>(self, shadow_frame, inst);
1097 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1098 break;
1099 }
1100 case Instruction::IGET_WIDE_QUICK: {
1101 PREAMBLE();
1102 bool success = DoIGetQuick<Primitive::kPrimLong>(self, shadow_frame, inst);
1103 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1104 break;
1105 }
1106 case Instruction::IGET_OBJECT_QUICK: {
1107 PREAMBLE();
1108 bool success = DoIGetQuick<Primitive::kPrimNot>(self, shadow_frame, inst);
1109 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1110 break;
1111 }
1112 case Instruction::SGET_BOOLEAN: {
1113 PREAMBLE();
1114 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimBoolean, do_access_check>(self, shadow_frame, inst);
1115 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1116 break;
1117 }
1118 case Instruction::SGET_BYTE: {
1119 PREAMBLE();
1120 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimByte, do_access_check>(self, shadow_frame, inst);
1121 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1122 break;
1123 }
1124 case Instruction::SGET_CHAR: {
1125 PREAMBLE();
1126 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimChar, do_access_check>(self, shadow_frame, inst);
1127 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1128 break;
1129 }
1130 case Instruction::SGET_SHORT: {
1131 PREAMBLE();
1132 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimShort, do_access_check>(self, shadow_frame, inst);
1133 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1134 break;
1135 }
1136 case Instruction::SGET: {
1137 PREAMBLE();
1138 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimInt, do_access_check>(self, shadow_frame, inst);
1139 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1140 break;
1141 }
1142 case Instruction::SGET_WIDE: {
1143 PREAMBLE();
1144 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimLong, do_access_check>(self, shadow_frame, inst);
1145 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1146 break;
1147 }
1148 case Instruction::SGET_OBJECT: {
1149 PREAMBLE();
1150 bool success = DoFieldGet<StaticObjectRead, Primitive::kPrimNot, do_access_check>(self, shadow_frame, inst);
1151 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1152 break;
1153 }
1154 case Instruction::IPUT_BOOLEAN: {
1155 PREAMBLE();
1156 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimBoolean, do_access_check>(self, shadow_frame, inst);
1157 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1158 break;
1159 }
1160 case Instruction::IPUT_BYTE: {
1161 PREAMBLE();
1162 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimByte, do_access_check>(self, shadow_frame, inst);
1163 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1164 break;
1165 }
1166 case Instruction::IPUT_CHAR: {
1167 PREAMBLE();
1168 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimChar, do_access_check>(self, shadow_frame, inst);
1169 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1170 break;
1171 }
1172 case Instruction::IPUT_SHORT: {
1173 PREAMBLE();
1174 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimShort, do_access_check>(self, shadow_frame, inst);
1175 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1176 break;
1177 }
1178 case Instruction::IPUT: {
1179 PREAMBLE();
1180 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimInt, do_access_check>(self, shadow_frame, inst);
1181 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1182 break;
1183 }
1184 case Instruction::IPUT_WIDE: {
1185 PREAMBLE();
1186 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimLong, do_access_check>(self, shadow_frame, inst);
1187 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1188 break;
1189 }
1190 case Instruction::IPUT_OBJECT: {
1191 PREAMBLE();
1192 bool success = DoFieldPut<InstanceObjectWrite, Primitive::kPrimNot, do_access_check>(self, shadow_frame, inst);
1193 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1194 break;
1195 }
1196 case Instruction::IPUT_QUICK: {
1197 PREAMBLE();
1198 bool success = DoIPutQuick<Primitive::kPrimInt>(self, shadow_frame, inst);
1199 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1200 break;
1201 }
1202 case Instruction::IPUT_WIDE_QUICK: {
1203 PREAMBLE();
1204 bool success = DoIPutQuick<Primitive::kPrimLong>(self, shadow_frame, inst);
1205 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1206 break;
1207 }
1208 case Instruction::IPUT_OBJECT_QUICK: {
1209 PREAMBLE();
1210 bool success = DoIPutQuick<Primitive::kPrimNot>(self, shadow_frame, inst);
1211 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1212 break;
1213 }
1214 case Instruction::SPUT_BOOLEAN: {
1215 PREAMBLE();
1216 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimBoolean, do_access_check>(self, shadow_frame, inst);
1217 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1218 break;
1219 }
1220 case Instruction::SPUT_BYTE: {
1221 PREAMBLE();
1222 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimByte, do_access_check>(self, shadow_frame, inst);
1223 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1224 break;
1225 }
1226 case Instruction::SPUT_CHAR: {
1227 PREAMBLE();
1228 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimChar, do_access_check>(self, shadow_frame, inst);
1229 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1230 break;
1231 }
1232 case Instruction::SPUT_SHORT: {
1233 PREAMBLE();
1234 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimShort, do_access_check>(self, shadow_frame, inst);
1235 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1236 break;
1237 }
1238 case Instruction::SPUT: {
1239 PREAMBLE();
1240 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimInt, do_access_check>(self, shadow_frame, inst);
1241 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1242 break;
1243 }
1244 case Instruction::SPUT_WIDE: {
1245 PREAMBLE();
1246 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimLong, do_access_check>(self, shadow_frame, inst);
1247 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1248 break;
1249 }
1250 case Instruction::SPUT_OBJECT: {
1251 PREAMBLE();
1252 bool success = DoFieldPut<StaticObjectWrite, Primitive::kPrimNot, do_access_check>(self, shadow_frame, inst);
1253 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1254 break;
1255 }
1256 case Instruction::INVOKE_VIRTUAL: {
1257 PREAMBLE();
1258 bool success = DoInvoke<kVirtual, false, do_access_check>(self, shadow_frame, inst, &result_register);
1259 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1260 break;
1261 }
1262 case Instruction::INVOKE_VIRTUAL_RANGE: {
1263 PREAMBLE();
1264 bool success = DoInvoke<kVirtual, true, do_access_check>(self, shadow_frame, inst, &result_register);
1265 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1266 break;
1267 }
1268 case Instruction::INVOKE_SUPER: {
1269 PREAMBLE();
1270 bool success = DoInvoke<kSuper, false, do_access_check>(self, shadow_frame, inst, &result_register);
1271 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1272 break;
1273 }
1274 case Instruction::INVOKE_SUPER_RANGE: {
1275 PREAMBLE();
1276 bool success = DoInvoke<kSuper, true, do_access_check>(self, shadow_frame, inst, &result_register);
1277 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1278 break;
1279 }
1280 case Instruction::INVOKE_DIRECT: {
1281 PREAMBLE();
1282 bool success = DoInvoke<kDirect, false, do_access_check>(self, shadow_frame, inst, &result_register);
1283 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1284 break;
1285 }
1286 case Instruction::INVOKE_DIRECT_RANGE: {
1287 PREAMBLE();
1288 bool success = DoInvoke<kDirect, true, do_access_check>(self, shadow_frame, inst, &result_register);
1289 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1290 break;
1291 }
1292 case Instruction::INVOKE_INTERFACE: {
1293 PREAMBLE();
1294 bool success = DoInvoke<kInterface, false, do_access_check>(self, shadow_frame, inst, &result_register);
1295 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1296 break;
1297 }
1298 case Instruction::INVOKE_INTERFACE_RANGE: {
1299 PREAMBLE();
1300 bool success = DoInvoke<kInterface, true, do_access_check>(self, shadow_frame, inst, &result_register);
1301 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1302 break;
1303 }
1304 case Instruction::INVOKE_STATIC: {
1305 PREAMBLE();
1306 bool success = DoInvoke<kStatic, false, do_access_check>(self, shadow_frame, inst, &result_register);
1307 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1308 break;
1309 }
1310 case Instruction::INVOKE_STATIC_RANGE: {
1311 PREAMBLE();
1312 bool success = DoInvoke<kStatic, true, do_access_check>(self, shadow_frame, inst, &result_register);
1313 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1314 break;
1315 }
1316 case Instruction::INVOKE_VIRTUAL_QUICK: {
1317 PREAMBLE();
1318 bool success = DoInvokeVirtualQuick<false>(self, shadow_frame, inst, &result_register);
1319 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1320 break;
1321 }
1322 case Instruction::INVOKE_VIRTUAL_RANGE_QUICK: {
1323 PREAMBLE();
1324 bool success = DoInvokeVirtualQuick<true>(self, shadow_frame, inst, &result_register);
1325 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
1326 break;
1327 }
1328 case Instruction::NEG_INT:
1329 PREAMBLE();
1330 shadow_frame.SetVReg(inst->VRegA_12x(), -shadow_frame.GetVReg(inst->VRegB_12x()));
1331 inst = inst->Next_1xx();
1332 break;
1333 case Instruction::NOT_INT:
1334 PREAMBLE();
1335 shadow_frame.SetVReg(inst->VRegA_12x(), ~shadow_frame.GetVReg(inst->VRegB_12x()));
1336 inst = inst->Next_1xx();
1337 break;
1338 case Instruction::NEG_LONG:
1339 PREAMBLE();
1340 shadow_frame.SetVRegLong(inst->VRegA_12x(), -shadow_frame.GetVRegLong(inst->VRegB_12x()));
1341 inst = inst->Next_1xx();
1342 break;
1343 case Instruction::NOT_LONG:
1344 PREAMBLE();
1345 shadow_frame.SetVRegLong(inst->VRegA_12x(), ~shadow_frame.GetVRegLong(inst->VRegB_12x()));
1346 inst = inst->Next_1xx();
1347 break;
1348 case Instruction::NEG_FLOAT:
1349 PREAMBLE();
1350 shadow_frame.SetVRegFloat(inst->VRegA_12x(), -shadow_frame.GetVRegFloat(inst->VRegB_12x()));
1351 inst = inst->Next_1xx();
1352 break;
1353 case Instruction::NEG_DOUBLE:
1354 PREAMBLE();
1355 shadow_frame.SetVRegDouble(inst->VRegA_12x(), -shadow_frame.GetVRegDouble(inst->VRegB_12x()));
1356 inst = inst->Next_1xx();
1357 break;
1358 case Instruction::INT_TO_LONG:
1359 PREAMBLE();
1360 shadow_frame.SetVRegLong(inst->VRegA_12x(), shadow_frame.GetVReg(inst->VRegB_12x()));
1361 inst = inst->Next_1xx();
1362 break;
1363 case Instruction::INT_TO_FLOAT:
1364 PREAMBLE();
1365 shadow_frame.SetVRegFloat(inst->VRegA_12x(), shadow_frame.GetVReg(inst->VRegB_12x()));
1366 inst = inst->Next_1xx();
1367 break;
1368 case Instruction::INT_TO_DOUBLE:
1369 PREAMBLE();
1370 shadow_frame.SetVRegDouble(inst->VRegA_12x(), shadow_frame.GetVReg(inst->VRegB_12x()));
1371 inst = inst->Next_1xx();
1372 break;
1373 case Instruction::LONG_TO_INT:
1374 PREAMBLE();
1375 shadow_frame.SetVReg(inst->VRegA_12x(), shadow_frame.GetVRegLong(inst->VRegB_12x()));
1376 inst = inst->Next_1xx();
1377 break;
1378 case Instruction::LONG_TO_FLOAT:
1379 PREAMBLE();
1380 shadow_frame.SetVRegFloat(inst->VRegA_12x(), shadow_frame.GetVRegLong(inst->VRegB_12x()));
1381 inst = inst->Next_1xx();
1382 break;
1383 case Instruction::LONG_TO_DOUBLE:
1384 PREAMBLE();
1385 shadow_frame.SetVRegDouble(inst->VRegA_12x(), shadow_frame.GetVRegLong(inst->VRegB_12x()));
1386 inst = inst->Next_1xx();
1387 break;
1388 case Instruction::FLOAT_TO_INT: {
1389 PREAMBLE();
1390 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x());
1391 int32_t result;
1392 if (val != val) {
1393 result = 0;
1394 } else if (val > static_cast<float>(kMaxInt)) {
1395 result = kMaxInt;
1396 } else if (val < static_cast<float>(kMinInt)) {
1397 result = kMinInt;
1398 } else {
1399 result = val;
1400 }
1401 shadow_frame.SetVReg(inst->VRegA_12x(), result);
1402 inst = inst->Next_1xx();
1403 break;
1404 }
1405 case Instruction::FLOAT_TO_LONG: {
1406 PREAMBLE();
1407 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x());
1408 int64_t result;
1409 if (val != val) {
1410 result = 0;
1411 } else if (val > static_cast<float>(kMaxLong)) {
1412 result = kMaxLong;
1413 } else if (val < static_cast<float>(kMinLong)) {
1414 result = kMinLong;
1415 } else {
1416 result = val;
1417 }
1418 shadow_frame.SetVRegLong(inst->VRegA_12x(), result);
1419 inst = inst->Next_1xx();
1420 break;
1421 }
1422 case Instruction::FLOAT_TO_DOUBLE:
1423 PREAMBLE();
1424 shadow_frame.SetVRegDouble(inst->VRegA_12x(), shadow_frame.GetVRegFloat(inst->VRegB_12x()));
1425 inst = inst->Next_1xx();
1426 break;
1427 case Instruction::DOUBLE_TO_INT: {
1428 PREAMBLE();
1429 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x());
1430 int32_t result;
1431 if (val != val) {
1432 result = 0;
1433 } else if (val > static_cast<double>(kMaxInt)) {
1434 result = kMaxInt;
1435 } else if (val < static_cast<double>(kMinInt)) {
1436 result = kMinInt;
1437 } else {
1438 result = val;
1439 }
1440 shadow_frame.SetVReg(inst->VRegA_12x(), result);
1441 inst = inst->Next_1xx();
1442 break;
1443 }
1444 case Instruction::DOUBLE_TO_LONG: {
1445 PREAMBLE();
1446 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x());
1447 int64_t result;
1448 if (val != val) {
1449 result = 0;
1450 } else if (val > static_cast<double>(kMaxLong)) {
1451 result = kMaxLong;
1452 } else if (val < static_cast<double>(kMinLong)) {
1453 result = kMinLong;
1454 } else {
1455 result = val;
1456 }
1457 shadow_frame.SetVRegLong(inst->VRegA_12x(), result);
1458 inst = inst->Next_1xx();
1459 break;
1460 }
1461 case Instruction::DOUBLE_TO_FLOAT:
1462 PREAMBLE();
1463 shadow_frame.SetVRegFloat(inst->VRegA_12x(), shadow_frame.GetVRegDouble(inst->VRegB_12x()));
1464 inst = inst->Next_1xx();
1465 break;
1466 case Instruction::INT_TO_BYTE:
1467 PREAMBLE();
1468 shadow_frame.SetVReg(inst->VRegA_12x(),
1469 static_cast<int8_t>(shadow_frame.GetVReg(inst->VRegB_12x())));
1470 inst = inst->Next_1xx();
1471 break;
1472 case Instruction::INT_TO_CHAR:
1473 PREAMBLE();
1474 shadow_frame.SetVReg(inst->VRegA_12x(),
1475 static_cast<uint16_t>(shadow_frame.GetVReg(inst->VRegB_12x())));
1476 inst = inst->Next_1xx();
1477 break;
1478 case Instruction::INT_TO_SHORT:
1479 PREAMBLE();
1480 shadow_frame.SetVReg(inst->VRegA_12x(),
1481 static_cast<int16_t>(shadow_frame.GetVReg(inst->VRegB_12x())));
1482 inst = inst->Next_1xx();
1483 break;
1484 case Instruction::ADD_INT:
1485 PREAMBLE();
1486 shadow_frame.SetVReg(inst->VRegA_23x(),
1487 shadow_frame.GetVReg(inst->VRegB_23x()) +
1488 shadow_frame.GetVReg(inst->VRegC_23x()));
1489 inst = inst->Next_2xx();
1490 break;
1491 case Instruction::SUB_INT:
1492 PREAMBLE();
1493 shadow_frame.SetVReg(inst->VRegA_23x(),
1494 shadow_frame.GetVReg(inst->VRegB_23x()) -
1495 shadow_frame.GetVReg(inst->VRegC_23x()));
1496 inst = inst->Next_2xx();
1497 break;
1498 case Instruction::MUL_INT:
1499 PREAMBLE();
1500 shadow_frame.SetVReg(inst->VRegA_23x(),
1501 shadow_frame.GetVReg(inst->VRegB_23x()) *
1502 shadow_frame.GetVReg(inst->VRegC_23x()));
1503 inst = inst->Next_2xx();
1504 break;
1505 case Instruction::DIV_INT: {
1506 PREAMBLE();
1507 bool success = DoIntDivide(shadow_frame, inst->VRegA_23x(),
1508 shadow_frame.GetVReg(inst->VRegB_23x()),
1509 shadow_frame.GetVReg(inst->VRegC_23x()));
1510 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1511 break;
1512 }
1513 case Instruction::REM_INT: {
1514 PREAMBLE();
1515 bool success = DoIntRemainder(shadow_frame, inst->VRegA_23x(),
1516 shadow_frame.GetVReg(inst->VRegB_23x()),
1517 shadow_frame.GetVReg(inst->VRegC_23x()));
1518 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
1519 break;
1520 }
1521 case Instruction::SHL_INT:
1522 PREAMBLE();
1523 shadow_frame.SetVReg(inst->VRegA_23x(),
1524 shadow_frame.GetVReg(inst->VRegB_23x()) <<
1525 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1526 inst = inst->Next_2xx();
1527 break;
1528 case Instruction::SHR_INT:
1529 PREAMBLE();
1530 shadow_frame.SetVReg(inst->VRegA_23x(),
1531 shadow_frame.GetVReg(inst->VRegB_23x()) >>
1532 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1533 inst = inst->Next_2xx();
1534 break;
1535 case Instruction::USHR_INT:
1536 PREAMBLE();
1537 shadow_frame.SetVReg(inst->VRegA_23x(),
1538 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_23x())) >>
1539 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1540 inst = inst->Next_2xx();
1541 break;
1542 case Instruction::AND_INT:
1543 PREAMBLE();
1544 shadow_frame.SetVReg(inst->VRegA_23x(),
1545 shadow_frame.GetVReg(inst->VRegB_23x()) &
1546 shadow_frame.GetVReg(inst->VRegC_23x()));
1547 inst = inst->Next_2xx();
1548 break;
1549 case Instruction::OR_INT:
1550 PREAMBLE();
1551 shadow_frame.SetVReg(inst->VRegA_23x(),
1552 shadow_frame.GetVReg(inst->VRegB_23x()) |
1553 shadow_frame.GetVReg(inst->VRegC_23x()));
1554 inst = inst->Next_2xx();
1555 break;
1556 case Instruction::XOR_INT:
1557 PREAMBLE();
1558 shadow_frame.SetVReg(inst->VRegA_23x(),
1559 shadow_frame.GetVReg(inst->VRegB_23x()) ^
1560 shadow_frame.GetVReg(inst->VRegC_23x()));
1561 inst = inst->Next_2xx();
1562 break;
1563 case Instruction::ADD_LONG:
1564 PREAMBLE();
1565 shadow_frame.SetVRegLong(inst->VRegA_23x(),
1566 shadow_frame.GetVRegLong(inst->VRegB_23x()) +
1567 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1568 inst = inst->Next_2xx();
1569 break;
1570 case Instruction::SUB_LONG:
1571 PREAMBLE();
1572 shadow_frame.SetVRegLong(inst->VRegA_23x(),
1573 shadow_frame.GetVRegLong(inst->VRegB_23x()) -
1574 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1575 inst = inst->Next_2xx();
1576 break;
1577 case Instruction::MUL_LONG:
1578 PREAMBLE();
1579 shadow_frame.SetVRegLong(inst->VRegA_23x(),
1580 shadow_frame.GetVRegLong(inst->VRegB_23x()) *
1581 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1582 inst = inst->Next_2xx();
1583 break;
1584 case Instruction::DIV_LONG:
1585 PREAMBLE();
1586 DoLongDivide(shadow_frame, inst->VRegA_23x(),
1587 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1588 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1589 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_2xx);
1590 break;
1591 case Instruction::REM_LONG:
1592 PREAMBLE();
1593 DoLongRemainder(shadow_frame, inst->VRegA_23x(),
1594 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1595 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1596 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_2xx);
1597 break;
1598 case Instruction::AND_LONG:
1599 PREAMBLE();
1600 shadow_frame.SetVRegLong(inst->VRegA_23x(),
1601 shadow_frame.GetVRegLong(inst->VRegB_23x()) &
1602 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1603 inst = inst->Next_2xx();
1604 break;
1605 case Instruction::OR_LONG:
1606 PREAMBLE();
1607 shadow_frame.SetVRegLong(inst->VRegA_23x(),
1608 shadow_frame.GetVRegLong(inst->VRegB_23x()) |
1609 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1610 inst = inst->Next_2xx();
1611 break;
1612 case Instruction::XOR_LONG:
1613 PREAMBLE();
1614 shadow_frame.SetVRegLong(inst->VRegA_23x(),
1615 shadow_frame.GetVRegLong(inst->VRegB_23x()) ^
1616 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1617 inst = inst->Next_2xx();
1618 break;
1619 case Instruction::SHL_LONG:
1620 PREAMBLE();
1621 shadow_frame.SetVRegLong(inst->VRegA_23x(),
1622 shadow_frame.GetVRegLong(inst->VRegB_23x()) <<
1623 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1624 inst = inst->Next_2xx();
1625 break;
1626 case Instruction::SHR_LONG:
1627 PREAMBLE();
1628 shadow_frame.SetVRegLong(inst->VRegA_23x(),
1629 shadow_frame.GetVRegLong(inst->VRegB_23x()) >>
1630 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1631 inst = inst->Next_2xx();
1632 break;
1633 case Instruction::USHR_LONG:
1634 PREAMBLE();
1635 shadow_frame.SetVRegLong(inst->VRegA_23x(),
1636 static_cast<uint64_t>(shadow_frame.GetVRegLong(inst->VRegB_23x())) >>
1637 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1638 inst = inst->Next_2xx();
1639 break;
1640 case Instruction::ADD_FLOAT:
1641 PREAMBLE();
1642 shadow_frame.SetVRegFloat(inst->VRegA_23x(),
1643 shadow_frame.GetVRegFloat(inst->VRegB_23x()) +
1644 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1645 inst = inst->Next_2xx();
1646 break;
1647 case Instruction::SUB_FLOAT:
1648 PREAMBLE();
1649 shadow_frame.SetVRegFloat(inst->VRegA_23x(),
1650 shadow_frame.GetVRegFloat(inst->VRegB_23x()) -
1651 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1652 inst = inst->Next_2xx();
1653 break;
1654 case Instruction::MUL_FLOAT:
1655 PREAMBLE();
1656 shadow_frame.SetVRegFloat(inst->VRegA_23x(),
1657 shadow_frame.GetVRegFloat(inst->VRegB_23x()) *
1658 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1659 inst = inst->Next_2xx();
1660 break;
1661 case Instruction::DIV_FLOAT:
1662 PREAMBLE();
1663 shadow_frame.SetVRegFloat(inst->VRegA_23x(),
1664 shadow_frame.GetVRegFloat(inst->VRegB_23x()) /
1665 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1666 inst = inst->Next_2xx();
1667 break;
1668 case Instruction::REM_FLOAT:
1669 PREAMBLE();
1670 shadow_frame.SetVRegFloat(inst->VRegA_23x(),
1671 fmodf(shadow_frame.GetVRegFloat(inst->VRegB_23x()),
1672 shadow_frame.GetVRegFloat(inst->VRegC_23x())));
1673 inst = inst->Next_2xx();
1674 break;
1675 case Instruction::ADD_DOUBLE:
1676 PREAMBLE();
1677 shadow_frame.SetVRegDouble(inst->VRegA_23x(),
1678 shadow_frame.GetVRegDouble(inst->VRegB_23x()) +
1679 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1680 inst = inst->Next_2xx();
1681 break;
1682 case Instruction::SUB_DOUBLE:
1683 PREAMBLE();
1684 shadow_frame.SetVRegDouble(inst->VRegA_23x(),
1685 shadow_frame.GetVRegDouble(inst->VRegB_23x()) -
1686 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1687 inst = inst->Next_2xx();
1688 break;
1689 case Instruction::MUL_DOUBLE:
1690 PREAMBLE();
1691 shadow_frame.SetVRegDouble(inst->VRegA_23x(),
1692 shadow_frame.GetVRegDouble(inst->VRegB_23x()) *
1693 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1694 inst = inst->Next_2xx();
1695 break;
1696 case Instruction::DIV_DOUBLE:
1697 PREAMBLE();
1698 shadow_frame.SetVRegDouble(inst->VRegA_23x(),
1699 shadow_frame.GetVRegDouble(inst->VRegB_23x()) /
1700 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1701 inst = inst->Next_2xx();
1702 break;
1703 case Instruction::REM_DOUBLE:
1704 PREAMBLE();
1705 shadow_frame.SetVRegDouble(inst->VRegA_23x(),
1706 fmod(shadow_frame.GetVRegDouble(inst->VRegB_23x()),
1707 shadow_frame.GetVRegDouble(inst->VRegC_23x())));
1708 inst = inst->Next_2xx();
1709 break;
1710 case Instruction::ADD_INT_2ADDR: {
1711 PREAMBLE();
1712 uint4_t vregA = inst->VRegA_12x();
1713 shadow_frame.SetVReg(vregA,
1714 shadow_frame.GetVReg(vregA) +
1715 shadow_frame.GetVReg(inst->VRegB_12x()));
1716 inst = inst->Next_1xx();
1717 break;
1718 }
1719 case Instruction::SUB_INT_2ADDR: {
1720 PREAMBLE();
1721 uint4_t vregA = inst->VRegA_12x();
1722 shadow_frame.SetVReg(vregA,
1723 shadow_frame.GetVReg(vregA) -
1724 shadow_frame.GetVReg(inst->VRegB_12x()));
1725 inst = inst->Next_1xx();
1726 break;
1727 }
1728 case Instruction::MUL_INT_2ADDR: {
1729 PREAMBLE();
1730 uint4_t vregA = inst->VRegA_12x();
1731 shadow_frame.SetVReg(vregA,
1732 shadow_frame.GetVReg(vregA) *
1733 shadow_frame.GetVReg(inst->VRegB_12x()));
1734 inst = inst->Next_1xx();
1735 break;
1736 }
1737 case Instruction::DIV_INT_2ADDR: {
1738 PREAMBLE();
1739 uint4_t vregA = inst->VRegA_12x();
1740 bool success = DoIntDivide(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
1741 shadow_frame.GetVReg(inst->VRegB_12x()));
1742 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_1xx);
1743 break;
1744 }
1745 case Instruction::REM_INT_2ADDR: {
1746 PREAMBLE();
1747 uint4_t vregA = inst->VRegA_12x();
1748 bool success = DoIntRemainder(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
1749 shadow_frame.GetVReg(inst->VRegB_12x()));
1750 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_1xx);
1751 break;
1752 }
1753 case Instruction::SHL_INT_2ADDR: {
1754 PREAMBLE();
1755 uint4_t vregA = inst->VRegA_12x();
1756 shadow_frame.SetVReg(vregA,
1757 shadow_frame.GetVReg(vregA) <<
1758 (shadow_frame.GetVReg(inst->VRegB_12x()) & 0x1f));
1759 inst = inst->Next_1xx();
1760 break;
1761 }
1762 case Instruction::SHR_INT_2ADDR: {
1763 PREAMBLE();
1764 uint4_t vregA = inst->VRegA_12x();
1765 shadow_frame.SetVReg(vregA,
1766 shadow_frame.GetVReg(vregA) >>
1767 (shadow_frame.GetVReg(inst->VRegB_12x()) & 0x1f));
1768 inst = inst->Next_1xx();
1769 break;
1770 }
1771 case Instruction::USHR_INT_2ADDR: {
1772 PREAMBLE();
1773 uint4_t vregA = inst->VRegA_12x();
1774 shadow_frame.SetVReg(vregA,
1775 static_cast<uint32_t>(shadow_frame.GetVReg(vregA)) >>
1776 (shadow_frame.GetVReg(inst->VRegB_12x()) & 0x1f));
1777 inst = inst->Next_1xx();
1778 break;
1779 }
1780 case Instruction::AND_INT_2ADDR: {
1781 PREAMBLE();
1782 uint4_t vregA = inst->VRegA_12x();
1783 shadow_frame.SetVReg(vregA,
1784 shadow_frame.GetVReg(vregA) &
1785 shadow_frame.GetVReg(inst->VRegB_12x()));
1786 inst = inst->Next_1xx();
1787 break;
1788 }
1789 case Instruction::OR_INT_2ADDR: {
1790 PREAMBLE();
1791 uint4_t vregA = inst->VRegA_12x();
1792 shadow_frame.SetVReg(vregA,
1793 shadow_frame.GetVReg(vregA) |
1794 shadow_frame.GetVReg(inst->VRegB_12x()));
1795 inst = inst->Next_1xx();
1796 break;
1797 }
1798 case Instruction::XOR_INT_2ADDR: {
1799 PREAMBLE();
1800 uint4_t vregA = inst->VRegA_12x();
1801 shadow_frame.SetVReg(vregA,
1802 shadow_frame.GetVReg(vregA) ^
1803 shadow_frame.GetVReg(inst->VRegB_12x()));
1804 inst = inst->Next_1xx();
1805 break;
1806 }
1807 case Instruction::ADD_LONG_2ADDR: {
1808 PREAMBLE();
1809 uint4_t vregA = inst->VRegA_12x();
1810 shadow_frame.SetVRegLong(vregA,
1811 shadow_frame.GetVRegLong(vregA) +
1812 shadow_frame.GetVRegLong(inst->VRegB_12x()));
1813 inst = inst->Next_1xx();
1814 break;
1815 }
1816 case Instruction::SUB_LONG_2ADDR: {
1817 PREAMBLE();
1818 uint4_t vregA = inst->VRegA_12x();
1819 shadow_frame.SetVRegLong(vregA,
1820 shadow_frame.GetVRegLong(vregA) -
1821 shadow_frame.GetVRegLong(inst->VRegB_12x()));
1822 inst = inst->Next_1xx();
1823 break;
1824 }
1825 case Instruction::MUL_LONG_2ADDR: {
1826 PREAMBLE();
1827 uint4_t vregA = inst->VRegA_12x();
1828 shadow_frame.SetVRegLong(vregA,
1829 shadow_frame.GetVRegLong(vregA) *
1830 shadow_frame.GetVRegLong(inst->VRegB_12x()));
1831 inst = inst->Next_1xx();
1832 break;
1833 }
1834 case Instruction::DIV_LONG_2ADDR: {
1835 PREAMBLE();
1836 uint4_t vregA = inst->VRegA_12x();
1837 DoLongDivide(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
1838 shadow_frame.GetVRegLong(inst->VRegB_12x()));
1839 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx);
1840 break;
1841 }
1842 case Instruction::REM_LONG_2ADDR: {
1843 PREAMBLE();
1844 uint4_t vregA = inst->VRegA_12x();
1845 DoLongRemainder(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
1846 shadow_frame.GetVRegLong(inst->VRegB_12x()));
1847 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx);
1848 break;
1849 }
1850 case Instruction::AND_LONG_2ADDR: {
1851 PREAMBLE();
1852 uint4_t vregA = inst->VRegA_12x();
1853 shadow_frame.SetVRegLong(vregA,
1854 shadow_frame.GetVRegLong(vregA) &
1855 shadow_frame.GetVRegLong(inst->VRegB_12x()));
1856 inst = inst->Next_1xx();
1857 break;
1858 }
1859 case Instruction::OR_LONG_2ADDR: {
1860 PREAMBLE();
1861 uint4_t vregA = inst->VRegA_12x();
1862 shadow_frame.SetVRegLong(vregA,
1863 shadow_frame.GetVRegLong(vregA) |
1864 shadow_frame.GetVRegLong(inst->VRegB_12x()));
1865 inst = inst->Next_1xx();
1866 break;
1867 }
1868 case Instruction::XOR_LONG_2ADDR: {
1869 PREAMBLE();
1870 uint4_t vregA = inst->VRegA_12x();
1871 shadow_frame.SetVRegLong(vregA,
1872 shadow_frame.GetVRegLong(vregA) ^
1873 shadow_frame.GetVRegLong(inst->VRegB_12x()));
1874 inst = inst->Next_1xx();
1875 break;
1876 }
1877 case Instruction::SHL_LONG_2ADDR: {
1878 PREAMBLE();
1879 uint4_t vregA = inst->VRegA_12x();
1880 shadow_frame.SetVRegLong(vregA,
1881 shadow_frame.GetVRegLong(vregA) <<
1882 (shadow_frame.GetVReg(inst->VRegB_12x()) & 0x3f));
1883 inst = inst->Next_1xx();
1884 break;
1885 }
1886 case Instruction::SHR_LONG_2ADDR: {
1887 PREAMBLE();
1888 uint4_t vregA = inst->VRegA_12x();
1889 shadow_frame.SetVRegLong(vregA,
1890 shadow_frame.GetVRegLong(vregA) >>
1891 (shadow_frame.GetVReg(inst->VRegB_12x()) & 0x3f));
1892 inst = inst->Next_1xx();
1893 break;
1894 }
1895 case Instruction::USHR_LONG_2ADDR: {
1896 PREAMBLE();
1897 uint4_t vregA = inst->VRegA_12x();
1898 shadow_frame.SetVRegLong(vregA,
1899 static_cast<uint64_t>(shadow_frame.GetVRegLong(vregA)) >>
1900 (shadow_frame.GetVReg(inst->VRegB_12x()) & 0x3f));
1901 inst = inst->Next_1xx();
1902 break;
1903 }
1904 case Instruction::ADD_FLOAT_2ADDR: {
1905 PREAMBLE();
1906 uint4_t vregA = inst->VRegA_12x();
1907 shadow_frame.SetVRegFloat(vregA,
1908 shadow_frame.GetVRegFloat(vregA) +
1909 shadow_frame.GetVRegFloat(inst->VRegB_12x()));
1910 inst = inst->Next_1xx();
1911 break;
1912 }
1913 case Instruction::SUB_FLOAT_2ADDR: {
1914 PREAMBLE();
1915 uint4_t vregA = inst->VRegA_12x();
1916 shadow_frame.SetVRegFloat(vregA,
1917 shadow_frame.GetVRegFloat(vregA) -
1918 shadow_frame.GetVRegFloat(inst->VRegB_12x()));
1919 inst = inst->Next_1xx();
1920 break;
1921 }
1922 case Instruction::MUL_FLOAT_2ADDR: {
1923 PREAMBLE();
1924 uint4_t vregA = inst->VRegA_12x();
1925 shadow_frame.SetVRegFloat(vregA,
1926 shadow_frame.GetVRegFloat(vregA) *
1927 shadow_frame.GetVRegFloat(inst->VRegB_12x()));
1928 inst = inst->Next_1xx();
1929 break;
1930 }
1931 case Instruction::DIV_FLOAT_2ADDR: {
1932 PREAMBLE();
1933 uint4_t vregA = inst->VRegA_12x();
1934 shadow_frame.SetVRegFloat(vregA,
1935 shadow_frame.GetVRegFloat(vregA) /
1936 shadow_frame.GetVRegFloat(inst->VRegB_12x()));
1937 inst = inst->Next_1xx();
1938 break;
1939 }
1940 case Instruction::REM_FLOAT_2ADDR: {
1941 PREAMBLE();
1942 uint4_t vregA = inst->VRegA_12x();
1943 shadow_frame.SetVRegFloat(vregA,
1944 fmodf(shadow_frame.GetVRegFloat(vregA),
1945 shadow_frame.GetVRegFloat(inst->VRegB_12x())));
1946 inst = inst->Next_1xx();
1947 break;
1948 }
1949 case Instruction::ADD_DOUBLE_2ADDR: {
1950 PREAMBLE();
1951 uint4_t vregA = inst->VRegA_12x();
1952 shadow_frame.SetVRegDouble(vregA,
1953 shadow_frame.GetVRegDouble(vregA) +
1954 shadow_frame.GetVRegDouble(inst->VRegB_12x()));
1955 inst = inst->Next_1xx();
1956 break;
1957 }
1958 case Instruction::SUB_DOUBLE_2ADDR: {
1959 PREAMBLE();
1960 uint4_t vregA = inst->VRegA_12x();
1961 shadow_frame.SetVRegDouble(vregA,
1962 shadow_frame.GetVRegDouble(vregA) -
1963 shadow_frame.GetVRegDouble(inst->VRegB_12x()));
1964 inst = inst->Next_1xx();
1965 break;
1966 }
1967 case Instruction::MUL_DOUBLE_2ADDR: {
1968 PREAMBLE();
1969 uint4_t vregA = inst->VRegA_12x();
1970 shadow_frame.SetVRegDouble(vregA,
1971 shadow_frame.GetVRegDouble(vregA) *
1972 shadow_frame.GetVRegDouble(inst->VRegB_12x()));
1973 inst = inst->Next_1xx();
1974 break;
1975 }
1976 case Instruction::DIV_DOUBLE_2ADDR: {
1977 PREAMBLE();
1978 uint4_t vregA = inst->VRegA_12x();
1979 shadow_frame.SetVRegDouble(vregA,
1980 shadow_frame.GetVRegDouble(vregA) /
1981 shadow_frame.GetVRegDouble(inst->VRegB_12x()));
1982 inst = inst->Next_1xx();
1983 break;
1984 }
1985 case Instruction::REM_DOUBLE_2ADDR: {
1986 PREAMBLE();
1987 uint4_t vregA = inst->VRegA_12x();
1988 shadow_frame.SetVRegDouble(vregA,
1989 fmod(shadow_frame.GetVRegDouble(vregA),
1990 shadow_frame.GetVRegDouble(inst->VRegB_12x())));
1991 inst = inst->Next_1xx();
1992 break;
1993 }
1994 case Instruction::ADD_INT_LIT16:
1995 PREAMBLE();
1996 shadow_frame.SetVReg(inst->VRegA_22s(),
1997 shadow_frame.GetVReg(inst->VRegB_22s()) +
1998 inst->VRegC_22s());
1999 inst = inst->Next_2xx();
2000 break;
2001 case Instruction::RSUB_INT:
2002 PREAMBLE();
2003 shadow_frame.SetVReg(inst->VRegA_22s(),
2004 inst->VRegC_22s() -
2005 shadow_frame.GetVReg(inst->VRegB_22s()));
2006 inst = inst->Next_2xx();
2007 break;
2008 case Instruction::MUL_INT_LIT16:
2009 PREAMBLE();
2010 shadow_frame.SetVReg(inst->VRegA_22s(),
2011 shadow_frame.GetVReg(inst->VRegB_22s()) *
2012 inst->VRegC_22s());
2013 inst = inst->Next_2xx();
2014 break;
2015 case Instruction::DIV_INT_LIT16: {
2016 PREAMBLE();
2017 bool success = DoIntDivide(shadow_frame, inst->VRegA_22s(),
2018 shadow_frame.GetVReg(inst->VRegB_22s()), inst->VRegC_22s());
2019 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
2020 break;
2021 }
2022 case Instruction::REM_INT_LIT16: {
2023 PREAMBLE();
2024 bool success = DoIntRemainder(shadow_frame, inst->VRegA_22s(),
2025 shadow_frame.GetVReg(inst->VRegB_22s()), inst->VRegC_22s());
2026 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
2027 break;
2028 }
2029 case Instruction::AND_INT_LIT16:
2030 PREAMBLE();
2031 shadow_frame.SetVReg(inst->VRegA_22s(),
2032 shadow_frame.GetVReg(inst->VRegB_22s()) &
2033 inst->VRegC_22s());
2034 inst = inst->Next_2xx();
2035 break;
2036 case Instruction::OR_INT_LIT16:
2037 PREAMBLE();
2038 shadow_frame.SetVReg(inst->VRegA_22s(),
2039 shadow_frame.GetVReg(inst->VRegB_22s()) |
2040 inst->VRegC_22s());
2041 inst = inst->Next_2xx();
2042 break;
2043 case Instruction::XOR_INT_LIT16:
2044 PREAMBLE();
2045 shadow_frame.SetVReg(inst->VRegA_22s(),
2046 shadow_frame.GetVReg(inst->VRegB_22s()) ^
2047 inst->VRegC_22s());
2048 inst = inst->Next_2xx();
2049 break;
2050 case Instruction::ADD_INT_LIT8:
2051 PREAMBLE();
2052 shadow_frame.SetVReg(inst->VRegA_22b(),
2053 shadow_frame.GetVReg(inst->VRegB_22b()) +
2054 inst->VRegC_22b());
2055 inst = inst->Next_2xx();
2056 break;
2057 case Instruction::RSUB_INT_LIT8:
2058 PREAMBLE();
2059 shadow_frame.SetVReg(inst->VRegA_22b(),
2060 inst->VRegC_22b() -
2061 shadow_frame.GetVReg(inst->VRegB_22b()));
2062 inst = inst->Next_2xx();
2063 break;
2064 case Instruction::MUL_INT_LIT8:
2065 PREAMBLE();
2066 shadow_frame.SetVReg(inst->VRegA_22b(),
2067 shadow_frame.GetVReg(inst->VRegB_22b()) *
2068 inst->VRegC_22b());
2069 inst = inst->Next_2xx();
2070 break;
2071 case Instruction::DIV_INT_LIT8: {
2072 PREAMBLE();
2073 bool success = DoIntDivide(shadow_frame, inst->VRegA_22b(),
2074 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
2075 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
2076 break;
2077 }
2078 case Instruction::REM_INT_LIT8: {
2079 PREAMBLE();
2080 bool success = DoIntRemainder(shadow_frame, inst->VRegA_22b(),
2081 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
2082 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx);
2083 break;
2084 }
2085 case Instruction::AND_INT_LIT8:
2086 PREAMBLE();
2087 shadow_frame.SetVReg(inst->VRegA_22b(),
2088 shadow_frame.GetVReg(inst->VRegB_22b()) &
2089 inst->VRegC_22b());
2090 inst = inst->Next_2xx();
2091 break;
2092 case Instruction::OR_INT_LIT8:
2093 PREAMBLE();
2094 shadow_frame.SetVReg(inst->VRegA_22b(),
2095 shadow_frame.GetVReg(inst->VRegB_22b()) |
2096 inst->VRegC_22b());
2097 inst = inst->Next_2xx();
2098 break;
2099 case Instruction::XOR_INT_LIT8:
2100 PREAMBLE();
2101 shadow_frame.SetVReg(inst->VRegA_22b(),
2102 shadow_frame.GetVReg(inst->VRegB_22b()) ^
2103 inst->VRegC_22b());
2104 inst = inst->Next_2xx();
2105 break;
2106 case Instruction::SHL_INT_LIT8:
2107 PREAMBLE();
2108 shadow_frame.SetVReg(inst->VRegA_22b(),
2109 shadow_frame.GetVReg(inst->VRegB_22b()) <<
2110 (inst->VRegC_22b() & 0x1f));
2111 inst = inst->Next_2xx();
2112 break;
2113 case Instruction::SHR_INT_LIT8:
2114 PREAMBLE();
2115 shadow_frame.SetVReg(inst->VRegA_22b(),
2116 shadow_frame.GetVReg(inst->VRegB_22b()) >>
2117 (inst->VRegC_22b() & 0x1f));
2118 inst = inst->Next_2xx();
2119 break;
2120 case Instruction::USHR_INT_LIT8:
2121 PREAMBLE();
2122 shadow_frame.SetVReg(inst->VRegA_22b(),
2123 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_22b())) >>
2124 (inst->VRegC_22b() & 0x1f));
2125 inst = inst->Next_2xx();
2126 break;
2127 case Instruction::UNUSED_3E ... Instruction::UNUSED_43:
2128 case Instruction::UNUSED_EB ... Instruction::UNUSED_FF:
2129 case Instruction::UNUSED_79:
2130 case Instruction::UNUSED_7A:
2131 UnexpectedOpcode(inst, mh);
2132 }
2133 }
2134} // NOLINT(readability/fn_size)
2135
2136// Explicit definitions of ExecuteSwitchImpl.
2137template JValue ExecuteSwitchImpl<true>(Thread* self, MethodHelper& mh,
2138 const DexFile::CodeItem* code_item,
2139 ShadowFrame& shadow_frame, JValue result_register);
2140template JValue ExecuteSwitchImpl<false>(Thread* self, MethodHelper& mh,
2141 const DexFile::CodeItem* code_item,
2142 ShadowFrame& shadow_frame, JValue result_register);
2143
2144} // namespace interpreter
2145} // namespace art