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 | |
| 53 | template<bool do_access_check> |
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. |
| 172 | ANDROID_MEMBAR_STORE(); |
| 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(); |
| 186 | ANDROID_MEMBAR_STORE(); |
| 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(); |
Hiroshi Yamauchi | 253ea07 | 2013-10-02 12:44:17 -0700 | [diff] [blame] | 425 | Object* obj = AllocObjectFromCodeInstrumented(inst->VRegB_21c(), shadow_frame.GetMethod(), |
| 426 | self, do_access_check); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 427 | if (UNLIKELY(obj == NULL)) { |
| 428 | HANDLE_PENDING_EXCEPTION(); |
| 429 | } else { |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 430 | shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), obj); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 431 | inst = inst->Next_2xx(); |
| 432 | } |
| 433 | break; |
| 434 | } |
| 435 | case Instruction::NEW_ARRAY: { |
| 436 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 437 | int32_t length = shadow_frame.GetVReg(inst->VRegB_22c(inst_data)); |
Hiroshi Yamauchi | 253ea07 | 2013-10-02 12:44:17 -0700 | [diff] [blame] | 438 | Object* obj = AllocArrayFromCodeInstrumented(inst->VRegC_22c(), shadow_frame.GetMethod(), |
| 439 | length, self, do_access_check); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 440 | if (UNLIKELY(obj == NULL)) { |
| 441 | HANDLE_PENDING_EXCEPTION(); |
| 442 | } else { |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 443 | shadow_frame.SetVRegReference(inst->VRegA_22c(inst_data), obj); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 444 | inst = inst->Next_2xx(); |
| 445 | } |
| 446 | break; |
| 447 | } |
| 448 | case Instruction::FILLED_NEW_ARRAY: { |
| 449 | PREAMBLE(); |
| 450 | bool success = DoFilledNewArray<false, do_access_check>(inst, shadow_frame, |
| 451 | self, &result_register); |
| 452 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 453 | break; |
| 454 | } |
| 455 | case Instruction::FILLED_NEW_ARRAY_RANGE: { |
| 456 | PREAMBLE(); |
| 457 | bool success = DoFilledNewArray<true, do_access_check>(inst, shadow_frame, |
| 458 | self, &result_register); |
| 459 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 460 | break; |
| 461 | } |
| 462 | case Instruction::FILL_ARRAY_DATA: { |
| 463 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 464 | Object* obj = shadow_frame.GetVRegReference(inst->VRegA_31t(inst_data)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 465 | if (UNLIKELY(obj == NULL)) { |
| 466 | ThrowNullPointerException(NULL, "null array in FILL_ARRAY_DATA"); |
| 467 | HANDLE_PENDING_EXCEPTION(); |
| 468 | break; |
| 469 | } |
| 470 | Array* array = obj->AsArray(); |
| 471 | DCHECK(array->IsArrayInstance() && !array->IsObjectArray()); |
| 472 | const uint16_t* payload_addr = reinterpret_cast<const uint16_t*>(inst) + inst->VRegB_31t(); |
| 473 | const Instruction::ArrayDataPayload* payload = |
| 474 | reinterpret_cast<const Instruction::ArrayDataPayload*>(payload_addr); |
| 475 | if (UNLIKELY(static_cast<int32_t>(payload->element_count) > array->GetLength())) { |
| 476 | self->ThrowNewExceptionF(shadow_frame.GetCurrentLocationForThrow(), |
| 477 | "Ljava/lang/ArrayIndexOutOfBoundsException;", |
| 478 | "failed FILL_ARRAY_DATA; length=%d, index=%d", |
| 479 | array->GetLength(), payload->element_count); |
| 480 | HANDLE_PENDING_EXCEPTION(); |
| 481 | break; |
| 482 | } |
| 483 | uint32_t size_in_bytes = payload->element_count * payload->element_width; |
| 484 | memcpy(array->GetRawData(payload->element_width), payload->data, size_in_bytes); |
| 485 | inst = inst->Next_3xx(); |
| 486 | break; |
| 487 | } |
| 488 | case Instruction::THROW: { |
| 489 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 490 | Object* exception = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 491 | if (UNLIKELY(exception == NULL)) { |
| 492 | ThrowNullPointerException(NULL, "throw with null exception"); |
Jeff Hao | a3faaf4 | 2013-09-03 19:07:00 -0700 | [diff] [blame] | 493 | } else if (do_assignability_check && !exception->GetClass()->IsThrowableClass()) { |
| 494 | // This should never happen. |
| 495 | self->ThrowNewExceptionF(self->GetCurrentLocationForThrow(), |
| 496 | "Ljava/lang/VirtualMachineError;", |
| 497 | "Throwing '%s' that is not instance of Throwable", |
| 498 | ClassHelper(exception->GetClass()).GetDescriptor()); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 499 | } else { |
| 500 | self->SetException(shadow_frame.GetCurrentLocationForThrow(), exception->AsThrowable()); |
| 501 | } |
| 502 | HANDLE_PENDING_EXCEPTION(); |
| 503 | break; |
| 504 | } |
| 505 | case Instruction::GOTO: { |
| 506 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 507 | int8_t offset = inst->VRegA_10t(inst_data); |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 508 | if (IsBackwardBranch(offset)) { |
| 509 | if (UNLIKELY(self->TestAllFlags())) { |
| 510 | CheckSuspend(self); |
| 511 | } |
| 512 | } |
| 513 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 514 | break; |
| 515 | } |
| 516 | case Instruction::GOTO_16: { |
| 517 | PREAMBLE(); |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 518 | int16_t offset = inst->VRegA_20t(); |
| 519 | if (IsBackwardBranch(offset)) { |
| 520 | if (UNLIKELY(self->TestAllFlags())) { |
| 521 | CheckSuspend(self); |
| 522 | } |
| 523 | } |
| 524 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 525 | break; |
| 526 | } |
| 527 | case Instruction::GOTO_32: { |
| 528 | PREAMBLE(); |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 529 | int32_t offset = inst->VRegA_30t(); |
| 530 | if (IsBackwardBranch(offset)) { |
| 531 | if (UNLIKELY(self->TestAllFlags())) { |
| 532 | CheckSuspend(self); |
| 533 | } |
| 534 | } |
| 535 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 536 | break; |
| 537 | } |
| 538 | case Instruction::PACKED_SWITCH: { |
| 539 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 540 | int32_t offset = DoPackedSwitch(inst, shadow_frame, inst_data); |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 541 | if (IsBackwardBranch(offset)) { |
| 542 | if (UNLIKELY(self->TestAllFlags())) { |
| 543 | CheckSuspend(self); |
| 544 | } |
| 545 | } |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 546 | inst = inst->RelativeAt(offset); |
| 547 | break; |
| 548 | } |
| 549 | case Instruction::SPARSE_SWITCH: { |
| 550 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 551 | int32_t offset = DoSparseSwitch(inst, shadow_frame, inst_data); |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 552 | if (IsBackwardBranch(offset)) { |
| 553 | if (UNLIKELY(self->TestAllFlags())) { |
| 554 | CheckSuspend(self); |
| 555 | } |
| 556 | } |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 557 | inst = inst->RelativeAt(offset); |
| 558 | break; |
| 559 | } |
| 560 | case Instruction::CMPL_FLOAT: { |
| 561 | PREAMBLE(); |
| 562 | float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x()); |
| 563 | float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x()); |
| 564 | int32_t result; |
| 565 | if (val1 > val2) { |
| 566 | result = 1; |
| 567 | } else if (val1 == val2) { |
| 568 | result = 0; |
| 569 | } else { |
| 570 | result = -1; |
| 571 | } |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 572 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 573 | inst = inst->Next_2xx(); |
| 574 | break; |
| 575 | } |
| 576 | case Instruction::CMPG_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::CMPL_DOUBLE: { |
| 593 | PREAMBLE(); |
| 594 | double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x()); |
| 595 | double val2 = shadow_frame.GetVRegDouble(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 | |
| 609 | case Instruction::CMPG_DOUBLE: { |
| 610 | PREAMBLE(); |
| 611 | double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x()); |
| 612 | double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x()); |
| 613 | int32_t result; |
| 614 | if (val1 < val2) { |
| 615 | result = -1; |
| 616 | } else if (val1 == val2) { |
| 617 | result = 0; |
| 618 | } else { |
| 619 | result = 1; |
| 620 | } |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 621 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 622 | inst = inst->Next_2xx(); |
| 623 | break; |
| 624 | } |
| 625 | case Instruction::CMP_LONG: { |
| 626 | PREAMBLE(); |
| 627 | int64_t val1 = shadow_frame.GetVRegLong(inst->VRegB_23x()); |
| 628 | int64_t val2 = shadow_frame.GetVRegLong(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::IF_EQ: { |
| 642 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 643 | 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] | 644 | int16_t offset = inst->VRegC_22t(); |
| 645 | if (IsBackwardBranch(offset)) { |
| 646 | if (UNLIKELY(self->TestAllFlags())) { |
| 647 | CheckSuspend(self); |
| 648 | } |
| 649 | } |
| 650 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 651 | } else { |
| 652 | inst = inst->Next_2xx(); |
| 653 | } |
| 654 | break; |
| 655 | } |
| 656 | case Instruction::IF_NE: { |
| 657 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 658 | 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] | 659 | int16_t offset = inst->VRegC_22t(); |
| 660 | if (IsBackwardBranch(offset)) { |
| 661 | if (UNLIKELY(self->TestAllFlags())) { |
| 662 | CheckSuspend(self); |
| 663 | } |
| 664 | } |
| 665 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 666 | } else { |
| 667 | inst = inst->Next_2xx(); |
| 668 | } |
| 669 | break; |
| 670 | } |
| 671 | case Instruction::IF_LT: { |
| 672 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 673 | 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] | 674 | int16_t offset = inst->VRegC_22t(); |
| 675 | if (IsBackwardBranch(offset)) { |
| 676 | if (UNLIKELY(self->TestAllFlags())) { |
| 677 | CheckSuspend(self); |
| 678 | } |
| 679 | } |
| 680 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 681 | } else { |
| 682 | inst = inst->Next_2xx(); |
| 683 | } |
| 684 | break; |
| 685 | } |
| 686 | case Instruction::IF_GE: { |
| 687 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 688 | 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] | 689 | int16_t offset = inst->VRegC_22t(); |
| 690 | if (IsBackwardBranch(offset)) { |
| 691 | if (UNLIKELY(self->TestAllFlags())) { |
| 692 | CheckSuspend(self); |
| 693 | } |
| 694 | } |
| 695 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 696 | } else { |
| 697 | inst = inst->Next_2xx(); |
| 698 | } |
| 699 | break; |
| 700 | } |
| 701 | case Instruction::IF_GT: { |
| 702 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 703 | 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] | 704 | int16_t offset = inst->VRegC_22t(); |
| 705 | if (IsBackwardBranch(offset)) { |
| 706 | if (UNLIKELY(self->TestAllFlags())) { |
| 707 | CheckSuspend(self); |
| 708 | } |
| 709 | } |
| 710 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 711 | } else { |
| 712 | inst = inst->Next_2xx(); |
| 713 | } |
| 714 | break; |
| 715 | } |
| 716 | case Instruction::IF_LE: { |
| 717 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 718 | 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] | 719 | int16_t offset = inst->VRegC_22t(); |
| 720 | if (IsBackwardBranch(offset)) { |
| 721 | if (UNLIKELY(self->TestAllFlags())) { |
| 722 | CheckSuspend(self); |
| 723 | } |
| 724 | } |
| 725 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 726 | } else { |
| 727 | inst = inst->Next_2xx(); |
| 728 | } |
| 729 | break; |
| 730 | } |
| 731 | case Instruction::IF_EQZ: { |
| 732 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 733 | if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) == 0) { |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 734 | int16_t offset = inst->VRegB_21t(); |
| 735 | if (IsBackwardBranch(offset)) { |
| 736 | if (UNLIKELY(self->TestAllFlags())) { |
| 737 | CheckSuspend(self); |
| 738 | } |
| 739 | } |
| 740 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 741 | } else { |
| 742 | inst = inst->Next_2xx(); |
| 743 | } |
| 744 | break; |
| 745 | } |
| 746 | case Instruction::IF_NEZ: { |
| 747 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 748 | if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) != 0) { |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 749 | int16_t offset = inst->VRegB_21t(); |
| 750 | if (IsBackwardBranch(offset)) { |
| 751 | if (UNLIKELY(self->TestAllFlags())) { |
| 752 | CheckSuspend(self); |
| 753 | } |
| 754 | } |
| 755 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 756 | } else { |
| 757 | inst = inst->Next_2xx(); |
| 758 | } |
| 759 | break; |
| 760 | } |
| 761 | case Instruction::IF_LTZ: { |
| 762 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 763 | if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) < 0) { |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 764 | int16_t offset = inst->VRegB_21t(); |
| 765 | if (IsBackwardBranch(offset)) { |
| 766 | if (UNLIKELY(self->TestAllFlags())) { |
| 767 | CheckSuspend(self); |
| 768 | } |
| 769 | } |
| 770 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 771 | } else { |
| 772 | inst = inst->Next_2xx(); |
| 773 | } |
| 774 | break; |
| 775 | } |
| 776 | case Instruction::IF_GEZ: { |
| 777 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 778 | if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) >= 0) { |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 779 | int16_t offset = inst->VRegB_21t(); |
| 780 | if (IsBackwardBranch(offset)) { |
| 781 | if (UNLIKELY(self->TestAllFlags())) { |
| 782 | CheckSuspend(self); |
| 783 | } |
| 784 | } |
| 785 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 786 | } else { |
| 787 | inst = inst->Next_2xx(); |
| 788 | } |
| 789 | break; |
| 790 | } |
| 791 | case Instruction::IF_GTZ: { |
| 792 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 793 | if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) > 0) { |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 794 | int16_t offset = inst->VRegB_21t(); |
| 795 | if (IsBackwardBranch(offset)) { |
| 796 | if (UNLIKELY(self->TestAllFlags())) { |
| 797 | CheckSuspend(self); |
| 798 | } |
| 799 | } |
| 800 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 801 | } else { |
| 802 | inst = inst->Next_2xx(); |
| 803 | } |
| 804 | break; |
| 805 | } |
| 806 | case Instruction::IF_LEZ: { |
| 807 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 808 | if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) <= 0) { |
Sebastien Hertz | 1eda226 | 2013-09-09 16:53:14 +0200 | [diff] [blame] | 809 | int16_t offset = inst->VRegB_21t(); |
| 810 | if (IsBackwardBranch(offset)) { |
| 811 | if (UNLIKELY(self->TestAllFlags())) { |
| 812 | CheckSuspend(self); |
| 813 | } |
| 814 | } |
| 815 | inst = inst->RelativeAt(offset); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 816 | } else { |
| 817 | inst = inst->Next_2xx(); |
| 818 | } |
| 819 | break; |
| 820 | } |
| 821 | case Instruction::AGET_BOOLEAN: { |
| 822 | PREAMBLE(); |
| 823 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 824 | if (UNLIKELY(a == NULL)) { |
| 825 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 826 | HANDLE_PENDING_EXCEPTION(); |
| 827 | break; |
| 828 | } |
| 829 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 830 | BooleanArray* array = a->AsBooleanArray(); |
| 831 | if (LIKELY(array->IsValidIndex(index))) { |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 832 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetData()[index]); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 833 | inst = inst->Next_2xx(); |
| 834 | } else { |
| 835 | HANDLE_PENDING_EXCEPTION(); |
| 836 | } |
| 837 | break; |
| 838 | } |
| 839 | case Instruction::AGET_BYTE: { |
| 840 | PREAMBLE(); |
| 841 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 842 | if (UNLIKELY(a == NULL)) { |
| 843 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 844 | HANDLE_PENDING_EXCEPTION(); |
| 845 | break; |
| 846 | } |
| 847 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 848 | ByteArray* array = a->AsByteArray(); |
| 849 | if (LIKELY(array->IsValidIndex(index))) { |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 850 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetData()[index]); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 851 | inst = inst->Next_2xx(); |
| 852 | } else { |
| 853 | HANDLE_PENDING_EXCEPTION(); |
| 854 | } |
| 855 | break; |
| 856 | } |
| 857 | case Instruction::AGET_CHAR: { |
| 858 | PREAMBLE(); |
| 859 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 860 | if (UNLIKELY(a == NULL)) { |
| 861 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 862 | HANDLE_PENDING_EXCEPTION(); |
| 863 | break; |
| 864 | } |
| 865 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 866 | CharArray* array = a->AsCharArray(); |
| 867 | if (LIKELY(array->IsValidIndex(index))) { |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 868 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetData()[index]); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 869 | inst = inst->Next_2xx(); |
| 870 | } else { |
| 871 | HANDLE_PENDING_EXCEPTION(); |
| 872 | } |
| 873 | break; |
| 874 | } |
| 875 | case Instruction::AGET_SHORT: { |
| 876 | PREAMBLE(); |
| 877 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 878 | if (UNLIKELY(a == NULL)) { |
| 879 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 880 | HANDLE_PENDING_EXCEPTION(); |
| 881 | break; |
| 882 | } |
| 883 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 884 | ShortArray* array = a->AsShortArray(); |
| 885 | if (LIKELY(array->IsValidIndex(index))) { |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 886 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetData()[index]); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 887 | inst = inst->Next_2xx(); |
| 888 | } else { |
| 889 | HANDLE_PENDING_EXCEPTION(); |
| 890 | } |
| 891 | break; |
| 892 | } |
| 893 | case Instruction::AGET: { |
| 894 | PREAMBLE(); |
| 895 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 896 | if (UNLIKELY(a == NULL)) { |
| 897 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 898 | HANDLE_PENDING_EXCEPTION(); |
| 899 | break; |
| 900 | } |
| 901 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 902 | IntArray* array = a->AsIntArray(); |
| 903 | if (LIKELY(array->IsValidIndex(index))) { |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 904 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetData()[index]); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 905 | inst = inst->Next_2xx(); |
| 906 | } else { |
| 907 | HANDLE_PENDING_EXCEPTION(); |
| 908 | } |
| 909 | break; |
| 910 | } |
| 911 | case Instruction::AGET_WIDE: { |
| 912 | PREAMBLE(); |
| 913 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 914 | if (UNLIKELY(a == NULL)) { |
| 915 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 916 | HANDLE_PENDING_EXCEPTION(); |
| 917 | break; |
| 918 | } |
| 919 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 920 | LongArray* array = a->AsLongArray(); |
| 921 | if (LIKELY(array->IsValidIndex(index))) { |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 922 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), array->GetData()[index]); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 923 | inst = inst->Next_2xx(); |
| 924 | } else { |
| 925 | HANDLE_PENDING_EXCEPTION(); |
| 926 | } |
| 927 | break; |
| 928 | } |
| 929 | case Instruction::AGET_OBJECT: { |
| 930 | PREAMBLE(); |
| 931 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 932 | if (UNLIKELY(a == NULL)) { |
| 933 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 934 | HANDLE_PENDING_EXCEPTION(); |
| 935 | break; |
| 936 | } |
| 937 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 938 | ObjectArray<Object>* array = a->AsObjectArray<Object>(); |
| 939 | if (LIKELY(array->IsValidIndex(index))) { |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 940 | shadow_frame.SetVRegReference(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 941 | inst = inst->Next_2xx(); |
| 942 | } else { |
| 943 | HANDLE_PENDING_EXCEPTION(); |
| 944 | } |
| 945 | break; |
| 946 | } |
| 947 | case Instruction::APUT_BOOLEAN: { |
| 948 | PREAMBLE(); |
| 949 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 950 | if (UNLIKELY(a == NULL)) { |
| 951 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 952 | HANDLE_PENDING_EXCEPTION(); |
| 953 | break; |
| 954 | } |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 955 | uint8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 956 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 957 | BooleanArray* array = a->AsBooleanArray(); |
| 958 | if (LIKELY(array->IsValidIndex(index))) { |
| 959 | array->GetData()[index] = val; |
| 960 | inst = inst->Next_2xx(); |
| 961 | } else { |
| 962 | HANDLE_PENDING_EXCEPTION(); |
| 963 | } |
| 964 | break; |
| 965 | } |
| 966 | case Instruction::APUT_BYTE: { |
| 967 | PREAMBLE(); |
| 968 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 969 | if (UNLIKELY(a == NULL)) { |
| 970 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 971 | HANDLE_PENDING_EXCEPTION(); |
| 972 | break; |
| 973 | } |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 974 | int8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 975 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 976 | ByteArray* array = a->AsByteArray(); |
| 977 | if (LIKELY(array->IsValidIndex(index))) { |
| 978 | array->GetData()[index] = val; |
| 979 | inst = inst->Next_2xx(); |
| 980 | } else { |
| 981 | HANDLE_PENDING_EXCEPTION(); |
| 982 | } |
| 983 | break; |
| 984 | } |
| 985 | case Instruction::APUT_CHAR: { |
| 986 | PREAMBLE(); |
| 987 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 988 | if (UNLIKELY(a == NULL)) { |
| 989 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 990 | HANDLE_PENDING_EXCEPTION(); |
| 991 | break; |
| 992 | } |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 993 | uint16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 994 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 995 | CharArray* array = a->AsCharArray(); |
| 996 | if (LIKELY(array->IsValidIndex(index))) { |
| 997 | array->GetData()[index] = val; |
| 998 | inst = inst->Next_2xx(); |
| 999 | } else { |
| 1000 | HANDLE_PENDING_EXCEPTION(); |
| 1001 | } |
| 1002 | break; |
| 1003 | } |
| 1004 | case Instruction::APUT_SHORT: { |
| 1005 | PREAMBLE(); |
| 1006 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 1007 | if (UNLIKELY(a == NULL)) { |
| 1008 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 1009 | HANDLE_PENDING_EXCEPTION(); |
| 1010 | break; |
| 1011 | } |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1012 | int16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1013 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 1014 | ShortArray* array = a->AsShortArray(); |
| 1015 | if (LIKELY(array->IsValidIndex(index))) { |
| 1016 | array->GetData()[index] = val; |
| 1017 | inst = inst->Next_2xx(); |
| 1018 | } else { |
| 1019 | HANDLE_PENDING_EXCEPTION(); |
| 1020 | } |
| 1021 | break; |
| 1022 | } |
| 1023 | case Instruction::APUT: { |
| 1024 | PREAMBLE(); |
| 1025 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 1026 | if (UNLIKELY(a == NULL)) { |
| 1027 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 1028 | HANDLE_PENDING_EXCEPTION(); |
| 1029 | break; |
| 1030 | } |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1031 | int32_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1032 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 1033 | IntArray* array = a->AsIntArray(); |
| 1034 | if (LIKELY(array->IsValidIndex(index))) { |
| 1035 | array->GetData()[index] = val; |
| 1036 | inst = inst->Next_2xx(); |
| 1037 | } else { |
| 1038 | HANDLE_PENDING_EXCEPTION(); |
| 1039 | } |
| 1040 | break; |
| 1041 | } |
| 1042 | case Instruction::APUT_WIDE: { |
| 1043 | PREAMBLE(); |
| 1044 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 1045 | if (UNLIKELY(a == NULL)) { |
| 1046 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 1047 | HANDLE_PENDING_EXCEPTION(); |
| 1048 | break; |
| 1049 | } |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1050 | int64_t val = shadow_frame.GetVRegLong(inst->VRegA_23x(inst_data)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1051 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
| 1052 | LongArray* array = a->AsLongArray(); |
| 1053 | if (LIKELY(array->IsValidIndex(index))) { |
| 1054 | array->GetData()[index] = val; |
| 1055 | inst = inst->Next_2xx(); |
| 1056 | } else { |
| 1057 | HANDLE_PENDING_EXCEPTION(); |
| 1058 | } |
| 1059 | break; |
| 1060 | } |
| 1061 | case Instruction::APUT_OBJECT: { |
| 1062 | PREAMBLE(); |
| 1063 | Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); |
| 1064 | if (UNLIKELY(a == NULL)) { |
| 1065 | ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow()); |
| 1066 | HANDLE_PENDING_EXCEPTION(); |
| 1067 | break; |
| 1068 | } |
| 1069 | int32_t index = shadow_frame.GetVReg(inst->VRegC_23x()); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1070 | Object* val = shadow_frame.GetVRegReference(inst->VRegA_23x(inst_data)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1071 | ObjectArray<Object>* array = a->AsObjectArray<Object>(); |
| 1072 | if (LIKELY(array->IsValidIndex(index) && array->CheckAssignable(val))) { |
| 1073 | array->SetWithoutChecks(index, val); |
| 1074 | inst = inst->Next_2xx(); |
| 1075 | } else { |
| 1076 | HANDLE_PENDING_EXCEPTION(); |
| 1077 | } |
| 1078 | break; |
| 1079 | } |
| 1080 | case Instruction::IGET_BOOLEAN: { |
| 1081 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1082 | 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] | 1083 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1084 | break; |
| 1085 | } |
| 1086 | case Instruction::IGET_BYTE: { |
| 1087 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1088 | 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] | 1089 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1090 | break; |
| 1091 | } |
| 1092 | case Instruction::IGET_CHAR: { |
| 1093 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1094 | 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] | 1095 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1096 | break; |
| 1097 | } |
| 1098 | case Instruction::IGET_SHORT: { |
| 1099 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1100 | 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] | 1101 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1102 | break; |
| 1103 | } |
| 1104 | case Instruction::IGET: { |
| 1105 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1106 | 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] | 1107 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1108 | break; |
| 1109 | } |
| 1110 | case Instruction::IGET_WIDE: { |
| 1111 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1112 | 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] | 1113 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1114 | break; |
| 1115 | } |
| 1116 | case Instruction::IGET_OBJECT: { |
| 1117 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1118 | 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] | 1119 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1120 | break; |
| 1121 | } |
| 1122 | case Instruction::IGET_QUICK: { |
| 1123 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1124 | bool success = DoIGetQuick<Primitive::kPrimInt>(shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1125 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1126 | break; |
| 1127 | } |
| 1128 | case Instruction::IGET_WIDE_QUICK: { |
| 1129 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1130 | bool success = DoIGetQuick<Primitive::kPrimLong>(shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1131 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1132 | break; |
| 1133 | } |
| 1134 | case Instruction::IGET_OBJECT_QUICK: { |
| 1135 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1136 | bool success = DoIGetQuick<Primitive::kPrimNot>(shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1137 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1138 | break; |
| 1139 | } |
| 1140 | case Instruction::SGET_BOOLEAN: { |
| 1141 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1142 | 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] | 1143 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1144 | break; |
| 1145 | } |
| 1146 | case Instruction::SGET_BYTE: { |
| 1147 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1148 | 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] | 1149 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1150 | break; |
| 1151 | } |
| 1152 | case Instruction::SGET_CHAR: { |
| 1153 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1154 | 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] | 1155 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1156 | break; |
| 1157 | } |
| 1158 | case Instruction::SGET_SHORT: { |
| 1159 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1160 | 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] | 1161 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1162 | break; |
| 1163 | } |
| 1164 | case Instruction::SGET: { |
| 1165 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1166 | 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] | 1167 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1168 | break; |
| 1169 | } |
| 1170 | case Instruction::SGET_WIDE: { |
| 1171 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1172 | 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] | 1173 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1174 | break; |
| 1175 | } |
| 1176 | case Instruction::SGET_OBJECT: { |
| 1177 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1178 | 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] | 1179 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1180 | break; |
| 1181 | } |
| 1182 | case Instruction::IPUT_BOOLEAN: { |
| 1183 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1184 | bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimBoolean, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1185 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1186 | break; |
| 1187 | } |
| 1188 | case Instruction::IPUT_BYTE: { |
| 1189 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1190 | bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimByte, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1191 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1192 | break; |
| 1193 | } |
| 1194 | case Instruction::IPUT_CHAR: { |
| 1195 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1196 | bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimChar, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1197 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1198 | break; |
| 1199 | } |
| 1200 | case Instruction::IPUT_SHORT: { |
| 1201 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1202 | bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimShort, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1203 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1204 | break; |
| 1205 | } |
| 1206 | case Instruction::IPUT: { |
| 1207 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1208 | bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimInt, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1209 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1210 | break; |
| 1211 | } |
| 1212 | case Instruction::IPUT_WIDE: { |
| 1213 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1214 | bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimLong, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1215 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1216 | break; |
| 1217 | } |
| 1218 | case Instruction::IPUT_OBJECT: { |
| 1219 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1220 | bool success = DoFieldPut<InstanceObjectWrite, Primitive::kPrimNot, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1221 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1222 | break; |
| 1223 | } |
| 1224 | case Instruction::IPUT_QUICK: { |
| 1225 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1226 | bool success = DoIPutQuick<Primitive::kPrimInt>(shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1227 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1228 | break; |
| 1229 | } |
| 1230 | case Instruction::IPUT_WIDE_QUICK: { |
| 1231 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1232 | bool success = DoIPutQuick<Primitive::kPrimLong>(shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1233 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1234 | break; |
| 1235 | } |
| 1236 | case Instruction::IPUT_OBJECT_QUICK: { |
| 1237 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1238 | bool success = DoIPutQuick<Primitive::kPrimNot>(shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1239 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1240 | break; |
| 1241 | } |
| 1242 | case Instruction::SPUT_BOOLEAN: { |
| 1243 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1244 | bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimBoolean, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1245 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1246 | break; |
| 1247 | } |
| 1248 | case Instruction::SPUT_BYTE: { |
| 1249 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1250 | bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimByte, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1251 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1252 | break; |
| 1253 | } |
| 1254 | case Instruction::SPUT_CHAR: { |
| 1255 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1256 | bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimChar, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1257 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1258 | break; |
| 1259 | } |
| 1260 | case Instruction::SPUT_SHORT: { |
| 1261 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1262 | bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimShort, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1263 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1264 | break; |
| 1265 | } |
| 1266 | case Instruction::SPUT: { |
| 1267 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1268 | bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimInt, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1269 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1270 | break; |
| 1271 | } |
| 1272 | case Instruction::SPUT_WIDE: { |
| 1273 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1274 | bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimLong, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1275 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1276 | break; |
| 1277 | } |
| 1278 | case Instruction::SPUT_OBJECT: { |
| 1279 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1280 | bool success = DoFieldPut<StaticObjectWrite, Primitive::kPrimNot, do_access_check>(self, shadow_frame, inst, inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1281 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1282 | break; |
| 1283 | } |
| 1284 | case Instruction::INVOKE_VIRTUAL: { |
| 1285 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1286 | 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] | 1287 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1288 | break; |
| 1289 | } |
| 1290 | case Instruction::INVOKE_VIRTUAL_RANGE: { |
| 1291 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1292 | 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] | 1293 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1294 | break; |
| 1295 | } |
| 1296 | case Instruction::INVOKE_SUPER: { |
| 1297 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1298 | 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] | 1299 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1300 | break; |
| 1301 | } |
| 1302 | case Instruction::INVOKE_SUPER_RANGE: { |
| 1303 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1304 | 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] | 1305 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1306 | break; |
| 1307 | } |
| 1308 | case Instruction::INVOKE_DIRECT: { |
| 1309 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1310 | 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] | 1311 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1312 | break; |
| 1313 | } |
| 1314 | case Instruction::INVOKE_DIRECT_RANGE: { |
| 1315 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1316 | 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] | 1317 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1318 | break; |
| 1319 | } |
| 1320 | case Instruction::INVOKE_INTERFACE: { |
| 1321 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1322 | 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] | 1323 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1324 | break; |
| 1325 | } |
| 1326 | case Instruction::INVOKE_INTERFACE_RANGE: { |
| 1327 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1328 | 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] | 1329 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1330 | break; |
| 1331 | } |
| 1332 | case Instruction::INVOKE_STATIC: { |
| 1333 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1334 | 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] | 1335 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1336 | break; |
| 1337 | } |
| 1338 | case Instruction::INVOKE_STATIC_RANGE: { |
| 1339 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1340 | 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] | 1341 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1342 | break; |
| 1343 | } |
| 1344 | case Instruction::INVOKE_VIRTUAL_QUICK: { |
| 1345 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1346 | bool success = DoInvokeVirtualQuick<false>(self, shadow_frame, inst, inst_data, &result_register); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1347 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1348 | break; |
| 1349 | } |
| 1350 | case Instruction::INVOKE_VIRTUAL_RANGE_QUICK: { |
| 1351 | PREAMBLE(); |
Sebastien Hertz | c61124b | 2013-09-10 11:44:19 +0200 | [diff] [blame] | 1352 | bool success = DoInvokeVirtualQuick<true>(self, shadow_frame, inst, inst_data, &result_register); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1353 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); |
| 1354 | break; |
| 1355 | } |
| 1356 | case Instruction::NEG_INT: |
| 1357 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1358 | 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] | 1359 | inst = inst->Next_1xx(); |
| 1360 | break; |
| 1361 | case Instruction::NOT_INT: |
| 1362 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1363 | 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] | 1364 | inst = inst->Next_1xx(); |
| 1365 | break; |
| 1366 | case Instruction::NEG_LONG: |
| 1367 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1368 | 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] | 1369 | inst = inst->Next_1xx(); |
| 1370 | break; |
| 1371 | case Instruction::NOT_LONG: |
| 1372 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1373 | 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] | 1374 | inst = inst->Next_1xx(); |
| 1375 | break; |
| 1376 | case Instruction::NEG_FLOAT: |
| 1377 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1378 | 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] | 1379 | inst = inst->Next_1xx(); |
| 1380 | break; |
| 1381 | case Instruction::NEG_DOUBLE: |
| 1382 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1383 | 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] | 1384 | inst = inst->Next_1xx(); |
| 1385 | break; |
| 1386 | case Instruction::INT_TO_LONG: |
| 1387 | PREAMBLE(); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1388 | shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), |
| 1389 | shadow_frame.GetVReg(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::INT_TO_FLOAT: |
| 1393 | PREAMBLE(); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1394 | shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), |
| 1395 | shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1396 | inst = inst->Next_1xx(); |
| 1397 | break; |
| 1398 | case Instruction::INT_TO_DOUBLE: |
| 1399 | PREAMBLE(); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1400 | shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), |
| 1401 | shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1402 | inst = inst->Next_1xx(); |
| 1403 | break; |
| 1404 | case Instruction::LONG_TO_INT: |
| 1405 | PREAMBLE(); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1406 | shadow_frame.SetVReg(inst->VRegA_12x(inst_data), |
| 1407 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1408 | inst = inst->Next_1xx(); |
| 1409 | break; |
| 1410 | case Instruction::LONG_TO_FLOAT: |
| 1411 | PREAMBLE(); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1412 | shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), |
| 1413 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1414 | inst = inst->Next_1xx(); |
| 1415 | break; |
| 1416 | case Instruction::LONG_TO_DOUBLE: |
| 1417 | PREAMBLE(); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1418 | shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), |
| 1419 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1420 | inst = inst->Next_1xx(); |
| 1421 | break; |
| 1422 | case Instruction::FLOAT_TO_INT: { |
| 1423 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1424 | float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1425 | int32_t result = art_float_to_integral<int32_t, float>(val); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1426 | shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1427 | inst = inst->Next_1xx(); |
| 1428 | break; |
| 1429 | } |
| 1430 | case Instruction::FLOAT_TO_LONG: { |
| 1431 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1432 | float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1433 | int64_t result = art_float_to_integral<int64_t, float>(val); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1434 | shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1435 | inst = inst->Next_1xx(); |
| 1436 | break; |
| 1437 | } |
| 1438 | case Instruction::FLOAT_TO_DOUBLE: |
| 1439 | PREAMBLE(); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1440 | shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), |
| 1441 | shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1442 | inst = inst->Next_1xx(); |
| 1443 | break; |
| 1444 | case Instruction::DOUBLE_TO_INT: { |
| 1445 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1446 | double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1447 | int32_t result = art_float_to_integral<int32_t, double>(val); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1448 | shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1449 | inst = inst->Next_1xx(); |
| 1450 | break; |
| 1451 | } |
| 1452 | case Instruction::DOUBLE_TO_LONG: { |
| 1453 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1454 | double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1455 | int64_t result = art_float_to_integral<int64_t, double>(val); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1456 | shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1457 | inst = inst->Next_1xx(); |
| 1458 | break; |
| 1459 | } |
| 1460 | case Instruction::DOUBLE_TO_FLOAT: |
| 1461 | PREAMBLE(); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 1462 | shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), |
| 1463 | shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1464 | inst = inst->Next_1xx(); |
| 1465 | break; |
| 1466 | case Instruction::INT_TO_BYTE: |
| 1467 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1468 | shadow_frame.SetVReg(inst->VRegA_12x(inst_data), |
| 1469 | static_cast<int8_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data)))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1470 | inst = inst->Next_1xx(); |
| 1471 | break; |
| 1472 | case Instruction::INT_TO_CHAR: |
| 1473 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1474 | shadow_frame.SetVReg(inst->VRegA_12x(inst_data), |
| 1475 | static_cast<uint16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data)))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1476 | inst = inst->Next_1xx(); |
| 1477 | break; |
| 1478 | case Instruction::INT_TO_SHORT: |
| 1479 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1480 | shadow_frame.SetVReg(inst->VRegA_12x(inst_data), |
| 1481 | static_cast<int16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data)))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1482 | inst = inst->Next_1xx(); |
| 1483 | break; |
| 1484 | case Instruction::ADD_INT: |
| 1485 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1486 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1487 | shadow_frame.GetVReg(inst->VRegB_23x()) + |
| 1488 | shadow_frame.GetVReg(inst->VRegC_23x())); |
| 1489 | inst = inst->Next_2xx(); |
| 1490 | break; |
| 1491 | case Instruction::SUB_INT: |
| 1492 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1493 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1494 | shadow_frame.GetVReg(inst->VRegB_23x()) - |
| 1495 | shadow_frame.GetVReg(inst->VRegC_23x())); |
| 1496 | inst = inst->Next_2xx(); |
| 1497 | break; |
| 1498 | case Instruction::MUL_INT: |
| 1499 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1500 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1501 | shadow_frame.GetVReg(inst->VRegB_23x()) * |
| 1502 | shadow_frame.GetVReg(inst->VRegC_23x())); |
| 1503 | inst = inst->Next_2xx(); |
| 1504 | break; |
| 1505 | case Instruction::DIV_INT: { |
| 1506 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1507 | bool success = DoIntDivide(shadow_frame, inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1508 | shadow_frame.GetVReg(inst->VRegB_23x()), |
| 1509 | shadow_frame.GetVReg(inst->VRegC_23x())); |
| 1510 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1511 | break; |
| 1512 | } |
| 1513 | case Instruction::REM_INT: { |
| 1514 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1515 | bool success = DoIntRemainder(shadow_frame, inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1516 | shadow_frame.GetVReg(inst->VRegB_23x()), |
| 1517 | shadow_frame.GetVReg(inst->VRegC_23x())); |
| 1518 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 1519 | break; |
| 1520 | } |
| 1521 | case Instruction::SHL_INT: |
| 1522 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1523 | shadow_frame.SetVReg(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()) & 0x1f)); |
| 1526 | inst = inst->Next_2xx(); |
| 1527 | break; |
| 1528 | case Instruction::SHR_INT: |
| 1529 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1530 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1531 | shadow_frame.GetVReg(inst->VRegB_23x()) >> |
| 1532 | (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f)); |
| 1533 | inst = inst->Next_2xx(); |
| 1534 | break; |
| 1535 | case Instruction::USHR_INT: |
| 1536 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1537 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1538 | static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_23x())) >> |
| 1539 | (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f)); |
| 1540 | inst = inst->Next_2xx(); |
| 1541 | break; |
| 1542 | case Instruction::AND_INT: |
| 1543 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1544 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1545 | shadow_frame.GetVReg(inst->VRegB_23x()) & |
| 1546 | shadow_frame.GetVReg(inst->VRegC_23x())); |
| 1547 | inst = inst->Next_2xx(); |
| 1548 | break; |
| 1549 | case Instruction::OR_INT: |
| 1550 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1551 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1552 | shadow_frame.GetVReg(inst->VRegB_23x()) | |
| 1553 | shadow_frame.GetVReg(inst->VRegC_23x())); |
| 1554 | inst = inst->Next_2xx(); |
| 1555 | break; |
| 1556 | case Instruction::XOR_INT: |
| 1557 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1558 | shadow_frame.SetVReg(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1559 | shadow_frame.GetVReg(inst->VRegB_23x()) ^ |
| 1560 | shadow_frame.GetVReg(inst->VRegC_23x())); |
| 1561 | inst = inst->Next_2xx(); |
| 1562 | break; |
| 1563 | case Instruction::ADD_LONG: |
| 1564 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1565 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1566 | shadow_frame.GetVRegLong(inst->VRegB_23x()) + |
| 1567 | shadow_frame.GetVRegLong(inst->VRegC_23x())); |
| 1568 | inst = inst->Next_2xx(); |
| 1569 | break; |
| 1570 | case Instruction::SUB_LONG: |
| 1571 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1572 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1573 | shadow_frame.GetVRegLong(inst->VRegB_23x()) - |
| 1574 | shadow_frame.GetVRegLong(inst->VRegC_23x())); |
| 1575 | inst = inst->Next_2xx(); |
| 1576 | break; |
| 1577 | case Instruction::MUL_LONG: |
| 1578 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1579 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1580 | shadow_frame.GetVRegLong(inst->VRegB_23x()) * |
| 1581 | shadow_frame.GetVRegLong(inst->VRegC_23x())); |
| 1582 | inst = inst->Next_2xx(); |
| 1583 | break; |
| 1584 | case Instruction::DIV_LONG: |
| 1585 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1586 | DoLongDivide(shadow_frame, inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1587 | shadow_frame.GetVRegLong(inst->VRegB_23x()), |
| 1588 | shadow_frame.GetVRegLong(inst->VRegC_23x())); |
| 1589 | POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_2xx); |
| 1590 | break; |
| 1591 | case Instruction::REM_LONG: |
| 1592 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1593 | DoLongRemainder(shadow_frame, inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1594 | shadow_frame.GetVRegLong(inst->VRegB_23x()), |
| 1595 | shadow_frame.GetVRegLong(inst->VRegC_23x())); |
| 1596 | POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_2xx); |
| 1597 | break; |
| 1598 | case Instruction::AND_LONG: |
| 1599 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1600 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1601 | shadow_frame.GetVRegLong(inst->VRegB_23x()) & |
| 1602 | shadow_frame.GetVRegLong(inst->VRegC_23x())); |
| 1603 | inst = inst->Next_2xx(); |
| 1604 | break; |
| 1605 | case Instruction::OR_LONG: |
| 1606 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1607 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1608 | shadow_frame.GetVRegLong(inst->VRegB_23x()) | |
| 1609 | shadow_frame.GetVRegLong(inst->VRegC_23x())); |
| 1610 | inst = inst->Next_2xx(); |
| 1611 | break; |
| 1612 | case Instruction::XOR_LONG: |
| 1613 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1614 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1615 | shadow_frame.GetVRegLong(inst->VRegB_23x()) ^ |
| 1616 | shadow_frame.GetVRegLong(inst->VRegC_23x())); |
| 1617 | inst = inst->Next_2xx(); |
| 1618 | break; |
| 1619 | case Instruction::SHL_LONG: |
| 1620 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1621 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1622 | shadow_frame.GetVRegLong(inst->VRegB_23x()) << |
| 1623 | (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f)); |
| 1624 | inst = inst->Next_2xx(); |
| 1625 | break; |
| 1626 | case Instruction::SHR_LONG: |
| 1627 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1628 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1629 | shadow_frame.GetVRegLong(inst->VRegB_23x()) >> |
| 1630 | (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f)); |
| 1631 | inst = inst->Next_2xx(); |
| 1632 | break; |
| 1633 | case Instruction::USHR_LONG: |
| 1634 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1635 | shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1636 | static_cast<uint64_t>(shadow_frame.GetVRegLong(inst->VRegB_23x())) >> |
| 1637 | (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f)); |
| 1638 | inst = inst->Next_2xx(); |
| 1639 | break; |
| 1640 | case Instruction::ADD_FLOAT: |
| 1641 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1642 | shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1643 | shadow_frame.GetVRegFloat(inst->VRegB_23x()) + |
| 1644 | shadow_frame.GetVRegFloat(inst->VRegC_23x())); |
| 1645 | inst = inst->Next_2xx(); |
| 1646 | break; |
| 1647 | case Instruction::SUB_FLOAT: |
| 1648 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1649 | shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1650 | shadow_frame.GetVRegFloat(inst->VRegB_23x()) - |
| 1651 | shadow_frame.GetVRegFloat(inst->VRegC_23x())); |
| 1652 | inst = inst->Next_2xx(); |
| 1653 | break; |
| 1654 | case Instruction::MUL_FLOAT: |
| 1655 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1656 | shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1657 | shadow_frame.GetVRegFloat(inst->VRegB_23x()) * |
| 1658 | shadow_frame.GetVRegFloat(inst->VRegC_23x())); |
| 1659 | inst = inst->Next_2xx(); |
| 1660 | break; |
| 1661 | case Instruction::DIV_FLOAT: |
| 1662 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1663 | shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1664 | shadow_frame.GetVRegFloat(inst->VRegB_23x()) / |
| 1665 | shadow_frame.GetVRegFloat(inst->VRegC_23x())); |
| 1666 | inst = inst->Next_2xx(); |
| 1667 | break; |
| 1668 | case Instruction::REM_FLOAT: |
| 1669 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1670 | shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1671 | fmodf(shadow_frame.GetVRegFloat(inst->VRegB_23x()), |
| 1672 | shadow_frame.GetVRegFloat(inst->VRegC_23x()))); |
| 1673 | inst = inst->Next_2xx(); |
| 1674 | break; |
| 1675 | case Instruction::ADD_DOUBLE: |
| 1676 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1677 | shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1678 | shadow_frame.GetVRegDouble(inst->VRegB_23x()) + |
| 1679 | shadow_frame.GetVRegDouble(inst->VRegC_23x())); |
| 1680 | inst = inst->Next_2xx(); |
| 1681 | break; |
| 1682 | case Instruction::SUB_DOUBLE: |
| 1683 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1684 | shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1685 | shadow_frame.GetVRegDouble(inst->VRegB_23x()) - |
| 1686 | shadow_frame.GetVRegDouble(inst->VRegC_23x())); |
| 1687 | inst = inst->Next_2xx(); |
| 1688 | break; |
| 1689 | case Instruction::MUL_DOUBLE: |
| 1690 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1691 | shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1692 | shadow_frame.GetVRegDouble(inst->VRegB_23x()) * |
| 1693 | shadow_frame.GetVRegDouble(inst->VRegC_23x())); |
| 1694 | inst = inst->Next_2xx(); |
| 1695 | break; |
| 1696 | case Instruction::DIV_DOUBLE: |
| 1697 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1698 | shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1699 | shadow_frame.GetVRegDouble(inst->VRegB_23x()) / |
| 1700 | shadow_frame.GetVRegDouble(inst->VRegC_23x())); |
| 1701 | inst = inst->Next_2xx(); |
| 1702 | break; |
| 1703 | case Instruction::REM_DOUBLE: |
| 1704 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1705 | shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1706 | fmod(shadow_frame.GetVRegDouble(inst->VRegB_23x()), |
| 1707 | shadow_frame.GetVRegDouble(inst->VRegC_23x()))); |
| 1708 | inst = inst->Next_2xx(); |
| 1709 | break; |
| 1710 | case Instruction::ADD_INT_2ADDR: { |
| 1711 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1712 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1713 | shadow_frame.SetVReg(vregA, |
| 1714 | shadow_frame.GetVReg(vregA) + |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1715 | shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1716 | inst = inst->Next_1xx(); |
| 1717 | break; |
| 1718 | } |
| 1719 | case Instruction::SUB_INT_2ADDR: { |
| 1720 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1721 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1722 | shadow_frame.SetVReg(vregA, |
| 1723 | shadow_frame.GetVReg(vregA) - |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1724 | shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1725 | inst = inst->Next_1xx(); |
| 1726 | break; |
| 1727 | } |
| 1728 | case Instruction::MUL_INT_2ADDR: { |
| 1729 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1730 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1731 | shadow_frame.SetVReg(vregA, |
| 1732 | shadow_frame.GetVReg(vregA) * |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1733 | shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1734 | inst = inst->Next_1xx(); |
| 1735 | break; |
| 1736 | } |
| 1737 | case Instruction::DIV_INT_2ADDR: { |
| 1738 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1739 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1740 | bool success = DoIntDivide(shadow_frame, vregA, shadow_frame.GetVReg(vregA), |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1741 | shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1742 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_1xx); |
| 1743 | break; |
| 1744 | } |
| 1745 | case Instruction::REM_INT_2ADDR: { |
| 1746 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1747 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1748 | bool success = DoIntRemainder(shadow_frame, vregA, 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 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_1xx); |
| 1751 | break; |
| 1752 | } |
| 1753 | case Instruction::SHL_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 | shadow_frame.SetVReg(vregA, |
| 1757 | shadow_frame.GetVReg(vregA) << |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1758 | (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1759 | inst = inst->Next_1xx(); |
| 1760 | break; |
| 1761 | } |
| 1762 | case Instruction::SHR_INT_2ADDR: { |
| 1763 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1764 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1765 | shadow_frame.SetVReg(vregA, |
| 1766 | shadow_frame.GetVReg(vregA) >> |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1767 | (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1768 | inst = inst->Next_1xx(); |
| 1769 | break; |
| 1770 | } |
| 1771 | case Instruction::USHR_INT_2ADDR: { |
| 1772 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1773 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1774 | shadow_frame.SetVReg(vregA, |
| 1775 | static_cast<uint32_t>(shadow_frame.GetVReg(vregA)) >> |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1776 | (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1777 | inst = inst->Next_1xx(); |
| 1778 | break; |
| 1779 | } |
| 1780 | case Instruction::AND_INT_2ADDR: { |
| 1781 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1782 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1783 | shadow_frame.SetVReg(vregA, |
| 1784 | shadow_frame.GetVReg(vregA) & |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1785 | shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1786 | inst = inst->Next_1xx(); |
| 1787 | break; |
| 1788 | } |
| 1789 | case Instruction::OR_INT_2ADDR: { |
| 1790 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1791 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1792 | shadow_frame.SetVReg(vregA, |
| 1793 | shadow_frame.GetVReg(vregA) | |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1794 | shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1795 | inst = inst->Next_1xx(); |
| 1796 | break; |
| 1797 | } |
| 1798 | case Instruction::XOR_INT_2ADDR: { |
| 1799 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1800 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1801 | shadow_frame.SetVReg(vregA, |
| 1802 | shadow_frame.GetVReg(vregA) ^ |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1803 | shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1804 | inst = inst->Next_1xx(); |
| 1805 | break; |
| 1806 | } |
| 1807 | case Instruction::ADD_LONG_2ADDR: { |
| 1808 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1809 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1810 | shadow_frame.SetVRegLong(vregA, |
| 1811 | shadow_frame.GetVRegLong(vregA) + |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1812 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1813 | inst = inst->Next_1xx(); |
| 1814 | break; |
| 1815 | } |
| 1816 | case Instruction::SUB_LONG_2ADDR: { |
| 1817 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1818 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1819 | shadow_frame.SetVRegLong(vregA, |
| 1820 | shadow_frame.GetVRegLong(vregA) - |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1821 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1822 | inst = inst->Next_1xx(); |
| 1823 | break; |
| 1824 | } |
| 1825 | case Instruction::MUL_LONG_2ADDR: { |
| 1826 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1827 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1828 | shadow_frame.SetVRegLong(vregA, |
| 1829 | shadow_frame.GetVRegLong(vregA) * |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1830 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1831 | inst = inst->Next_1xx(); |
| 1832 | break; |
| 1833 | } |
| 1834 | case Instruction::DIV_LONG_2ADDR: { |
| 1835 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1836 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1837 | DoLongDivide(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA), |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1838 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1839 | POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx); |
| 1840 | break; |
| 1841 | } |
| 1842 | case Instruction::REM_LONG_2ADDR: { |
| 1843 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1844 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1845 | DoLongRemainder(shadow_frame, vregA, 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 | POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), Next_1xx); |
| 1848 | break; |
| 1849 | } |
| 1850 | case Instruction::AND_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 | shadow_frame.SetVRegLong(vregA, |
| 1854 | shadow_frame.GetVRegLong(vregA) & |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1855 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1856 | inst = inst->Next_1xx(); |
| 1857 | break; |
| 1858 | } |
| 1859 | case Instruction::OR_LONG_2ADDR: { |
| 1860 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1861 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1862 | shadow_frame.SetVRegLong(vregA, |
| 1863 | shadow_frame.GetVRegLong(vregA) | |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1864 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1865 | inst = inst->Next_1xx(); |
| 1866 | break; |
| 1867 | } |
| 1868 | case Instruction::XOR_LONG_2ADDR: { |
| 1869 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1870 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1871 | shadow_frame.SetVRegLong(vregA, |
| 1872 | shadow_frame.GetVRegLong(vregA) ^ |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1873 | shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1874 | inst = inst->Next_1xx(); |
| 1875 | break; |
| 1876 | } |
| 1877 | case Instruction::SHL_LONG_2ADDR: { |
| 1878 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1879 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1880 | shadow_frame.SetVRegLong(vregA, |
| 1881 | shadow_frame.GetVRegLong(vregA) << |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1882 | (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1883 | inst = inst->Next_1xx(); |
| 1884 | break; |
| 1885 | } |
| 1886 | case Instruction::SHR_LONG_2ADDR: { |
| 1887 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1888 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1889 | shadow_frame.SetVRegLong(vregA, |
| 1890 | shadow_frame.GetVRegLong(vregA) >> |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1891 | (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1892 | inst = inst->Next_1xx(); |
| 1893 | break; |
| 1894 | } |
| 1895 | case Instruction::USHR_LONG_2ADDR: { |
| 1896 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1897 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1898 | shadow_frame.SetVRegLong(vregA, |
| 1899 | static_cast<uint64_t>(shadow_frame.GetVRegLong(vregA)) >> |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1900 | (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f)); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1901 | inst = inst->Next_1xx(); |
| 1902 | break; |
| 1903 | } |
| 1904 | case Instruction::ADD_FLOAT_2ADDR: { |
| 1905 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1906 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1907 | shadow_frame.SetVRegFloat(vregA, |
| 1908 | shadow_frame.GetVRegFloat(vregA) + |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1909 | shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1910 | inst = inst->Next_1xx(); |
| 1911 | break; |
| 1912 | } |
| 1913 | case Instruction::SUB_FLOAT_2ADDR: { |
| 1914 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1915 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1916 | shadow_frame.SetVRegFloat(vregA, |
| 1917 | shadow_frame.GetVRegFloat(vregA) - |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1918 | shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1919 | inst = inst->Next_1xx(); |
| 1920 | break; |
| 1921 | } |
| 1922 | case Instruction::MUL_FLOAT_2ADDR: { |
| 1923 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1924 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1925 | shadow_frame.SetVRegFloat(vregA, |
| 1926 | shadow_frame.GetVRegFloat(vregA) * |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1927 | shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1928 | inst = inst->Next_1xx(); |
| 1929 | break; |
| 1930 | } |
| 1931 | case Instruction::DIV_FLOAT_2ADDR: { |
| 1932 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1933 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1934 | shadow_frame.SetVRegFloat(vregA, |
| 1935 | shadow_frame.GetVRegFloat(vregA) / |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1936 | shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1937 | inst = inst->Next_1xx(); |
| 1938 | break; |
| 1939 | } |
| 1940 | case Instruction::REM_FLOAT_2ADDR: { |
| 1941 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1942 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1943 | shadow_frame.SetVRegFloat(vregA, |
| 1944 | fmodf(shadow_frame.GetVRegFloat(vregA), |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1945 | shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1946 | inst = inst->Next_1xx(); |
| 1947 | break; |
| 1948 | } |
| 1949 | case Instruction::ADD_DOUBLE_2ADDR: { |
| 1950 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1951 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1952 | shadow_frame.SetVRegDouble(vregA, |
| 1953 | shadow_frame.GetVRegDouble(vregA) + |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1954 | shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1955 | inst = inst->Next_1xx(); |
| 1956 | break; |
| 1957 | } |
| 1958 | case Instruction::SUB_DOUBLE_2ADDR: { |
| 1959 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1960 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1961 | shadow_frame.SetVRegDouble(vregA, |
| 1962 | shadow_frame.GetVRegDouble(vregA) - |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1963 | shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1964 | inst = inst->Next_1xx(); |
| 1965 | break; |
| 1966 | } |
| 1967 | case Instruction::MUL_DOUBLE_2ADDR: { |
| 1968 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1969 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1970 | shadow_frame.SetVRegDouble(vregA, |
| 1971 | shadow_frame.GetVRegDouble(vregA) * |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1972 | shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1973 | inst = inst->Next_1xx(); |
| 1974 | break; |
| 1975 | } |
| 1976 | case Instruction::DIV_DOUBLE_2ADDR: { |
| 1977 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1978 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1979 | shadow_frame.SetVRegDouble(vregA, |
| 1980 | shadow_frame.GetVRegDouble(vregA) / |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1981 | shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1982 | inst = inst->Next_1xx(); |
| 1983 | break; |
| 1984 | } |
| 1985 | case Instruction::REM_DOUBLE_2ADDR: { |
| 1986 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1987 | uint4_t vregA = inst->VRegA_12x(inst_data); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1988 | shadow_frame.SetVRegDouble(vregA, |
| 1989 | fmod(shadow_frame.GetVRegDouble(vregA), |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1990 | shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1991 | inst = inst->Next_1xx(); |
| 1992 | break; |
| 1993 | } |
| 1994 | case Instruction::ADD_INT_LIT16: |
| 1995 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 1996 | shadow_frame.SetVReg(inst->VRegA_22s(inst_data), |
| 1997 | shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) + |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 1998 | inst->VRegC_22s()); |
| 1999 | inst = inst->Next_2xx(); |
| 2000 | break; |
| 2001 | case Instruction::RSUB_INT: |
| 2002 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2003 | shadow_frame.SetVReg(inst->VRegA_22s(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2004 | inst->VRegC_22s() - |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2005 | shadow_frame.GetVReg(inst->VRegB_22s(inst_data))); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2006 | inst = inst->Next_2xx(); |
| 2007 | break; |
| 2008 | case Instruction::MUL_INT_LIT16: |
| 2009 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2010 | shadow_frame.SetVReg(inst->VRegA_22s(inst_data), |
| 2011 | shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) * |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2012 | inst->VRegC_22s()); |
| 2013 | inst = inst->Next_2xx(); |
| 2014 | break; |
| 2015 | case Instruction::DIV_INT_LIT16: { |
| 2016 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2017 | bool success = DoIntDivide(shadow_frame, inst->VRegA_22s(inst_data), |
| 2018 | shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), inst->VRegC_22s()); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2019 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 2020 | break; |
| 2021 | } |
| 2022 | case Instruction::REM_INT_LIT16: { |
| 2023 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2024 | bool success = DoIntRemainder(shadow_frame, inst->VRegA_22s(inst_data), |
| 2025 | shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), inst->VRegC_22s()); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2026 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 2027 | break; |
| 2028 | } |
| 2029 | case Instruction::AND_INT_LIT16: |
| 2030 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2031 | shadow_frame.SetVReg(inst->VRegA_22s(inst_data), |
| 2032 | shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) & |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2033 | inst->VRegC_22s()); |
| 2034 | inst = inst->Next_2xx(); |
| 2035 | break; |
| 2036 | case Instruction::OR_INT_LIT16: |
| 2037 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2038 | shadow_frame.SetVReg(inst->VRegA_22s(inst_data), |
| 2039 | shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) | |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2040 | inst->VRegC_22s()); |
| 2041 | inst = inst->Next_2xx(); |
| 2042 | break; |
| 2043 | case Instruction::XOR_INT_LIT16: |
| 2044 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2045 | shadow_frame.SetVReg(inst->VRegA_22s(inst_data), |
| 2046 | shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) ^ |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2047 | inst->VRegC_22s()); |
| 2048 | inst = inst->Next_2xx(); |
| 2049 | break; |
| 2050 | case Instruction::ADD_INT_LIT8: |
| 2051 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2052 | shadow_frame.SetVReg(inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2053 | shadow_frame.GetVReg(inst->VRegB_22b()) + |
| 2054 | inst->VRegC_22b()); |
| 2055 | inst = inst->Next_2xx(); |
| 2056 | break; |
| 2057 | case Instruction::RSUB_INT_LIT8: |
| 2058 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2059 | shadow_frame.SetVReg(inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2060 | inst->VRegC_22b() - |
| 2061 | shadow_frame.GetVReg(inst->VRegB_22b())); |
| 2062 | inst = inst->Next_2xx(); |
| 2063 | break; |
| 2064 | case Instruction::MUL_INT_LIT8: |
| 2065 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2066 | shadow_frame.SetVReg(inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2067 | shadow_frame.GetVReg(inst->VRegB_22b()) * |
| 2068 | inst->VRegC_22b()); |
| 2069 | inst = inst->Next_2xx(); |
| 2070 | break; |
| 2071 | case Instruction::DIV_INT_LIT8: { |
| 2072 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2073 | bool success = DoIntDivide(shadow_frame, inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2074 | shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b()); |
| 2075 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 2076 | break; |
| 2077 | } |
| 2078 | case Instruction::REM_INT_LIT8: { |
| 2079 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2080 | bool success = DoIntRemainder(shadow_frame, inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2081 | shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b()); |
| 2082 | POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); |
| 2083 | break; |
| 2084 | } |
| 2085 | case Instruction::AND_INT_LIT8: |
| 2086 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2087 | shadow_frame.SetVReg(inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2088 | shadow_frame.GetVReg(inst->VRegB_22b()) & |
| 2089 | inst->VRegC_22b()); |
| 2090 | inst = inst->Next_2xx(); |
| 2091 | break; |
| 2092 | case Instruction::OR_INT_LIT8: |
| 2093 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2094 | shadow_frame.SetVReg(inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2095 | shadow_frame.GetVReg(inst->VRegB_22b()) | |
| 2096 | inst->VRegC_22b()); |
| 2097 | inst = inst->Next_2xx(); |
| 2098 | break; |
| 2099 | case Instruction::XOR_INT_LIT8: |
| 2100 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2101 | shadow_frame.SetVReg(inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2102 | shadow_frame.GetVReg(inst->VRegB_22b()) ^ |
| 2103 | inst->VRegC_22b()); |
| 2104 | inst = inst->Next_2xx(); |
| 2105 | break; |
| 2106 | case Instruction::SHL_INT_LIT8: |
| 2107 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2108 | shadow_frame.SetVReg(inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2109 | shadow_frame.GetVReg(inst->VRegB_22b()) << |
| 2110 | (inst->VRegC_22b() & 0x1f)); |
| 2111 | inst = inst->Next_2xx(); |
| 2112 | break; |
| 2113 | case Instruction::SHR_INT_LIT8: |
| 2114 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2115 | shadow_frame.SetVReg(inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2116 | shadow_frame.GetVReg(inst->VRegB_22b()) >> |
| 2117 | (inst->VRegC_22b() & 0x1f)); |
| 2118 | inst = inst->Next_2xx(); |
| 2119 | break; |
| 2120 | case Instruction::USHR_INT_LIT8: |
| 2121 | PREAMBLE(); |
Sebastien Hertz | 3b588e0 | 2013-09-11 14:33:18 +0200 | [diff] [blame] | 2122 | shadow_frame.SetVReg(inst->VRegA_22b(inst_data), |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2123 | static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_22b())) >> |
| 2124 | (inst->VRegC_22b() & 0x1f)); |
| 2125 | inst = inst->Next_2xx(); |
| 2126 | break; |
| 2127 | case Instruction::UNUSED_3E ... Instruction::UNUSED_43: |
| 2128 | case Instruction::UNUSED_EB ... Instruction::UNUSED_FF: |
| 2129 | case Instruction::UNUSED_79: |
| 2130 | case Instruction::UNUSED_7A: |
| 2131 | UnexpectedOpcode(inst, mh); |
| 2132 | } |
| 2133 | } |
| 2134 | } // NOLINT(readability/fn_size) |
| 2135 | |
| 2136 | // Explicit definitions of ExecuteSwitchImpl. |
Sebastien Hertz | c671485 | 2013-09-30 16:42:32 +0200 | [diff] [blame] | 2137 | template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) HOT_ATTR |
| 2138 | JValue ExecuteSwitchImpl<true>(Thread* self, MethodHelper& mh, |
| 2139 | const DexFile::CodeItem* code_item, |
| 2140 | ShadowFrame& shadow_frame, JValue result_register); |
| 2141 | template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) HOT_ATTR |
| 2142 | JValue ExecuteSwitchImpl<false>(Thread* self, MethodHelper& mh, |
| 2143 | const DexFile::CodeItem* code_item, |
| 2144 | ShadowFrame& shadow_frame, JValue result_register); |
Sebastien Hertz | 8ece050 | 2013-08-07 11:26:41 +0200 | [diff] [blame] | 2145 | |
| 2146 | } // namespace interpreter |
| 2147 | } // namespace art |