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