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