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