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