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