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