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