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