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