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