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