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