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