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