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