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