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