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