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