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