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