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