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