blob: c95af6f0f1314d9335385328d1bde9462e18b6f7 [file] [log] [blame]
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Colin Crosse84e4f72015-03-18 14:01:19 -070017#if !defined(__clang__)
18// Clang 3.4 fails to build the goto interpreter implementation.
19
Igor Murashkin6918bf12015-09-27 19:19:06 -070020
21#include "base/stl_util.h" // MakeUnique
Alex Lighteb7c1442015-08-31 13:17:42 -070022#include "experimental_flags.h"
Sebastien Hertz8ece0502013-08-07 11:26:41 +020023#include "interpreter_common.h"
Nicolas Geoffrayb331feb2016-02-05 16:51:53 +000024#include "jit/jit.h"
Ian Rogersf72a11d2014-10-30 15:41:08 -070025#include "safe_math.h"
Sebastien Hertz8ece0502013-08-07 11:26:41 +020026
Igor Murashkin6918bf12015-09-27 19:19:06 -070027#include <memory> // std::unique_ptr
28
Sebastien Hertz8ece0502013-08-07 11:26:41 +020029namespace art {
30namespace interpreter {
31
32// In the following macros, we expect the following local variables exist:
33// - "self": the current Thread*.
34// - "inst" : the current Instruction*.
Sebastien Hertz3b588e02013-09-11 14:33:18 +020035// - "inst_data" : the current instruction's first 16 bits.
Sebastien Hertz8ece0502013-08-07 11:26:41 +020036// - "dex_pc": the current pc.
37// - "shadow_frame": the current shadow frame.
Sebastien Hertz8ece0502013-08-07 11:26:41 +020038// - "currentHandlersTable": the current table of pointer to each instruction handler.
39
40// Advance to the next instruction and updates interpreter state.
Sebastien Hertz8ece0502013-08-07 11:26:41 +020041#define ADVANCE(_offset) \
42 do { \
43 int32_t disp = static_cast<int32_t>(_offset); \
44 inst = inst->RelativeAt(disp); \
45 dex_pc = static_cast<uint32_t>(static_cast<int32_t>(dex_pc) + disp); \
46 shadow_frame.SetDexPC(dex_pc); \
Ian Rogerse94652f2014-12-02 11:13:19 -080047 TraceExecution(shadow_frame, inst, dex_pc); \
Sebastien Hertz3b588e02013-09-11 14:33:18 +020048 inst_data = inst->Fetch16(0); \
49 goto *currentHandlersTable[inst->Opcode(inst_data)]; \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020050 } while (false)
51
52#define HANDLE_PENDING_EXCEPTION() goto exception_pending_label
53
54#define POSSIBLY_HANDLE_PENDING_EXCEPTION(_is_exception_pending, _offset) \
55 do { \
56 if (UNLIKELY(_is_exception_pending)) { \
57 HANDLE_PENDING_EXCEPTION(); \
58 } else { \
59 ADVANCE(_offset); \
60 } \
61 } while (false)
62
Sebastien Hertzee1997a2013-09-19 14:47:09 +020063#define UPDATE_HANDLER_TABLE() \
Mathieu Chartier2cebb242015-04-21 16:50:40 -070064 currentHandlersTable = handlersTable[ \
65 Runtime::Current()->GetInstrumentation()->GetInterpreterHandlerTable()]
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +020066
Bill Buzbee1d011d92016-04-04 16:59:29 +000067#define BRANCH_INSTRUMENTATION(offset) \
68 do { \
Nicolas Geoffray274fe4a2016-04-12 16:33:24 +010069 if (UNLIKELY(instrumentation->HasBranchListeners())) { \
70 instrumentation->Branch(self, method, dex_pc, offset); \
71 } \
Bill Buzbee1d011d92016-04-04 16:59:29 +000072 JValue result; \
73 if (jit::Jit::MaybeDoOnStackReplacement(self, method, dex_pc, offset, &result)) { \
74 return result; \
75 } \
76 } while (false)
77
78#define HOTNESS_UPDATE() \
79 do { \
Nicolas Geoffray274fe4a2016-04-12 16:33:24 +010080 if (jit != nullptr) { \
81 jit->AddSamples(self, method, 1); \
Bill Buzbee1d011d92016-04-04 16:59:29 +000082 } \
Mathieu Chartiere5f13e52015-02-24 09:37:21 -080083 } while (false)
84
Sebastien Hertz8ece0502013-08-07 11:26:41 +020085#define UNREACHABLE_CODE_CHECK() \
86 do { \
87 if (kIsDebugBuild) { \
88 LOG(FATAL) << "We should not be here !"; \
Ian Rogerse94652f2014-12-02 11:13:19 -080089 UNREACHABLE(); \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020090 } \
91 } while (false)
92
93#define HANDLE_INSTRUCTION_START(opcode) op_##opcode: // NOLINT(whitespace/labels)
94#define HANDLE_INSTRUCTION_END() UNREACHABLE_CODE_CHECK()
95
Igor Murashkin158f35c2015-06-10 15:55:30 -070096// Use with instructions labeled with kExperimental flag:
97#define HANDLE_EXPERIMENTAL_INSTRUCTION_START(opcode) \
98 HANDLE_INSTRUCTION_START(opcode); \
99 DCHECK(inst->IsExperimental()); \
Alex Lighteb7c1442015-08-31 13:17:42 -0700100 if (Runtime::Current()->AreExperimentalFlagsEnabled(ExperimentalFlags::kLambdas)) {
Igor Murashkin158f35c2015-06-10 15:55:30 -0700101#define HANDLE_EXPERIMENTAL_INSTRUCTION_END() \
102 } else { \
103 UnexpectedOpcode(inst, shadow_frame); \
104 } HANDLE_INSTRUCTION_END();
105
Andreas Gampe03ec9302015-08-27 17:41:47 -0700106#define HANDLE_MONITOR_CHECKS() \
107 if (!shadow_frame.GetLockCountData(). \
108 CheckAllMonitorsReleasedOrThrow<do_assignability_check>(self)) { \
109 HANDLE_PENDING_EXCEPTION(); \
110 }
Igor Murashkin158f35c2015-06-10 15:55:30 -0700111
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200112/**
113 * Interpreter based on computed goto tables.
114 *
115 * Each instruction is associated to a handler. This handler is responsible for executing the
116 * instruction and jump to the next instruction's handler.
117 * In order to limit the cost of instrumentation, we have two handler tables:
118 * - the "main" handler table: it contains handlers for normal execution of each instruction without
119 * handling of instrumentation.
120 * - the "alternative" handler table: it contains alternative handlers which first handle
121 * instrumentation before jumping to the corresponding "normal" instruction's handler.
122 *
123 * When instrumentation is active, the interpreter uses the "alternative" handler table. Otherwise
124 * it uses the "main" handler table.
125 *
126 * The current handler table is the handler table being used by the interpreter. It is updated:
127 * - on backward branch (goto, if and switch instructions)
128 * - after invoke
129 * - when an exception is thrown.
130 * This allows to support an attaching debugger to an already running application for instance.
131 *
132 * For a fast handler table update, handler tables are stored in an array of handler tables. Each
133 * handler table is represented by the InterpreterHandlerTable enum which allows to associate it
134 * to an index in this array of handler tables ((see Instrumentation::GetInterpreterHandlerTable).
135 *
136 * Here's the current layout of this array of handler tables:
137 *
138 * ---------------------+---------------+
139 * | NOP | (handler for NOP instruction)
140 * +---------------+
141 * "main" | MOVE | (handler for MOVE instruction)
142 * handler table +---------------+
143 * | ... |
144 * +---------------+
145 * | UNUSED_FF | (handler for UNUSED_FF instruction)
146 * ---------------------+---------------+
147 * | NOP | (alternative handler for NOP instruction)
148 * +---------------+
149 * "alternative" | MOVE | (alternative handler for MOVE instruction)
150 * handler table +---------------+
151 * | ... |
152 * +---------------+
153 * | UNUSED_FF | (alternative handler for UNUSED_FF instruction)
154 * ---------------------+---------------+
155 *
156 */
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100157template<bool do_access_check, bool transaction_active>
Ian Rogerse94652f2014-12-02 11:13:19 -0800158JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowFrame& shadow_frame,
159 JValue result_register) {
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200160 // Define handler tables:
161 // - The main handler table contains execution handlers for each instruction.
162 // - The alternative handler table contains prelude handlers which check for thread suspend and
163 // manage instrumentation before jumping to the execution handler.
164 static const void* const handlersTable[instrumentation::kNumHandlerTables][kNumPackedOpcodes] = {
165 {
166 // Main handler table.
167#define INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) &&op_##code,
168#include "dex_instruction_list.h"
169 DEX_INSTRUCTION_LIST(INSTRUCTION_HANDLER)
170#undef DEX_INSTRUCTION_LIST
171#undef INSTRUCTION_HANDLER
172 }, {
173 // Alternative handler table.
174#define INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) &&alt_op_##code,
175#include "dex_instruction_list.h"
176 DEX_INSTRUCTION_LIST(INSTRUCTION_HANDLER)
177#undef DEX_INSTRUCTION_LIST
178#undef INSTRUCTION_HANDLER
179 }
180 };
181
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800182 constexpr bool do_assignability_check = do_access_check;
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200183 if (UNLIKELY(!shadow_frame.HasReferenceArray())) {
184 LOG(FATAL) << "Invalid shadow frame for interpreter use";
185 return JValue();
186 }
187 self->VerifyStack();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200188
189 uint32_t dex_pc = shadow_frame.GetDexPC();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200190 const Instruction* inst = Instruction::At(code_item->insns_ + dex_pc);
191 uint16_t inst_data;
192 const void* const* currentHandlersTable;
193 UPDATE_HANDLER_TABLE();
Igor Murashkin6918bf12015-09-27 19:19:06 -0700194 std::unique_ptr<lambda::ClosureBuilder> lambda_closure_builder;
195 size_t lambda_captured_variable_index = 0;
Bill Buzbee1d011d92016-04-04 16:59:29 +0000196 const auto* const instrumentation = Runtime::Current()->GetInstrumentation();
197 ArtMethod* method = shadow_frame.GetMethod();
198 jit::Jit* jit = Runtime::Current()->GetJit();
Igor Murashkin6918bf12015-09-27 19:19:06 -0700199
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200200 // Jump to first instruction.
201 ADVANCE(0);
202 UNREACHABLE_CODE_CHECK();
203
204 HANDLE_INSTRUCTION_START(NOP)
205 ADVANCE(1);
206 HANDLE_INSTRUCTION_END();
207
208 HANDLE_INSTRUCTION_START(MOVE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200209 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
210 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200211 ADVANCE(1);
212 HANDLE_INSTRUCTION_END();
213
214 HANDLE_INSTRUCTION_START(MOVE_FROM16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200215 shadow_frame.SetVReg(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200216 shadow_frame.GetVReg(inst->VRegB_22x()));
217 ADVANCE(2);
218 HANDLE_INSTRUCTION_END();
219
220 HANDLE_INSTRUCTION_START(MOVE_16)
221 shadow_frame.SetVReg(inst->VRegA_32x(),
222 shadow_frame.GetVReg(inst->VRegB_32x()));
223 ADVANCE(3);
224 HANDLE_INSTRUCTION_END();
225
226 HANDLE_INSTRUCTION_START(MOVE_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200227 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data),
228 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200229 ADVANCE(1);
230 HANDLE_INSTRUCTION_END();
231
232 HANDLE_INSTRUCTION_START(MOVE_WIDE_FROM16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200233 shadow_frame.SetVRegLong(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200234 shadow_frame.GetVRegLong(inst->VRegB_22x()));
235 ADVANCE(2);
236 HANDLE_INSTRUCTION_END();
237
238 HANDLE_INSTRUCTION_START(MOVE_WIDE_16)
239 shadow_frame.SetVRegLong(inst->VRegA_32x(),
240 shadow_frame.GetVRegLong(inst->VRegB_32x()));
241 ADVANCE(3);
242 HANDLE_INSTRUCTION_END();
243
244 HANDLE_INSTRUCTION_START(MOVE_OBJECT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200245 shadow_frame.SetVRegReference(inst->VRegA_12x(inst_data),
246 shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200247 ADVANCE(1);
248 HANDLE_INSTRUCTION_END();
249
250 HANDLE_INSTRUCTION_START(MOVE_OBJECT_FROM16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200251 shadow_frame.SetVRegReference(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200252 shadow_frame.GetVRegReference(inst->VRegB_22x()));
253 ADVANCE(2);
254 HANDLE_INSTRUCTION_END();
255
256 HANDLE_INSTRUCTION_START(MOVE_OBJECT_16)
257 shadow_frame.SetVRegReference(inst->VRegA_32x(),
258 shadow_frame.GetVRegReference(inst->VRegB_32x()));
259 ADVANCE(3);
260 HANDLE_INSTRUCTION_END();
261
262 HANDLE_INSTRUCTION_START(MOVE_RESULT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200263 shadow_frame.SetVReg(inst->VRegA_11x(inst_data), result_register.GetI());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200264 ADVANCE(1);
265 HANDLE_INSTRUCTION_END();
266
267 HANDLE_INSTRUCTION_START(MOVE_RESULT_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200268 shadow_frame.SetVRegLong(inst->VRegA_11x(inst_data), result_register.GetJ());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200269 ADVANCE(1);
270 HANDLE_INSTRUCTION_END();
271
272 HANDLE_INSTRUCTION_START(MOVE_RESULT_OBJECT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200273 shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), result_register.GetL());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200274 ADVANCE(1);
275 HANDLE_INSTRUCTION_END();
276
277 HANDLE_INSTRUCTION_START(MOVE_EXCEPTION) {
Nicolas Geoffray14691c52015-03-05 10:40:17 +0000278 Throwable* exception = self->GetException();
Sebastien Hertz270a0e12015-01-16 19:49:09 +0100279 DCHECK(exception != nullptr) << "No pending exception on MOVE_EXCEPTION instruction";
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200280 shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), exception);
Sebastien Hertz5c004902014-05-21 10:07:42 +0200281 self->ClearException();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200282 ADVANCE(1);
283 }
284 HANDLE_INSTRUCTION_END();
285
Mathieu Chartierd7cbf8a2015-03-19 12:43:20 -0700286 HANDLE_INSTRUCTION_START(RETURN_VOID_NO_BARRIER) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200287 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700288 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700289 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200290 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200291 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200292 shadow_frame.GetMethod(), dex_pc,
293 result);
294 }
295 return result;
296 }
297 HANDLE_INSTRUCTION_END();
298
Mathieu Chartierd7cbf8a2015-03-19 12:43:20 -0700299 HANDLE_INSTRUCTION_START(RETURN_VOID) {
Hans Boehm30359612014-05-21 17:46:23 -0700300 QuasiAtomic::ThreadFenceForConstructor();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200301 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700302 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700303 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200304 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200305 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200306 shadow_frame.GetMethod(), dex_pc,
307 result);
308 }
309 return result;
310 }
311 HANDLE_INSTRUCTION_END();
312
313 HANDLE_INSTRUCTION_START(RETURN) {
314 JValue result;
315 result.SetJ(0);
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200316 result.SetI(shadow_frame.GetVReg(inst->VRegA_11x(inst_data)));
Ian Rogers7b078e82014-09-10 14:44:24 -0700317 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700318 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200319 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200320 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200321 shadow_frame.GetMethod(), dex_pc,
322 result);
323 }
324 return result;
325 }
326 HANDLE_INSTRUCTION_END();
327
328 HANDLE_INSTRUCTION_START(RETURN_WIDE) {
329 JValue result;
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200330 result.SetJ(shadow_frame.GetVRegLong(inst->VRegA_11x(inst_data)));
Ian Rogers7b078e82014-09-10 14:44:24 -0700331 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700332 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200333 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200334 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200335 shadow_frame.GetMethod(), dex_pc,
336 result);
337 }
338 return result;
339 }
340 HANDLE_INSTRUCTION_END();
341
342 HANDLE_INSTRUCTION_START(RETURN_OBJECT) {
343 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700344 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700345 HANDLE_MONITOR_CHECKS();
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700346 const uint8_t vreg_index = inst->VRegA_11x(inst_data);
347 Object* obj_result = shadow_frame.GetVRegReference(vreg_index);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700348 if (do_assignability_check && obj_result != nullptr) {
Vladimir Marko05792b92015-08-03 11:56:49 +0100349 size_t pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
350 Class* return_type = shadow_frame.GetMethod()->GetReturnType(true /* resolve */,
351 pointer_size);
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700352 obj_result = shadow_frame.GetVRegReference(vreg_index);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700353 if (return_type == nullptr) {
Jeff Haoa3faaf42013-09-03 19:07:00 -0700354 // Return the pending exception.
355 HANDLE_PENDING_EXCEPTION();
356 }
357 if (!obj_result->VerifierInstanceOf(return_type)) {
358 // This should never happen.
Ian Rogers1ff3c982014-08-12 02:30:58 -0700359 std::string temp1, temp2;
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000360 self->ThrowNewExceptionF("Ljava/lang/VirtualMachineError;",
Jeff Haoa3faaf42013-09-03 19:07:00 -0700361 "Returning '%s' that is not instance of return type '%s'",
Ian Rogers1ff3c982014-08-12 02:30:58 -0700362 obj_result->GetClass()->GetDescriptor(&temp1),
363 return_type->GetDescriptor(&temp2));
Jeff Haoa3faaf42013-09-03 19:07:00 -0700364 HANDLE_PENDING_EXCEPTION();
365 }
366 }
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700367 result.SetL(obj_result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200368 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200369 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200370 shadow_frame.GetMethod(), dex_pc,
371 result);
372 }
373 return result;
374 }
375 HANDLE_INSTRUCTION_END();
376
377 HANDLE_INSTRUCTION_START(CONST_4) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200378 uint32_t dst = inst->VRegA_11n(inst_data);
379 int32_t val = inst->VRegB_11n(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200380 shadow_frame.SetVReg(dst, val);
381 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700382 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200383 }
384 ADVANCE(1);
385 }
386 HANDLE_INSTRUCTION_END();
387
388 HANDLE_INSTRUCTION_START(CONST_16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200389 uint32_t dst = inst->VRegA_21s(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200390 int32_t val = inst->VRegB_21s();
391 shadow_frame.SetVReg(dst, val);
392 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700393 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200394 }
395 ADVANCE(2);
396 }
397 HANDLE_INSTRUCTION_END();
398
399 HANDLE_INSTRUCTION_START(CONST) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200400 uint32_t dst = inst->VRegA_31i(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200401 int32_t val = inst->VRegB_31i();
402 shadow_frame.SetVReg(dst, val);
403 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700404 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200405 }
406 ADVANCE(3);
407 }
408 HANDLE_INSTRUCTION_END();
409
410 HANDLE_INSTRUCTION_START(CONST_HIGH16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200411 uint32_t dst = inst->VRegA_21h(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200412 int32_t val = static_cast<int32_t>(inst->VRegB_21h() << 16);
413 shadow_frame.SetVReg(dst, val);
414 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700415 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200416 }
417 ADVANCE(2);
418 }
419 HANDLE_INSTRUCTION_END();
420
421 HANDLE_INSTRUCTION_START(CONST_WIDE_16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200422 shadow_frame.SetVRegLong(inst->VRegA_21s(inst_data), inst->VRegB_21s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200423 ADVANCE(2);
424 HANDLE_INSTRUCTION_END();
425
426 HANDLE_INSTRUCTION_START(CONST_WIDE_32)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200427 shadow_frame.SetVRegLong(inst->VRegA_31i(inst_data), inst->VRegB_31i());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200428 ADVANCE(3);
429 HANDLE_INSTRUCTION_END();
430
431 HANDLE_INSTRUCTION_START(CONST_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200432 shadow_frame.SetVRegLong(inst->VRegA_51l(inst_data), inst->VRegB_51l());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200433 ADVANCE(5);
434 HANDLE_INSTRUCTION_END();
435
436 HANDLE_INSTRUCTION_START(CONST_WIDE_HIGH16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200437 shadow_frame.SetVRegLong(inst->VRegA_21h(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200438 static_cast<uint64_t>(inst->VRegB_21h()) << 48);
439 ADVANCE(2);
440 HANDLE_INSTRUCTION_END();
441
442 HANDLE_INSTRUCTION_START(CONST_STRING) {
Ian Rogers6786a582014-10-28 12:49:06 -0700443 String* s = ResolveString(self, shadow_frame, inst->VRegB_21c());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700444 if (UNLIKELY(s == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200445 HANDLE_PENDING_EXCEPTION();
446 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200447 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200448 ADVANCE(2);
449 }
450 }
451 HANDLE_INSTRUCTION_END();
452
453 HANDLE_INSTRUCTION_START(CONST_STRING_JUMBO) {
Ian Rogers6786a582014-10-28 12:49:06 -0700454 String* s = ResolveString(self, shadow_frame, inst->VRegB_31c());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700455 if (UNLIKELY(s == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200456 HANDLE_PENDING_EXCEPTION();
457 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200458 shadow_frame.SetVRegReference(inst->VRegA_31c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200459 ADVANCE(3);
460 }
461 }
462 HANDLE_INSTRUCTION_END();
463
464 HANDLE_INSTRUCTION_START(CONST_CLASS) {
465 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
466 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700467 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200468 HANDLE_PENDING_EXCEPTION();
469 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200470 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), c);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200471 ADVANCE(2);
472 }
473 }
474 HANDLE_INSTRUCTION_END();
475
476 HANDLE_INSTRUCTION_START(MONITOR_ENTER) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200477 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700478 if (UNLIKELY(obj == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000479 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200480 HANDLE_PENDING_EXCEPTION();
481 } else {
Andreas Gampe03ec9302015-08-27 17:41:47 -0700482 DoMonitorEnter<do_access_check>(self, &shadow_frame, obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200483 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), 1);
484 }
485 }
486 HANDLE_INSTRUCTION_END();
487
488 HANDLE_INSTRUCTION_START(MONITOR_EXIT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200489 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700490 if (UNLIKELY(obj == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000491 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200492 HANDLE_PENDING_EXCEPTION();
493 } else {
Andreas Gampe03ec9302015-08-27 17:41:47 -0700494 DoMonitorExit<do_access_check>(self, &shadow_frame, obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200495 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), 1);
496 }
497 }
498 HANDLE_INSTRUCTION_END();
499
500 HANDLE_INSTRUCTION_START(CHECK_CAST) {
501 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
502 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700503 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200504 HANDLE_PENDING_EXCEPTION();
505 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200506 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_21c(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700507 if (UNLIKELY(obj != nullptr && !obj->InstanceOf(c))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200508 ThrowClassCastException(c, obj->GetClass());
509 HANDLE_PENDING_EXCEPTION();
510 } else {
511 ADVANCE(2);
512 }
513 }
514 }
515 HANDLE_INSTRUCTION_END();
516
517 HANDLE_INSTRUCTION_START(INSTANCE_OF) {
518 Class* c = ResolveVerifyAndClinit(inst->VRegC_22c(), shadow_frame.GetMethod(),
519 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700520 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200521 HANDLE_PENDING_EXCEPTION();
522 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200523 Object* obj = shadow_frame.GetVRegReference(inst->VRegB_22c(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700524 shadow_frame.SetVReg(inst->VRegA_22c(inst_data), (obj != nullptr && obj->InstanceOf(c)) ? 1 : 0);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200525 ADVANCE(2);
526 }
527 }
528 HANDLE_INSTRUCTION_END();
529
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700530 HANDLE_INSTRUCTION_START(ARRAY_LENGTH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200531 Object* array = shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700532 if (UNLIKELY(array == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000533 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200534 HANDLE_PENDING_EXCEPTION();
535 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200536 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), array->AsArray()->GetLength());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200537 ADVANCE(1);
538 }
539 }
540 HANDLE_INSTRUCTION_END();
541
542 HANDLE_INSTRUCTION_START(NEW_INSTANCE) {
Jeff Hao848f70a2014-01-15 13:49:50 -0800543 Object* obj = nullptr;
544 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
545 self, false, do_access_check);
546 if (LIKELY(c != nullptr)) {
547 if (UNLIKELY(c->IsStringClass())) {
548 gc::AllocatorType allocator_type = Runtime::Current()->GetHeap()->GetCurrentAllocator();
549 mirror::SetStringCountVisitor visitor(0);
550 obj = String::Alloc<true>(self, 0, allocator_type, visitor);
551 } else {
552 obj = AllocObjectFromCode<do_access_check, true>(
553 inst->VRegB_21c(), shadow_frame.GetMethod(), self,
554 Runtime::Current()->GetHeap()->GetCurrentAllocator());
555 }
556 }
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700557 if (UNLIKELY(obj == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200558 HANDLE_PENDING_EXCEPTION();
559 } else {
Sebastien Hertz4e99b3d2014-06-24 14:35:40 +0200560 obj->GetClass()->AssertInitializedOrInitializingInThread(self);
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700561 // Don't allow finalizable objects to be allocated during a transaction since these can't be
562 // finalized without a started runtime.
563 if (transaction_active && obj->GetClass()->IsFinalizable()) {
Sebastien Hertz45b15972015-04-03 16:07:05 +0200564 AbortTransactionF(self, "Allocating finalizable object in transaction: %s",
565 PrettyTypeOf(obj).c_str());
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700566 HANDLE_PENDING_EXCEPTION();
567 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200568 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200569 ADVANCE(2);
570 }
571 }
572 HANDLE_INSTRUCTION_END();
573
574 HANDLE_INSTRUCTION_START(NEW_ARRAY) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200575 int32_t length = shadow_frame.GetVReg(inst->VRegB_22c(inst_data));
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800576 Object* obj = AllocArrayFromCode<do_access_check, true>(
Andreas Gampe1cc7dba2014-12-17 18:43:01 -0800577 inst->VRegC_22c(), length, shadow_frame.GetMethod(), self,
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800578 Runtime::Current()->GetHeap()->GetCurrentAllocator());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700579 if (UNLIKELY(obj == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200580 HANDLE_PENDING_EXCEPTION();
581 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200582 shadow_frame.SetVRegReference(inst->VRegA_22c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200583 ADVANCE(2);
584 }
585 }
586 HANDLE_INSTRUCTION_END();
587
588 HANDLE_INSTRUCTION_START(FILLED_NEW_ARRAY) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100589 bool success =
590 DoFilledNewArray<false, do_access_check, transaction_active>(inst, shadow_frame,
591 self, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200592 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
593 }
594 HANDLE_INSTRUCTION_END();
595
596 HANDLE_INSTRUCTION_START(FILLED_NEW_ARRAY_RANGE) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100597 bool success =
598 DoFilledNewArray<true, do_access_check, transaction_active>(inst, shadow_frame,
599 self, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200600 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
601 }
602 HANDLE_INSTRUCTION_END();
603
604 HANDLE_INSTRUCTION_START(FILL_ARRAY_DATA) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200605 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_31t(inst_data));
Ian Rogers832336b2014-10-08 15:35:22 -0700606 const uint16_t* payload_addr = reinterpret_cast<const uint16_t*>(inst) + inst->VRegB_31t();
607 const Instruction::ArrayDataPayload* payload =
608 reinterpret_cast<const Instruction::ArrayDataPayload*>(payload_addr);
609 bool success = FillArrayData(obj, payload);
610 if (transaction_active && success) {
611 RecordArrayElementsInTransaction(obj->AsArray(), payload->element_count);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200612 }
Ian Rogers832336b2014-10-08 15:35:22 -0700613 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200614 }
615 HANDLE_INSTRUCTION_END();
616
617 HANDLE_INSTRUCTION_START(THROW) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200618 Object* exception = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700619 if (UNLIKELY(exception == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000620 ThrowNullPointerException("throw with null exception");
Jeff Haoa3faaf42013-09-03 19:07:00 -0700621 } else if (do_assignability_check && !exception->GetClass()->IsThrowableClass()) {
622 // This should never happen.
Ian Rogers1ff3c982014-08-12 02:30:58 -0700623 std::string temp;
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000624 self->ThrowNewExceptionF("Ljava/lang/VirtualMachineError;",
Jeff Haoa3faaf42013-09-03 19:07:00 -0700625 "Throwing '%s' that is not instance of Throwable",
Ian Rogers1ff3c982014-08-12 02:30:58 -0700626 exception->GetClass()->GetDescriptor(&temp));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200627 } else {
Nicolas Geoffray14691c52015-03-05 10:40:17 +0000628 self->SetException(exception->AsThrowable());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200629 }
630 HANDLE_PENDING_EXCEPTION();
631 }
632 HANDLE_INSTRUCTION_END();
633
634 HANDLE_INSTRUCTION_START(GOTO) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200635 int8_t offset = inst->VRegA_10t(inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000636 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200637 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000638 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200639 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700640 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200641 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200642 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200643 }
644 ADVANCE(offset);
645 }
646 HANDLE_INSTRUCTION_END();
647
648 HANDLE_INSTRUCTION_START(GOTO_16) {
649 int16_t offset = inst->VRegA_20t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000650 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200651 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000652 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200653 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700654 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200655 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200656 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200657 }
658 ADVANCE(offset);
659 }
660 HANDLE_INSTRUCTION_END();
661
662 HANDLE_INSTRUCTION_START(GOTO_32) {
663 int32_t offset = inst->VRegA_30t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000664 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200665 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000666 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200667 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700668 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200669 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200670 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200671 }
672 ADVANCE(offset);
673 }
674 HANDLE_INSTRUCTION_END();
675
676 HANDLE_INSTRUCTION_START(PACKED_SWITCH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200677 int32_t offset = DoPackedSwitch(inst, shadow_frame, inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000678 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200679 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000680 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200681 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700682 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200683 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200684 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200685 }
686 ADVANCE(offset);
687 }
688 HANDLE_INSTRUCTION_END();
689
690 HANDLE_INSTRUCTION_START(SPARSE_SWITCH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200691 int32_t offset = DoSparseSwitch(inst, shadow_frame, inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000692 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200693 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000694 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200695 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700696 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200697 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200698 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200699 }
700 ADVANCE(offset);
701 }
702 HANDLE_INSTRUCTION_END();
703
Ian Rogers647b1a82014-10-10 11:02:11 -0700704#if defined(__clang__)
705#pragma clang diagnostic push
706#pragma clang diagnostic ignored "-Wfloat-equal"
707#endif
708
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200709 HANDLE_INSTRUCTION_START(CMPL_FLOAT) {
710 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
711 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
712 int32_t result;
713 if (val1 > val2) {
714 result = 1;
715 } else if (val1 == val2) {
716 result = 0;
717 } else {
718 result = -1;
719 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200720 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200721 ADVANCE(2);
722 }
723 HANDLE_INSTRUCTION_END();
724
725 HANDLE_INSTRUCTION_START(CMPG_FLOAT) {
726 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
727 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
728 int32_t result;
729 if (val1 < val2) {
730 result = -1;
731 } else if (val1 == val2) {
732 result = 0;
733 } else {
734 result = 1;
735 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200736 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200737 ADVANCE(2);
738 }
739 HANDLE_INSTRUCTION_END();
740
741 HANDLE_INSTRUCTION_START(CMPL_DOUBLE) {
742 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
743 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
744 int32_t result;
745 if (val1 > val2) {
746 result = 1;
747 } else if (val1 == val2) {
748 result = 0;
749 } else {
750 result = -1;
751 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200752 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200753 ADVANCE(2);
754 }
755 HANDLE_INSTRUCTION_END();
756
757 HANDLE_INSTRUCTION_START(CMPG_DOUBLE) {
758 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
759 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
760 int32_t result;
761 if (val1 < val2) {
762 result = -1;
763 } else if (val1 == val2) {
764 result = 0;
765 } else {
766 result = 1;
767 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200768 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200769 ADVANCE(2);
770 }
771 HANDLE_INSTRUCTION_END();
772
Ian Rogers647b1a82014-10-10 11:02:11 -0700773#if defined(__clang__)
774#pragma clang diagnostic pop
775#endif
776
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200777 HANDLE_INSTRUCTION_START(CMP_LONG) {
778 int64_t val1 = shadow_frame.GetVRegLong(inst->VRegB_23x());
779 int64_t val2 = shadow_frame.GetVRegLong(inst->VRegC_23x());
780 int32_t result;
781 if (val1 > val2) {
782 result = 1;
783 } else if (val1 == val2) {
784 result = 0;
785 } else {
786 result = -1;
787 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200788 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200789 ADVANCE(2);
790 }
791 HANDLE_INSTRUCTION_END();
792
793 HANDLE_INSTRUCTION_START(IF_EQ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200794 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) == shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200795 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000796 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200797 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000798 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200799 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700800 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200801 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200802 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200803 }
804 ADVANCE(offset);
805 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800806 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200807 ADVANCE(2);
808 }
809 }
810 HANDLE_INSTRUCTION_END();
811
812 HANDLE_INSTRUCTION_START(IF_NE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700813 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) !=
814 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200815 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000816 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200817 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000818 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200819 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700820 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200821 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200822 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200823 }
824 ADVANCE(offset);
825 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800826 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200827 ADVANCE(2);
828 }
829 }
830 HANDLE_INSTRUCTION_END();
831
832 HANDLE_INSTRUCTION_START(IF_LT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700833 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <
834 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200835 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000836 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200837 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000838 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200839 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700840 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200841 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200842 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200843 }
844 ADVANCE(offset);
845 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800846 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200847 ADVANCE(2);
848 }
849 }
850 HANDLE_INSTRUCTION_END();
851
852 HANDLE_INSTRUCTION_START(IF_GE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700853 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >=
854 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200855 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000856 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200857 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000858 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200859 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700860 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200861 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200862 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200863 }
864 ADVANCE(offset);
865 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800866 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200867 ADVANCE(2);
868 }
869 }
870 HANDLE_INSTRUCTION_END();
871
872 HANDLE_INSTRUCTION_START(IF_GT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700873 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >
874 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200875 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000876 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200877 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000878 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200879 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700880 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200881 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200882 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200883 }
884 ADVANCE(offset);
885 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800886 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200887 ADVANCE(2);
888 }
889 }
890 HANDLE_INSTRUCTION_END();
891
892 HANDLE_INSTRUCTION_START(IF_LE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700893 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <=
894 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200895 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000896 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200897 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000898 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200899 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700900 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200901 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200902 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200903 }
904 ADVANCE(offset);
905 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800906 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200907 ADVANCE(2);
908 }
909 }
910 HANDLE_INSTRUCTION_END();
911
912 HANDLE_INSTRUCTION_START(IF_EQZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200913 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) == 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200914 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000915 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200916 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000917 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200918 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700919 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200920 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200921 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200922 }
923 ADVANCE(offset);
924 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800925 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200926 ADVANCE(2);
927 }
928 }
929 HANDLE_INSTRUCTION_END();
930
931 HANDLE_INSTRUCTION_START(IF_NEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200932 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) != 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200933 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000934 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200935 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000936 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200937 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700938 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200939 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200940 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200941 }
942 ADVANCE(offset);
943 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800944 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200945 ADVANCE(2);
946 }
947 }
948 HANDLE_INSTRUCTION_END();
949
950 HANDLE_INSTRUCTION_START(IF_LTZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200951 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) < 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200952 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000953 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200954 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000955 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200956 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700957 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200958 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200959 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200960 }
961 ADVANCE(offset);
962 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800963 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200964 ADVANCE(2);
965 }
966 }
967 HANDLE_INSTRUCTION_END();
968
969 HANDLE_INSTRUCTION_START(IF_GEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200970 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) >= 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200971 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000972 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200973 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000974 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200975 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700976 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200977 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200978 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200979 }
980 ADVANCE(offset);
981 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800982 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200983 ADVANCE(2);
984 }
985 }
986 HANDLE_INSTRUCTION_END();
987
988 HANDLE_INSTRUCTION_START(IF_GTZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200989 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) > 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200990 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000991 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200992 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +0000993 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200994 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700995 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200996 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200997 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200998 }
999 ADVANCE(offset);
1000 } else {
buzbeef1dcacc2016-02-24 14:24:24 -08001001 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001002 ADVANCE(2);
1003 }
1004 }
1005 HANDLE_INSTRUCTION_END();
1006
1007 HANDLE_INSTRUCTION_START(IF_LEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001008 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) <= 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001009 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +00001010 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001011 if (IsBackwardBranch(offset)) {
Bill Buzbee1d011d92016-04-04 16:59:29 +00001012 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02001013 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -07001014 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +02001015 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02001016 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001017 }
1018 ADVANCE(offset);
1019 } else {
buzbeef1dcacc2016-02-24 14:24:24 -08001020 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001021 ADVANCE(2);
1022 }
1023 }
1024 HANDLE_INSTRUCTION_END();
1025
1026 HANDLE_INSTRUCTION_START(AGET_BOOLEAN) {
1027 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001028 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001029 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001030 HANDLE_PENDING_EXCEPTION();
1031 } else {
1032 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1033 BooleanArray* array = a->AsBooleanArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001034 if (LIKELY(array->CheckIsValidIndex(index))) {
1035 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001036 ADVANCE(2);
1037 } else {
1038 HANDLE_PENDING_EXCEPTION();
1039 }
1040 }
1041 }
1042 HANDLE_INSTRUCTION_END();
1043
1044 HANDLE_INSTRUCTION_START(AGET_BYTE) {
1045 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001046 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001047 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001048 HANDLE_PENDING_EXCEPTION();
1049 } else {
1050 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1051 ByteArray* array = a->AsByteArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001052 if (LIKELY(array->CheckIsValidIndex(index))) {
1053 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001054 ADVANCE(2);
1055 } else {
1056 HANDLE_PENDING_EXCEPTION();
1057 }
1058 }
1059 }
1060 HANDLE_INSTRUCTION_END();
1061
1062 HANDLE_INSTRUCTION_START(AGET_CHAR) {
1063 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001064 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001065 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001066 HANDLE_PENDING_EXCEPTION();
1067 } else {
1068 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1069 CharArray* array = a->AsCharArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001070 if (LIKELY(array->CheckIsValidIndex(index))) {
1071 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001072 ADVANCE(2);
1073 } else {
1074 HANDLE_PENDING_EXCEPTION();
1075 }
1076 }
1077 }
1078 HANDLE_INSTRUCTION_END();
1079
1080 HANDLE_INSTRUCTION_START(AGET_SHORT) {
1081 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001082 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001083 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001084 HANDLE_PENDING_EXCEPTION();
1085 } else {
1086 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1087 ShortArray* array = a->AsShortArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001088 if (LIKELY(array->CheckIsValidIndex(index))) {
1089 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001090 ADVANCE(2);
1091 } else {
1092 HANDLE_PENDING_EXCEPTION();
1093 }
1094 }
1095 }
1096 HANDLE_INSTRUCTION_END();
1097
1098 HANDLE_INSTRUCTION_START(AGET) {
1099 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001100 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001101 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001102 HANDLE_PENDING_EXCEPTION();
1103 } else {
1104 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001105 DCHECK(a->IsIntArray() || a->IsFloatArray()) << PrettyTypeOf(a);
1106 auto* array = down_cast<IntArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001107 if (LIKELY(array->CheckIsValidIndex(index))) {
1108 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001109 ADVANCE(2);
1110 } else {
1111 HANDLE_PENDING_EXCEPTION();
1112 }
1113 }
1114 }
1115 HANDLE_INSTRUCTION_END();
1116
1117 HANDLE_INSTRUCTION_START(AGET_WIDE) {
1118 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001119 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001120 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001121 HANDLE_PENDING_EXCEPTION();
1122 } else {
1123 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001124 DCHECK(a->IsLongArray() || a->IsDoubleArray()) << PrettyTypeOf(a);
1125 auto* array = down_cast<LongArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001126 if (LIKELY(array->CheckIsValidIndex(index))) {
1127 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001128 ADVANCE(2);
1129 } else {
1130 HANDLE_PENDING_EXCEPTION();
1131 }
1132 }
1133 }
1134 HANDLE_INSTRUCTION_END();
1135
1136 HANDLE_INSTRUCTION_START(AGET_OBJECT) {
1137 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001138 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001139 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001140 HANDLE_PENDING_EXCEPTION();
1141 } else {
1142 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1143 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001144 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001145 shadow_frame.SetVRegReference(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001146 ADVANCE(2);
1147 } else {
1148 HANDLE_PENDING_EXCEPTION();
1149 }
1150 }
1151 }
1152 HANDLE_INSTRUCTION_END();
1153
1154 HANDLE_INSTRUCTION_START(APUT_BOOLEAN) {
1155 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001156 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001157 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001158 HANDLE_PENDING_EXCEPTION();
1159 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001160 uint8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001161 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1162 BooleanArray* array = a->AsBooleanArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001163 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001164 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001165 ADVANCE(2);
1166 } else {
1167 HANDLE_PENDING_EXCEPTION();
1168 }
1169 }
1170 }
1171 HANDLE_INSTRUCTION_END();
1172
1173 HANDLE_INSTRUCTION_START(APUT_BYTE) {
1174 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001175 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001176 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001177 HANDLE_PENDING_EXCEPTION();
1178 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001179 int8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001180 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1181 ByteArray* array = a->AsByteArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001182 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001183 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001184 ADVANCE(2);
1185 } else {
1186 HANDLE_PENDING_EXCEPTION();
1187 }
1188 }
1189 }
1190 HANDLE_INSTRUCTION_END();
1191
1192 HANDLE_INSTRUCTION_START(APUT_CHAR) {
1193 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001194 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001195 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001196 HANDLE_PENDING_EXCEPTION();
1197 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001198 uint16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001199 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1200 CharArray* array = a->AsCharArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001201 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001202 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001203 ADVANCE(2);
1204 } else {
1205 HANDLE_PENDING_EXCEPTION();
1206 }
1207 }
1208 }
1209 HANDLE_INSTRUCTION_END();
1210
1211 HANDLE_INSTRUCTION_START(APUT_SHORT) {
1212 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001213 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001214 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001215 HANDLE_PENDING_EXCEPTION();
1216 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001217 int16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001218 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1219 ShortArray* array = a->AsShortArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001220 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001221 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001222 ADVANCE(2);
1223 } else {
1224 HANDLE_PENDING_EXCEPTION();
1225 }
1226 }
1227 }
1228 HANDLE_INSTRUCTION_END();
1229
1230 HANDLE_INSTRUCTION_START(APUT) {
1231 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001232 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001233 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001234 HANDLE_PENDING_EXCEPTION();
1235 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001236 int32_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001237 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001238 DCHECK(a->IsIntArray() || a->IsFloatArray()) << PrettyTypeOf(a);
1239 auto* array = down_cast<IntArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001240 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001241 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001242 ADVANCE(2);
1243 } else {
1244 HANDLE_PENDING_EXCEPTION();
1245 }
1246 }
1247 }
1248 HANDLE_INSTRUCTION_END();
1249
1250 HANDLE_INSTRUCTION_START(APUT_WIDE) {
1251 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001252 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001253 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001254 HANDLE_PENDING_EXCEPTION();
1255 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001256 int64_t val = shadow_frame.GetVRegLong(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001257 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001258 DCHECK(a->IsLongArray() || a->IsDoubleArray()) << PrettyTypeOf(a);
1259 auto* array = down_cast<LongArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001260 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001261 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001262 ADVANCE(2);
1263 } else {
1264 HANDLE_PENDING_EXCEPTION();
1265 }
1266 }
1267 }
1268 HANDLE_INSTRUCTION_END();
1269
1270 HANDLE_INSTRUCTION_START(APUT_OBJECT) {
1271 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001272 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001273 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001274 HANDLE_PENDING_EXCEPTION();
1275 } else {
1276 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001277 Object* val = shadow_frame.GetVRegReference(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001278 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001279 if (LIKELY(array->CheckIsValidIndex(index) && array->CheckAssignable(val))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001280 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001281 ADVANCE(2);
1282 } else {
1283 HANDLE_PENDING_EXCEPTION();
1284 }
1285 }
1286 }
1287 HANDLE_INSTRUCTION_END();
1288
1289 HANDLE_INSTRUCTION_START(IGET_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001290 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimBoolean, do_access_check>(
1291 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001292 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1293 }
1294 HANDLE_INSTRUCTION_END();
1295
1296 HANDLE_INSTRUCTION_START(IGET_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001297 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimByte, do_access_check>(
1298 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001299 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1300 }
1301 HANDLE_INSTRUCTION_END();
1302
1303 HANDLE_INSTRUCTION_START(IGET_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001304 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimChar, do_access_check>(
1305 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001306 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1307 }
1308 HANDLE_INSTRUCTION_END();
1309
1310 HANDLE_INSTRUCTION_START(IGET_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001311 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimShort, do_access_check>(
1312 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001313 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1314 }
1315 HANDLE_INSTRUCTION_END();
1316
1317 HANDLE_INSTRUCTION_START(IGET) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001318 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimInt, do_access_check>(
1319 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001320 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1321 }
1322 HANDLE_INSTRUCTION_END();
1323
1324 HANDLE_INSTRUCTION_START(IGET_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001325 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimLong, do_access_check>(
1326 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001327 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1328 }
1329 HANDLE_INSTRUCTION_END();
1330
1331 HANDLE_INSTRUCTION_START(IGET_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001332 bool success = DoFieldGet<InstanceObjectRead, Primitive::kPrimNot, do_access_check>(
1333 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001334 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1335 }
1336 HANDLE_INSTRUCTION_END();
1337
1338 HANDLE_INSTRUCTION_START(IGET_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001339 bool success = DoIGetQuick<Primitive::kPrimInt>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001340 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1341 }
1342 HANDLE_INSTRUCTION_END();
1343
Mathieu Chartierffc605c2014-12-10 10:35:44 -08001344 HANDLE_INSTRUCTION_START(IGET_BOOLEAN_QUICK) {
1345 bool success = DoIGetQuick<Primitive::kPrimBoolean>(shadow_frame, inst, inst_data);
1346 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1347 }
1348 HANDLE_INSTRUCTION_END();
1349
1350 HANDLE_INSTRUCTION_START(IGET_BYTE_QUICK) {
1351 bool success = DoIGetQuick<Primitive::kPrimByte>(shadow_frame, inst, inst_data);
1352 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1353 }
1354 HANDLE_INSTRUCTION_END();
1355
1356 HANDLE_INSTRUCTION_START(IGET_CHAR_QUICK) {
1357 bool success = DoIGetQuick<Primitive::kPrimChar>(shadow_frame, inst, inst_data);
1358 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1359 }
1360 HANDLE_INSTRUCTION_END();
1361
1362 HANDLE_INSTRUCTION_START(IGET_SHORT_QUICK) {
1363 bool success = DoIGetQuick<Primitive::kPrimShort>(shadow_frame, inst, inst_data);
1364 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1365 }
1366 HANDLE_INSTRUCTION_END();
1367
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001368 HANDLE_INSTRUCTION_START(IGET_WIDE_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001369 bool success = DoIGetQuick<Primitive::kPrimLong>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001370 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1371 }
1372 HANDLE_INSTRUCTION_END();
1373
1374 HANDLE_INSTRUCTION_START(IGET_OBJECT_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001375 bool success = DoIGetQuick<Primitive::kPrimNot>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001376 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1377 }
1378 HANDLE_INSTRUCTION_END();
1379
1380 HANDLE_INSTRUCTION_START(SGET_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001381 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimBoolean, do_access_check>(
1382 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001383 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1384 }
1385 HANDLE_INSTRUCTION_END();
1386
1387 HANDLE_INSTRUCTION_START(SGET_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001388 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimByte, do_access_check>(
1389 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001390 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1391 }
1392 HANDLE_INSTRUCTION_END();
1393
1394 HANDLE_INSTRUCTION_START(SGET_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001395 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimChar, do_access_check>(
1396 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001397 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1398 }
1399 HANDLE_INSTRUCTION_END();
1400
1401 HANDLE_INSTRUCTION_START(SGET_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001402 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimShort, do_access_check>(
1403 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001404 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1405 }
1406 HANDLE_INSTRUCTION_END();
1407
1408 HANDLE_INSTRUCTION_START(SGET) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001409 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimInt, do_access_check>(
1410 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001411 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1412 }
1413 HANDLE_INSTRUCTION_END();
1414
1415 HANDLE_INSTRUCTION_START(SGET_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001416 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimLong, do_access_check>(
1417 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001418 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1419 }
1420 HANDLE_INSTRUCTION_END();
1421
1422 HANDLE_INSTRUCTION_START(SGET_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001423 bool success = DoFieldGet<StaticObjectRead, Primitive::kPrimNot, do_access_check>(
1424 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001425 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1426 }
1427 HANDLE_INSTRUCTION_END();
1428
1429 HANDLE_INSTRUCTION_START(IPUT_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001430 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimBoolean, do_access_check,
1431 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001432 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1433 }
1434 HANDLE_INSTRUCTION_END();
1435
1436 HANDLE_INSTRUCTION_START(IPUT_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001437 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimByte, do_access_check,
1438 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001439 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1440 }
1441 HANDLE_INSTRUCTION_END();
1442
1443 HANDLE_INSTRUCTION_START(IPUT_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001444 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimChar, do_access_check,
1445 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001446 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1447 }
1448 HANDLE_INSTRUCTION_END();
1449
1450 HANDLE_INSTRUCTION_START(IPUT_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001451 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimShort, do_access_check,
1452 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001453 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1454 }
1455 HANDLE_INSTRUCTION_END();
1456
1457 HANDLE_INSTRUCTION_START(IPUT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001458 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimInt, do_access_check,
1459 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001460 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1461 }
1462 HANDLE_INSTRUCTION_END();
1463
1464 HANDLE_INSTRUCTION_START(IPUT_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001465 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimLong, do_access_check,
1466 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001467 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1468 }
1469 HANDLE_INSTRUCTION_END();
1470
1471 HANDLE_INSTRUCTION_START(IPUT_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001472 bool success = DoFieldPut<InstanceObjectWrite, Primitive::kPrimNot, do_access_check,
1473 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001474 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1475 }
1476 HANDLE_INSTRUCTION_END();
1477
1478 HANDLE_INSTRUCTION_START(IPUT_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001479 bool success = DoIPutQuick<Primitive::kPrimInt, transaction_active>(
1480 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001481 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1482 }
1483 HANDLE_INSTRUCTION_END();
1484
Fred Shih37f05ef2014-07-16 18:38:08 -07001485 HANDLE_INSTRUCTION_START(IPUT_BOOLEAN_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001486 bool success = DoIPutQuick<Primitive::kPrimBoolean, transaction_active>(
1487 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001488 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1489 }
1490 HANDLE_INSTRUCTION_END();
1491
1492 HANDLE_INSTRUCTION_START(IPUT_BYTE_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001493 bool success = DoIPutQuick<Primitive::kPrimByte, transaction_active>(
1494 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001495 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1496 }
1497 HANDLE_INSTRUCTION_END();
1498
1499 HANDLE_INSTRUCTION_START(IPUT_CHAR_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001500 bool success = DoIPutQuick<Primitive::kPrimChar, transaction_active>(
1501 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001502 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1503 }
1504 HANDLE_INSTRUCTION_END();
1505
1506 HANDLE_INSTRUCTION_START(IPUT_SHORT_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001507 bool success = DoIPutQuick<Primitive::kPrimShort, transaction_active>(
1508 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001509 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1510 }
1511 HANDLE_INSTRUCTION_END();
1512
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001513 HANDLE_INSTRUCTION_START(IPUT_WIDE_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001514 bool success = DoIPutQuick<Primitive::kPrimLong, transaction_active>(
1515 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001516 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1517 }
1518 HANDLE_INSTRUCTION_END();
1519
1520 HANDLE_INSTRUCTION_START(IPUT_OBJECT_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001521 bool success = DoIPutQuick<Primitive::kPrimNot, transaction_active>(
1522 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001523 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1524 }
1525 HANDLE_INSTRUCTION_END();
1526
1527 HANDLE_INSTRUCTION_START(SPUT_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001528 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimBoolean, do_access_check,
1529 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001530 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1531 }
1532 HANDLE_INSTRUCTION_END();
1533
1534 HANDLE_INSTRUCTION_START(SPUT_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001535 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimByte, do_access_check,
1536 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001537 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1538 }
1539 HANDLE_INSTRUCTION_END();
1540
1541 HANDLE_INSTRUCTION_START(SPUT_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001542 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimChar, do_access_check,
1543 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001544 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1545 }
1546 HANDLE_INSTRUCTION_END();
1547
1548 HANDLE_INSTRUCTION_START(SPUT_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001549 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimShort, do_access_check,
1550 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001551 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1552 }
1553 HANDLE_INSTRUCTION_END();
1554
1555 HANDLE_INSTRUCTION_START(SPUT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001556 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimInt, do_access_check,
1557 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001558 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1559 }
1560 HANDLE_INSTRUCTION_END();
1561
1562 HANDLE_INSTRUCTION_START(SPUT_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001563 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimLong, do_access_check,
1564 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001565 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1566 }
1567 HANDLE_INSTRUCTION_END();
1568
1569 HANDLE_INSTRUCTION_START(SPUT_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001570 bool success = DoFieldPut<StaticObjectWrite, Primitive::kPrimNot, do_access_check,
1571 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001572 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1573 }
1574 HANDLE_INSTRUCTION_END();
1575
1576 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001577 bool success = DoInvoke<kVirtual, false, do_access_check>(
1578 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001579 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001580 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1581 }
1582 HANDLE_INSTRUCTION_END();
1583
1584 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001585 bool success = DoInvoke<kVirtual, true, do_access_check>(
1586 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001587 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001588 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1589 }
1590 HANDLE_INSTRUCTION_END();
1591
1592 HANDLE_INSTRUCTION_START(INVOKE_SUPER) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001593 bool success = DoInvoke<kSuper, false, do_access_check>(
1594 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001595 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001596 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1597 }
1598 HANDLE_INSTRUCTION_END();
1599
1600 HANDLE_INSTRUCTION_START(INVOKE_SUPER_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001601 bool success = DoInvoke<kSuper, true, do_access_check>(
1602 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001603 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001604 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1605 }
1606 HANDLE_INSTRUCTION_END();
1607
1608 HANDLE_INSTRUCTION_START(INVOKE_DIRECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001609 bool success = DoInvoke<kDirect, false, do_access_check>(
1610 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001611 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001612 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1613 }
1614 HANDLE_INSTRUCTION_END();
1615
1616 HANDLE_INSTRUCTION_START(INVOKE_DIRECT_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001617 bool success = DoInvoke<kDirect, true, do_access_check>(
1618 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001619 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001620 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1621 }
1622 HANDLE_INSTRUCTION_END();
1623
1624 HANDLE_INSTRUCTION_START(INVOKE_INTERFACE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001625 bool success = DoInvoke<kInterface, false, do_access_check>(
1626 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001627 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001628 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1629 }
1630 HANDLE_INSTRUCTION_END();
1631
1632 HANDLE_INSTRUCTION_START(INVOKE_INTERFACE_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001633 bool success = DoInvoke<kInterface, true, do_access_check>(
1634 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001635 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001636 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1637 }
1638 HANDLE_INSTRUCTION_END();
1639
1640 HANDLE_INSTRUCTION_START(INVOKE_STATIC) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001641 bool success = DoInvoke<kStatic, false, do_access_check>(
1642 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001643 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001644 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1645 }
1646 HANDLE_INSTRUCTION_END();
1647
1648 HANDLE_INSTRUCTION_START(INVOKE_STATIC_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001649 bool success = DoInvoke<kStatic, true, do_access_check>(
1650 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001651 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001652 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1653 }
1654 HANDLE_INSTRUCTION_END();
1655
1656 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001657 bool success = DoInvokeVirtualQuick<false>(
1658 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001659 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001660 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1661 }
1662 HANDLE_INSTRUCTION_END();
1663
1664 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001665 bool success = DoInvokeVirtualQuick<true>(
1666 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001667 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001668 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1669 }
1670 HANDLE_INSTRUCTION_END();
1671
Igor Murashkin158f35c2015-06-10 15:55:30 -07001672 HANDLE_EXPERIMENTAL_INSTRUCTION_START(INVOKE_LAMBDA) {
1673 bool success = DoInvokeLambda<do_access_check>(self, shadow_frame, inst, inst_data,
1674 &result_register);
1675 UPDATE_HANDLER_TABLE();
1676 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1677 }
1678 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
1679
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001680 HANDLE_INSTRUCTION_START(NEG_INT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001681 shadow_frame.SetVReg(
1682 inst->VRegA_12x(inst_data), -shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001683 ADVANCE(1);
1684 HANDLE_INSTRUCTION_END();
1685
1686 HANDLE_INSTRUCTION_START(NOT_INT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001687 shadow_frame.SetVReg(
1688 inst->VRegA_12x(inst_data), ~shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001689 ADVANCE(1);
1690 HANDLE_INSTRUCTION_END();
1691
1692 HANDLE_INSTRUCTION_START(NEG_LONG)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001693 shadow_frame.SetVRegLong(
1694 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001695 ADVANCE(1);
1696 HANDLE_INSTRUCTION_END();
1697
1698 HANDLE_INSTRUCTION_START(NOT_LONG)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001699 shadow_frame.SetVRegLong(
1700 inst->VRegA_12x(inst_data), ~shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001701 ADVANCE(1);
1702 HANDLE_INSTRUCTION_END();
1703
1704 HANDLE_INSTRUCTION_START(NEG_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001705 shadow_frame.SetVRegFloat(
1706 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001707 ADVANCE(1);
1708 HANDLE_INSTRUCTION_END();
1709
1710 HANDLE_INSTRUCTION_START(NEG_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001711 shadow_frame.SetVRegDouble(
1712 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001713 ADVANCE(1);
1714 HANDLE_INSTRUCTION_END();
1715
1716 HANDLE_INSTRUCTION_START(INT_TO_LONG)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001717 shadow_frame.SetVRegLong(
1718 inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001719 ADVANCE(1);
1720 HANDLE_INSTRUCTION_END();
1721
1722 HANDLE_INSTRUCTION_START(INT_TO_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001723 shadow_frame.SetVRegFloat(
1724 inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001725 ADVANCE(1);
1726 HANDLE_INSTRUCTION_END();
1727
1728 HANDLE_INSTRUCTION_START(INT_TO_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001729 shadow_frame.SetVRegDouble(
1730 inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001731 ADVANCE(1);
1732 HANDLE_INSTRUCTION_END();
1733
1734 HANDLE_INSTRUCTION_START(LONG_TO_INT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001735 shadow_frame.SetVReg(
1736 inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001737 ADVANCE(1);
1738 HANDLE_INSTRUCTION_END();
1739
1740 HANDLE_INSTRUCTION_START(LONG_TO_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001741 shadow_frame.SetVRegFloat(
1742 inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001743 ADVANCE(1);
1744 HANDLE_INSTRUCTION_END();
1745
1746 HANDLE_INSTRUCTION_START(LONG_TO_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001747 shadow_frame.SetVRegDouble(
1748 inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001749 ADVANCE(1);
1750 HANDLE_INSTRUCTION_END();
1751
1752 HANDLE_INSTRUCTION_START(FLOAT_TO_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001753 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001754 int32_t result = art_float_to_integral<int32_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001755 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001756 ADVANCE(1);
1757 }
1758 HANDLE_INSTRUCTION_END();
1759
1760 HANDLE_INSTRUCTION_START(FLOAT_TO_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001761 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001762 int64_t result = art_float_to_integral<int64_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001763 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001764 ADVANCE(1);
1765 }
1766 HANDLE_INSTRUCTION_END();
1767
1768 HANDLE_INSTRUCTION_START(FLOAT_TO_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001769 shadow_frame.SetVRegDouble(
1770 inst->VRegA_12x(inst_data), shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001771 ADVANCE(1);
1772 HANDLE_INSTRUCTION_END();
1773
1774 HANDLE_INSTRUCTION_START(DOUBLE_TO_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001775 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001776 int32_t result = art_float_to_integral<int32_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001777 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001778 ADVANCE(1);
1779 }
1780 HANDLE_INSTRUCTION_END();
1781
1782 HANDLE_INSTRUCTION_START(DOUBLE_TO_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001783 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001784 int64_t result = art_float_to_integral<int64_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001785 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001786 ADVANCE(1);
1787 }
1788 HANDLE_INSTRUCTION_END();
1789
1790 HANDLE_INSTRUCTION_START(DOUBLE_TO_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001791 shadow_frame.SetVRegFloat(
1792 inst->VRegA_12x(inst_data), shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001793 ADVANCE(1);
1794 HANDLE_INSTRUCTION_END();
1795
1796 HANDLE_INSTRUCTION_START(INT_TO_BYTE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001797 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1798 static_cast<int8_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001799 ADVANCE(1);
1800 HANDLE_INSTRUCTION_END();
1801
1802 HANDLE_INSTRUCTION_START(INT_TO_CHAR)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001803 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1804 static_cast<uint16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001805 ADVANCE(1);
1806 HANDLE_INSTRUCTION_END();
1807
1808 HANDLE_INSTRUCTION_START(INT_TO_SHORT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001809 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1810 static_cast<int16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001811 ADVANCE(1);
1812 HANDLE_INSTRUCTION_END();
1813
1814 HANDLE_INSTRUCTION_START(ADD_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001815 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001816 SafeAdd(shadow_frame.GetVReg(inst->VRegB_23x()),
1817 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001818 ADVANCE(2);
1819 HANDLE_INSTRUCTION_END();
1820
1821 HANDLE_INSTRUCTION_START(SUB_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001822 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001823 SafeSub(shadow_frame.GetVReg(inst->VRegB_23x()),
1824 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001825 ADVANCE(2);
1826 HANDLE_INSTRUCTION_END();
1827
1828 HANDLE_INSTRUCTION_START(MUL_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001829 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001830 SafeMul(shadow_frame.GetVReg(inst->VRegB_23x()),
1831 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001832 ADVANCE(2);
1833 HANDLE_INSTRUCTION_END();
1834
1835 HANDLE_INSTRUCTION_START(DIV_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001836 bool success = DoIntDivide(shadow_frame, inst->VRegA_23x(inst_data),
1837 shadow_frame.GetVReg(inst->VRegB_23x()),
1838 shadow_frame.GetVReg(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001839 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1840 }
1841 HANDLE_INSTRUCTION_END();
1842
1843 HANDLE_INSTRUCTION_START(REM_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001844 bool success = DoIntRemainder(shadow_frame, inst->VRegA_23x(inst_data),
1845 shadow_frame.GetVReg(inst->VRegB_23x()),
1846 shadow_frame.GetVReg(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001847 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1848 }
1849 HANDLE_INSTRUCTION_END();
1850
1851 HANDLE_INSTRUCTION_START(SHL_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001852 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001853 shadow_frame.GetVReg(inst->VRegB_23x()) <<
1854 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1855 ADVANCE(2);
1856 HANDLE_INSTRUCTION_END();
1857
1858 HANDLE_INSTRUCTION_START(SHR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001859 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001860 shadow_frame.GetVReg(inst->VRegB_23x()) >>
1861 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1862 ADVANCE(2);
1863 HANDLE_INSTRUCTION_END();
1864
1865 HANDLE_INSTRUCTION_START(USHR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001866 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001867 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_23x())) >>
1868 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1869 ADVANCE(2);
1870 HANDLE_INSTRUCTION_END();
1871
1872 HANDLE_INSTRUCTION_START(AND_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001873 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001874 shadow_frame.GetVReg(inst->VRegB_23x()) &
1875 shadow_frame.GetVReg(inst->VRegC_23x()));
1876 ADVANCE(2);
1877 HANDLE_INSTRUCTION_END();
1878
1879 HANDLE_INSTRUCTION_START(OR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001880 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001881 shadow_frame.GetVReg(inst->VRegB_23x()) |
1882 shadow_frame.GetVReg(inst->VRegC_23x()));
1883 ADVANCE(2);
1884 HANDLE_INSTRUCTION_END();
1885
1886 HANDLE_INSTRUCTION_START(XOR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001887 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001888 shadow_frame.GetVReg(inst->VRegB_23x()) ^
1889 shadow_frame.GetVReg(inst->VRegC_23x()));
1890 ADVANCE(2);
1891 HANDLE_INSTRUCTION_END();
1892
1893 HANDLE_INSTRUCTION_START(ADD_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001894 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001895 SafeAdd(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1896 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001897 ADVANCE(2);
1898 HANDLE_INSTRUCTION_END();
1899
1900 HANDLE_INSTRUCTION_START(SUB_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001901 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001902 SafeSub(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1903 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001904 ADVANCE(2);
1905 HANDLE_INSTRUCTION_END();
1906
1907 HANDLE_INSTRUCTION_START(MUL_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001908 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001909 SafeMul(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1910 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001911 ADVANCE(2);
1912 HANDLE_INSTRUCTION_END();
1913
1914 HANDLE_INSTRUCTION_START(DIV_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001915 bool success = DoLongDivide(shadow_frame, inst->VRegA_23x(inst_data),
1916 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1917 shadow_frame.GetVRegLong(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001918 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1919 }
1920 HANDLE_INSTRUCTION_END();
1921
1922 HANDLE_INSTRUCTION_START(REM_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001923 bool success = DoLongRemainder(shadow_frame, inst->VRegA_23x(inst_data),
1924 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1925 shadow_frame.GetVRegLong(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001926 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1927 }
1928 HANDLE_INSTRUCTION_END();
1929
1930 HANDLE_INSTRUCTION_START(AND_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001931 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001932 shadow_frame.GetVRegLong(inst->VRegB_23x()) &
1933 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1934 ADVANCE(2);
1935 HANDLE_INSTRUCTION_END();
1936
1937 HANDLE_INSTRUCTION_START(OR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001938 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001939 shadow_frame.GetVRegLong(inst->VRegB_23x()) |
1940 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1941 ADVANCE(2);
1942 HANDLE_INSTRUCTION_END();
1943
1944 HANDLE_INSTRUCTION_START(XOR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001945 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001946 shadow_frame.GetVRegLong(inst->VRegB_23x()) ^
1947 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1948 ADVANCE(2);
1949 HANDLE_INSTRUCTION_END();
1950
1951 HANDLE_INSTRUCTION_START(SHL_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001952 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001953 shadow_frame.GetVRegLong(inst->VRegB_23x()) <<
1954 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1955 ADVANCE(2);
1956 HANDLE_INSTRUCTION_END();
1957
1958 HANDLE_INSTRUCTION_START(SHR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001959 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001960 shadow_frame.GetVRegLong(inst->VRegB_23x()) >>
1961 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1962 ADVANCE(2);
1963 HANDLE_INSTRUCTION_END();
1964
1965 HANDLE_INSTRUCTION_START(USHR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001966 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001967 static_cast<uint64_t>(shadow_frame.GetVRegLong(inst->VRegB_23x())) >>
1968 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1969 ADVANCE(2);
1970 HANDLE_INSTRUCTION_END();
1971
1972 HANDLE_INSTRUCTION_START(ADD_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001973 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001974 shadow_frame.GetVRegFloat(inst->VRegB_23x()) +
1975 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1976 ADVANCE(2);
1977 HANDLE_INSTRUCTION_END();
1978
1979 HANDLE_INSTRUCTION_START(SUB_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001980 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001981 shadow_frame.GetVRegFloat(inst->VRegB_23x()) -
1982 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1983 ADVANCE(2);
1984 HANDLE_INSTRUCTION_END();
1985
1986 HANDLE_INSTRUCTION_START(MUL_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001987 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001988 shadow_frame.GetVRegFloat(inst->VRegB_23x()) *
1989 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1990 ADVANCE(2);
1991 HANDLE_INSTRUCTION_END();
1992
1993 HANDLE_INSTRUCTION_START(DIV_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001994 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001995 shadow_frame.GetVRegFloat(inst->VRegB_23x()) /
1996 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1997 ADVANCE(2);
1998 HANDLE_INSTRUCTION_END();
1999
2000 HANDLE_INSTRUCTION_START(REM_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002001 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002002 fmodf(shadow_frame.GetVRegFloat(inst->VRegB_23x()),
2003 shadow_frame.GetVRegFloat(inst->VRegC_23x())));
2004 ADVANCE(2);
2005 HANDLE_INSTRUCTION_END();
2006
2007 HANDLE_INSTRUCTION_START(ADD_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002008 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002009 shadow_frame.GetVRegDouble(inst->VRegB_23x()) +
2010 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2011 ADVANCE(2);
2012 HANDLE_INSTRUCTION_END();
2013
2014 HANDLE_INSTRUCTION_START(SUB_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002015 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002016 shadow_frame.GetVRegDouble(inst->VRegB_23x()) -
2017 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2018 ADVANCE(2);
2019 HANDLE_INSTRUCTION_END();
2020
2021 HANDLE_INSTRUCTION_START(MUL_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002022 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002023 shadow_frame.GetVRegDouble(inst->VRegB_23x()) *
2024 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2025 ADVANCE(2);
2026 HANDLE_INSTRUCTION_END();
2027
2028 HANDLE_INSTRUCTION_START(DIV_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002029 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002030 shadow_frame.GetVRegDouble(inst->VRegB_23x()) /
2031 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2032 ADVANCE(2);
2033 HANDLE_INSTRUCTION_END();
2034
2035 HANDLE_INSTRUCTION_START(REM_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002036 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002037 fmod(shadow_frame.GetVRegDouble(inst->VRegB_23x()),
2038 shadow_frame.GetVRegDouble(inst->VRegC_23x())));
2039 ADVANCE(2);
2040 HANDLE_INSTRUCTION_END();
2041
2042 HANDLE_INSTRUCTION_START(ADD_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002043 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002044 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002045 SafeAdd(shadow_frame.GetVReg(vregA),
2046 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002047 ADVANCE(1);
2048 }
2049 HANDLE_INSTRUCTION_END();
2050
2051 HANDLE_INSTRUCTION_START(SUB_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002052 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002053 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002054 SafeSub(shadow_frame.GetVReg(vregA),
2055 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002056 ADVANCE(1);
2057 }
2058 HANDLE_INSTRUCTION_END();
2059
2060 HANDLE_INSTRUCTION_START(MUL_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002061 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002062 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002063 SafeMul(shadow_frame.GetVReg(vregA),
2064 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002065 ADVANCE(1);
2066 }
2067 HANDLE_INSTRUCTION_END();
2068
2069 HANDLE_INSTRUCTION_START(DIV_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002070 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002071 bool success = DoIntDivide(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002072 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002073 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2074 }
2075 HANDLE_INSTRUCTION_END();
2076
2077 HANDLE_INSTRUCTION_START(REM_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002078 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002079 bool success = DoIntRemainder(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002080 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002081 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2082 }
2083 HANDLE_INSTRUCTION_END();
2084
2085 HANDLE_INSTRUCTION_START(SHL_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002086 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002087 shadow_frame.SetVReg(vregA,
2088 shadow_frame.GetVReg(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002089 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002090 ADVANCE(1);
2091 }
2092 HANDLE_INSTRUCTION_END();
2093
2094 HANDLE_INSTRUCTION_START(SHR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002095 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002096 shadow_frame.SetVReg(vregA,
2097 shadow_frame.GetVReg(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002098 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002099 ADVANCE(1);
2100 }
2101 HANDLE_INSTRUCTION_END();
2102
2103 HANDLE_INSTRUCTION_START(USHR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002104 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002105 shadow_frame.SetVReg(vregA,
2106 static_cast<uint32_t>(shadow_frame.GetVReg(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002107 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002108 ADVANCE(1);
2109 }
2110 HANDLE_INSTRUCTION_END();
2111
2112 HANDLE_INSTRUCTION_START(AND_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002113 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002114 shadow_frame.SetVReg(vregA,
2115 shadow_frame.GetVReg(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002116 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002117 ADVANCE(1);
2118 }
2119 HANDLE_INSTRUCTION_END();
2120
2121 HANDLE_INSTRUCTION_START(OR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002122 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002123 shadow_frame.SetVReg(vregA,
2124 shadow_frame.GetVReg(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002125 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002126 ADVANCE(1);
2127 }
2128 HANDLE_INSTRUCTION_END();
2129
2130 HANDLE_INSTRUCTION_START(XOR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002131 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002132 shadow_frame.SetVReg(vregA,
2133 shadow_frame.GetVReg(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002134 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002135 ADVANCE(1);
2136 }
2137 HANDLE_INSTRUCTION_END();
2138
2139 HANDLE_INSTRUCTION_START(ADD_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002140 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002141 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002142 SafeAdd(shadow_frame.GetVRegLong(vregA),
2143 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002144 ADVANCE(1);
2145 }
2146 HANDLE_INSTRUCTION_END();
2147
2148 HANDLE_INSTRUCTION_START(SUB_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002149 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002150 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002151 SafeSub(shadow_frame.GetVRegLong(vregA),
2152 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002153 ADVANCE(1);
2154 }
2155 HANDLE_INSTRUCTION_END();
2156
2157 HANDLE_INSTRUCTION_START(MUL_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002158 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002159 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002160 SafeMul(shadow_frame.GetVRegLong(vregA),
2161 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002162 ADVANCE(1);
2163 }
2164 HANDLE_INSTRUCTION_END();
2165
2166 HANDLE_INSTRUCTION_START(DIV_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002167 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002168 bool success = DoLongDivide(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002169 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002170 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2171 }
2172 HANDLE_INSTRUCTION_END();
2173
2174 HANDLE_INSTRUCTION_START(REM_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002175 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002176 bool success = DoLongRemainder(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002177 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002178 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2179 }
2180 HANDLE_INSTRUCTION_END();
2181
2182 HANDLE_INSTRUCTION_START(AND_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002183 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002184 shadow_frame.SetVRegLong(vregA,
2185 shadow_frame.GetVRegLong(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002186 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002187 ADVANCE(1);
2188 }
2189 HANDLE_INSTRUCTION_END();
2190
2191 HANDLE_INSTRUCTION_START(OR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002192 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002193 shadow_frame.SetVRegLong(vregA,
2194 shadow_frame.GetVRegLong(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002195 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002196 ADVANCE(1);
2197 }
2198 HANDLE_INSTRUCTION_END();
2199
2200 HANDLE_INSTRUCTION_START(XOR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002201 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002202 shadow_frame.SetVRegLong(vregA,
2203 shadow_frame.GetVRegLong(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002204 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002205 ADVANCE(1);
2206 }
2207 HANDLE_INSTRUCTION_END();
2208
2209 HANDLE_INSTRUCTION_START(SHL_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002210 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002211 shadow_frame.SetVRegLong(vregA,
2212 shadow_frame.GetVRegLong(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002213 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002214 ADVANCE(1);
2215 }
2216 HANDLE_INSTRUCTION_END();
2217
2218 HANDLE_INSTRUCTION_START(SHR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002219 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002220 shadow_frame.SetVRegLong(vregA,
2221 shadow_frame.GetVRegLong(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002222 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002223 ADVANCE(1);
2224 }
2225 HANDLE_INSTRUCTION_END();
2226
2227 HANDLE_INSTRUCTION_START(USHR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002228 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002229 shadow_frame.SetVRegLong(vregA,
2230 static_cast<uint64_t>(shadow_frame.GetVRegLong(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002231 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002232 ADVANCE(1);
2233 }
2234 HANDLE_INSTRUCTION_END();
2235
2236 HANDLE_INSTRUCTION_START(ADD_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002237 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002238 shadow_frame.SetVRegFloat(vregA,
2239 shadow_frame.GetVRegFloat(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002240 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002241 ADVANCE(1);
2242 }
2243 HANDLE_INSTRUCTION_END();
2244
2245 HANDLE_INSTRUCTION_START(SUB_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002246 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002247 shadow_frame.SetVRegFloat(vregA,
2248 shadow_frame.GetVRegFloat(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002249 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002250 ADVANCE(1);
2251 }
2252 HANDLE_INSTRUCTION_END();
2253
2254 HANDLE_INSTRUCTION_START(MUL_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002255 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002256 shadow_frame.SetVRegFloat(vregA,
2257 shadow_frame.GetVRegFloat(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002258 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002259 ADVANCE(1);
2260 }
2261 HANDLE_INSTRUCTION_END();
2262
2263 HANDLE_INSTRUCTION_START(DIV_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002264 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002265 shadow_frame.SetVRegFloat(vregA,
2266 shadow_frame.GetVRegFloat(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002267 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002268 ADVANCE(1);
2269 }
2270 HANDLE_INSTRUCTION_END();
2271
2272 HANDLE_INSTRUCTION_START(REM_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002273 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002274 shadow_frame.SetVRegFloat(vregA,
2275 fmodf(shadow_frame.GetVRegFloat(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002276 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002277 ADVANCE(1);
2278 }
2279 HANDLE_INSTRUCTION_END();
2280
2281 HANDLE_INSTRUCTION_START(ADD_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002282 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002283 shadow_frame.SetVRegDouble(vregA,
2284 shadow_frame.GetVRegDouble(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002285 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002286 ADVANCE(1);
2287 }
2288 HANDLE_INSTRUCTION_END();
2289
2290 HANDLE_INSTRUCTION_START(SUB_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002291 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002292 shadow_frame.SetVRegDouble(vregA,
2293 shadow_frame.GetVRegDouble(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002294 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002295 ADVANCE(1);
2296 }
2297 HANDLE_INSTRUCTION_END();
2298
2299 HANDLE_INSTRUCTION_START(MUL_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002300 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002301 shadow_frame.SetVRegDouble(vregA,
2302 shadow_frame.GetVRegDouble(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002303 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002304 ADVANCE(1);
2305 }
2306 HANDLE_INSTRUCTION_END();
2307
2308 HANDLE_INSTRUCTION_START(DIV_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002309 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002310 shadow_frame.SetVRegDouble(vregA,
2311 shadow_frame.GetVRegDouble(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002312 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002313 ADVANCE(1);
2314 }
2315 HANDLE_INSTRUCTION_END();
2316
2317 HANDLE_INSTRUCTION_START(REM_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002318 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002319 shadow_frame.SetVRegDouble(vregA,
2320 fmod(shadow_frame.GetVRegDouble(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002321 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002322 ADVANCE(1);
2323 }
2324 HANDLE_INSTRUCTION_END();
2325
2326 HANDLE_INSTRUCTION_START(ADD_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002327 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002328 SafeAdd(shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2329 inst->VRegC_22s()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002330 ADVANCE(2);
2331 HANDLE_INSTRUCTION_END();
2332
2333 HANDLE_INSTRUCTION_START(RSUB_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002334 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002335 SafeSub(inst->VRegC_22s(),
2336 shadow_frame.GetVReg(inst->VRegB_22s(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002337 ADVANCE(2);
2338 HANDLE_INSTRUCTION_END();
2339
2340 HANDLE_INSTRUCTION_START(MUL_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002341 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002342 SafeMul(shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2343 inst->VRegC_22s()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002344 ADVANCE(2);
2345 HANDLE_INSTRUCTION_END();
2346
2347 HANDLE_INSTRUCTION_START(DIV_INT_LIT16) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07002348 bool success = DoIntDivide(
2349 shadow_frame, inst->VRegA_22s(inst_data), shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2350 inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002351 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2352 }
2353 HANDLE_INSTRUCTION_END();
2354
2355 HANDLE_INSTRUCTION_START(REM_INT_LIT16) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07002356 bool success = DoIntRemainder(
2357 shadow_frame, inst->VRegA_22s(inst_data), shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2358 inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002359 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2360 }
2361 HANDLE_INSTRUCTION_END();
2362
2363 HANDLE_INSTRUCTION_START(AND_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002364 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2365 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) &
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002366 inst->VRegC_22s());
2367 ADVANCE(2);
2368 HANDLE_INSTRUCTION_END();
2369
2370 HANDLE_INSTRUCTION_START(OR_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002371 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2372 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) |
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002373 inst->VRegC_22s());
2374 ADVANCE(2);
2375 HANDLE_INSTRUCTION_END();
2376
2377 HANDLE_INSTRUCTION_START(XOR_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002378 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2379 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) ^
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002380 inst->VRegC_22s());
2381 ADVANCE(2);
2382 HANDLE_INSTRUCTION_END();
2383
2384 HANDLE_INSTRUCTION_START(ADD_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002385 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002386 SafeAdd(shadow_frame.GetVReg(inst->VRegB_22b()),
2387 inst->VRegC_22b()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002388 ADVANCE(2);
2389 HANDLE_INSTRUCTION_END();
2390
2391 HANDLE_INSTRUCTION_START(RSUB_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002392 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002393 SafeSub(inst->VRegC_22b(),
2394 shadow_frame.GetVReg(inst->VRegB_22b())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002395 ADVANCE(2);
2396 HANDLE_INSTRUCTION_END();
2397
2398 HANDLE_INSTRUCTION_START(MUL_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002399 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002400 SafeMul(shadow_frame.GetVReg(inst->VRegB_22b()),
2401 inst->VRegC_22b()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002402 ADVANCE(2);
2403 HANDLE_INSTRUCTION_END();
2404
2405 HANDLE_INSTRUCTION_START(DIV_INT_LIT8) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002406 bool success = DoIntDivide(shadow_frame, inst->VRegA_22b(inst_data),
2407 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002408 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2409 }
2410 HANDLE_INSTRUCTION_END();
2411
2412 HANDLE_INSTRUCTION_START(REM_INT_LIT8) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002413 bool success = DoIntRemainder(shadow_frame, inst->VRegA_22b(inst_data),
2414 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002415 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2416 }
2417 HANDLE_INSTRUCTION_END();
2418
2419 HANDLE_INSTRUCTION_START(AND_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002420 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002421 shadow_frame.GetVReg(inst->VRegB_22b()) &
2422 inst->VRegC_22b());
2423 ADVANCE(2);
2424 HANDLE_INSTRUCTION_END();
2425
2426 HANDLE_INSTRUCTION_START(OR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002427 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002428 shadow_frame.GetVReg(inst->VRegB_22b()) |
2429 inst->VRegC_22b());
2430 ADVANCE(2);
2431 HANDLE_INSTRUCTION_END();
2432
2433 HANDLE_INSTRUCTION_START(XOR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002434 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002435 shadow_frame.GetVReg(inst->VRegB_22b()) ^
2436 inst->VRegC_22b());
2437 ADVANCE(2);
2438 HANDLE_INSTRUCTION_END();
2439
2440 HANDLE_INSTRUCTION_START(SHL_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002441 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002442 shadow_frame.GetVReg(inst->VRegB_22b()) <<
2443 (inst->VRegC_22b() & 0x1f));
2444 ADVANCE(2);
2445 HANDLE_INSTRUCTION_END();
2446
2447 HANDLE_INSTRUCTION_START(SHR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002448 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002449 shadow_frame.GetVReg(inst->VRegB_22b()) >>
2450 (inst->VRegC_22b() & 0x1f));
2451 ADVANCE(2);
2452 HANDLE_INSTRUCTION_END();
2453
2454 HANDLE_INSTRUCTION_START(USHR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002455 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002456 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_22b())) >>
2457 (inst->VRegC_22b() & 0x1f));
2458 ADVANCE(2);
2459 HANDLE_INSTRUCTION_END();
2460
Igor Murashkin158f35c2015-06-10 15:55:30 -07002461 HANDLE_EXPERIMENTAL_INSTRUCTION_START(CREATE_LAMBDA) {
Igor Murashkin6918bf12015-09-27 19:19:06 -07002462 if (lambda_closure_builder == nullptr) {
2463 // DoCreateLambda always needs a ClosureBuilder, even if it has 0 captured variables.
2464 lambda_closure_builder = MakeUnique<lambda::ClosureBuilder>();
2465 }
2466
2467 // TODO: these allocations should not leak, and the lambda method should not be local.
2468 lambda::Closure* lambda_closure =
2469 reinterpret_cast<lambda::Closure*>(alloca(lambda_closure_builder->GetSize()));
2470 bool success = DoCreateLambda<do_access_check>(self,
2471 inst,
2472 /*inout*/shadow_frame,
2473 /*inout*/lambda_closure_builder.get(),
2474 /*inout*/lambda_closure);
2475 lambda_closure_builder.reset(nullptr); // reset state of variables captured
Igor Murashkin158f35c2015-06-10 15:55:30 -07002476 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2477 }
2478 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2479
Igor Murashkin2ee54e22015-06-18 10:05:11 -07002480 HANDLE_EXPERIMENTAL_INSTRUCTION_START(BOX_LAMBDA) {
2481 bool success = DoBoxLambda<do_access_check>(self, shadow_frame, inst, inst_data);
2482 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2483 }
2484 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2485
2486 HANDLE_EXPERIMENTAL_INSTRUCTION_START(UNBOX_LAMBDA) {
2487 bool success = DoUnboxLambda<do_access_check>(self, shadow_frame, inst, inst_data);
2488 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2489 }
2490 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2491
Igor Murashkin6918bf12015-09-27 19:19:06 -07002492 HANDLE_EXPERIMENTAL_INSTRUCTION_START(CAPTURE_VARIABLE) {
2493 if (lambda_closure_builder == nullptr) {
2494 lambda_closure_builder = MakeUnique<lambda::ClosureBuilder>();
2495 }
2496
2497 bool success = DoCaptureVariable<do_access_check>(self,
2498 inst,
2499 /*inout*/shadow_frame,
2500 /*inout*/lambda_closure_builder.get());
2501
2502 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2503 }
2504 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2505
2506 HANDLE_EXPERIMENTAL_INSTRUCTION_START(LIBERATE_VARIABLE) {
2507 bool success = DoLiberateVariable<do_access_check>(self,
2508 inst,
2509 lambda_captured_variable_index,
2510 /*inout*/shadow_frame);
2511 // Temporarily only allow sequences of 'liberate-variable, liberate-variable, ...'
2512 lambda_captured_variable_index++;
2513 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2514 }
2515 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2516
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002517 HANDLE_INSTRUCTION_START(UNUSED_3E)
Ian Rogerse94652f2014-12-02 11:13:19 -08002518 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002519 HANDLE_INSTRUCTION_END();
2520
2521 HANDLE_INSTRUCTION_START(UNUSED_3F)
Ian Rogerse94652f2014-12-02 11:13:19 -08002522 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002523 HANDLE_INSTRUCTION_END();
2524
2525 HANDLE_INSTRUCTION_START(UNUSED_40)
Ian Rogerse94652f2014-12-02 11:13:19 -08002526 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002527 HANDLE_INSTRUCTION_END();
2528
2529 HANDLE_INSTRUCTION_START(UNUSED_41)
Ian Rogerse94652f2014-12-02 11:13:19 -08002530 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002531 HANDLE_INSTRUCTION_END();
2532
2533 HANDLE_INSTRUCTION_START(UNUSED_42)
Ian Rogerse94652f2014-12-02 11:13:19 -08002534 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002535 HANDLE_INSTRUCTION_END();
2536
2537 HANDLE_INSTRUCTION_START(UNUSED_43)
Ian Rogerse94652f2014-12-02 11:13:19 -08002538 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002539 HANDLE_INSTRUCTION_END();
2540
2541 HANDLE_INSTRUCTION_START(UNUSED_79)
Ian Rogerse94652f2014-12-02 11:13:19 -08002542 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002543 HANDLE_INSTRUCTION_END();
2544
2545 HANDLE_INSTRUCTION_START(UNUSED_7A)
Ian Rogerse94652f2014-12-02 11:13:19 -08002546 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002547 HANDLE_INSTRUCTION_END();
2548
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002549 HANDLE_INSTRUCTION_START(UNUSED_F4)
Ian Rogerse94652f2014-12-02 11:13:19 -08002550 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002551 HANDLE_INSTRUCTION_END();
2552
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002553 HANDLE_INSTRUCTION_START(UNUSED_FA)
Ian Rogerse94652f2014-12-02 11:13:19 -08002554 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002555 HANDLE_INSTRUCTION_END();
2556
2557 HANDLE_INSTRUCTION_START(UNUSED_FB)
Ian Rogerse94652f2014-12-02 11:13:19 -08002558 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002559 HANDLE_INSTRUCTION_END();
2560
2561 HANDLE_INSTRUCTION_START(UNUSED_FC)
Ian Rogerse94652f2014-12-02 11:13:19 -08002562 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002563 HANDLE_INSTRUCTION_END();
2564
2565 HANDLE_INSTRUCTION_START(UNUSED_FD)
Ian Rogerse94652f2014-12-02 11:13:19 -08002566 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002567 HANDLE_INSTRUCTION_END();
2568
2569 HANDLE_INSTRUCTION_START(UNUSED_FE)
Ian Rogerse94652f2014-12-02 11:13:19 -08002570 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002571 HANDLE_INSTRUCTION_END();
2572
2573 HANDLE_INSTRUCTION_START(UNUSED_FF)
Ian Rogerse94652f2014-12-02 11:13:19 -08002574 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002575 HANDLE_INSTRUCTION_END();
2576
2577 exception_pending_label: {
2578 CHECK(self->IsExceptionPending());
Sebastien Hertz1eda2262013-09-09 16:53:14 +02002579 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -07002580 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +02002581 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02002582 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002583 uint32_t found_dex_pc = FindNextInstructionFollowingException(self, shadow_frame, dex_pc,
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002584 instrumentation);
2585 if (found_dex_pc == DexFile::kDexNoIndex) {
Andreas Gampe03ec9302015-08-27 17:41:47 -07002586 // Structured locking is to be enforced for abnormal termination, too.
2587 shadow_frame.GetLockCountData().CheckAllMonitorsReleasedOrThrow<do_assignability_check>(self);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002588 return JValue(); /* Handled in caller. */
2589 } else {
2590 int32_t displacement = static_cast<int32_t>(found_dex_pc) - static_cast<int32_t>(dex_pc);
2591 ADVANCE(displacement);
2592 }
2593 }
2594
Sebastien Hertz8379b222014-02-24 17:38:15 +01002595// Create alternative instruction handlers dedicated to instrumentation.
2596// Return instructions must not call Instrumentation::DexPcMovedEvent since they already call
2597// Instrumentation::MethodExited. This is to avoid posting debugger events twice for this location.
Sebastien Hertze713d932014-05-15 10:48:53 +02002598// Note: we do not use the kReturn instruction flag here (to test the instruction is a return). The
2599// compiler seems to not evaluate "(Instruction::FlagsOf(Instruction::code) & kReturn) != 0" to
2600// a constant condition that would remove the "if" statement so the test is free.
Sebastien Hertz9d6bf692015-04-10 12:12:33 +02002601#define INSTRUMENTATION_INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) \
2602 alt_op_##code: { \
Sebastien Hertz9d6bf692015-04-10 12:12:33 +02002603 if (UNLIKELY(instrumentation->HasDexPcListeners())) { \
2604 Object* this_object = shadow_frame.GetThisObject(code_item->ins_size_); \
2605 instrumentation->DexPcMovedEvent(self, this_object, shadow_frame.GetMethod(), dex_pc); \
2606 } \
2607 UPDATE_HANDLER_TABLE(); \
2608 goto *handlersTable[instrumentation::kMainHandlerTable][Instruction::code]; \
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002609 }
2610#include "dex_instruction_list.h"
2611 DEX_INSTRUCTION_LIST(INSTRUMENTATION_INSTRUCTION_HANDLER)
2612#undef DEX_INSTRUCTION_LIST
2613#undef INSTRUMENTATION_INSTRUCTION_HANDLER
2614} // NOLINT(readability/fn_size)
2615
2616// Explicit definitions of ExecuteGotoImpl.
Mathieu Chartier90443472015-07-16 20:32:27 -07002617template SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR
Ian Rogerse94652f2014-12-02 11:13:19 -08002618JValue ExecuteGotoImpl<true, false>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002619 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -07002620template SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR
Ian Rogerse94652f2014-12-02 11:13:19 -08002621JValue ExecuteGotoImpl<false, false>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002622 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -07002623template SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -08002624JValue ExecuteGotoImpl<true, true>(Thread* self, const DexFile::CodeItem* code_item,
2625 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -07002626template SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -08002627JValue ExecuteGotoImpl<false, true>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002628 ShadowFrame& shadow_frame, JValue result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002629
2630} // namespace interpreter
2631} // namespace art
Colin Crosse84e4f72015-03-18 14:01:19 -07002632
2633#endif