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