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