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