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