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