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