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