blob: f365fd04f054acdb6a7592f1f4fb4c3ee481fa58 [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"
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +000025#include "jit/jit_instrumentation.h"
Ian Rogersf72a11d2014-10-30 15:41:08 -070026#include "safe_math.h"
Sebastien Hertz8ece0502013-08-07 11:26:41 +020027
Igor Murashkin6918bf12015-09-27 19:19:06 -070028#include <memory> // std::unique_ptr
29
Sebastien Hertz8ece0502013-08-07 11:26:41 +020030namespace art {
31namespace interpreter {
32
33// In the following macros, we expect the following local variables exist:
34// - "self": the current Thread*.
35// - "inst" : the current Instruction*.
Sebastien Hertz3b588e02013-09-11 14:33:18 +020036// - "inst_data" : the current instruction's first 16 bits.
Sebastien Hertz8ece0502013-08-07 11:26:41 +020037// - "dex_pc": the current pc.
38// - "shadow_frame": the current shadow frame.
Sebastien Hertz8ece0502013-08-07 11:26:41 +020039// - "currentHandlersTable": the current table of pointer to each instruction handler.
40
41// Advance to the next instruction and updates interpreter state.
Sebastien Hertz8ece0502013-08-07 11:26:41 +020042#define ADVANCE(_offset) \
43 do { \
44 int32_t disp = static_cast<int32_t>(_offset); \
45 inst = inst->RelativeAt(disp); \
46 dex_pc = static_cast<uint32_t>(static_cast<int32_t>(dex_pc) + disp); \
47 shadow_frame.SetDexPC(dex_pc); \
Ian Rogerse94652f2014-12-02 11:13:19 -080048 TraceExecution(shadow_frame, inst, dex_pc); \
Sebastien Hertz3b588e02013-09-11 14:33:18 +020049 inst_data = inst->Fetch16(0); \
50 goto *currentHandlersTable[inst->Opcode(inst_data)]; \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020051 } while (false)
52
53#define HANDLE_PENDING_EXCEPTION() goto exception_pending_label
54
55#define POSSIBLY_HANDLE_PENDING_EXCEPTION(_is_exception_pending, _offset) \
56 do { \
57 if (UNLIKELY(_is_exception_pending)) { \
58 HANDLE_PENDING_EXCEPTION(); \
59 } else { \
60 ADVANCE(_offset); \
61 } \
62 } while (false)
63
Sebastien Hertzee1997a2013-09-19 14:47:09 +020064#define UPDATE_HANDLER_TABLE() \
Mathieu Chartier2cebb242015-04-21 16:50:40 -070065 currentHandlersTable = handlersTable[ \
66 Runtime::Current()->GetInstrumentation()->GetInterpreterHandlerTable()]
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +020067
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +000068#define BRANCH_INSTRUMENTATION(offset) \
69 do { \
70 instrumentation->Branch(self, method, dex_pc, offset); \
71 JValue result; \
72 if (jit::Jit::MaybeDoOnStackReplacement(self, method, dex_pc, offset, &result)) { \
73 return result; \
74 } \
75 } while (false)
76
77#define HOTNESS_UPDATE() \
78 do { \
79 if (jit_instrumentation_cache != nullptr) { \
80 jit_instrumentation_cache->AddSamples(self, method, 1); \
81 } \
Mathieu Chartiere5f13e52015-02-24 09:37:21 -080082 } while (false)
83
Sebastien Hertz8ece0502013-08-07 11:26:41 +020084#define UNREACHABLE_CODE_CHECK() \
85 do { \
86 if (kIsDebugBuild) { \
87 LOG(FATAL) << "We should not be here !"; \
Ian Rogerse94652f2014-12-02 11:13:19 -080088 UNREACHABLE(); \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020089 } \
90 } while (false)
91
92#define HANDLE_INSTRUCTION_START(opcode) op_##opcode: // NOLINT(whitespace/labels)
93#define HANDLE_INSTRUCTION_END() UNREACHABLE_CODE_CHECK()
94
Igor Murashkin158f35c2015-06-10 15:55:30 -070095// Use with instructions labeled with kExperimental flag:
96#define HANDLE_EXPERIMENTAL_INSTRUCTION_START(opcode) \
97 HANDLE_INSTRUCTION_START(opcode); \
98 DCHECK(inst->IsExperimental()); \
Alex Lighteb7c1442015-08-31 13:17:42 -070099 if (Runtime::Current()->AreExperimentalFlagsEnabled(ExperimentalFlags::kLambdas)) {
Igor Murashkin158f35c2015-06-10 15:55:30 -0700100#define HANDLE_EXPERIMENTAL_INSTRUCTION_END() \
101 } else { \
102 UnexpectedOpcode(inst, shadow_frame); \
103 } HANDLE_INSTRUCTION_END();
104
Andreas Gampe03ec9302015-08-27 17:41:47 -0700105#define HANDLE_MONITOR_CHECKS() \
106 if (!shadow_frame.GetLockCountData(). \
107 CheckAllMonitorsReleasedOrThrow<do_assignability_check>(self)) { \
108 HANDLE_PENDING_EXCEPTION(); \
109 }
Igor Murashkin158f35c2015-06-10 15:55:30 -0700110
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200111/**
112 * Interpreter based on computed goto tables.
113 *
114 * Each instruction is associated to a handler. This handler is responsible for executing the
115 * instruction and jump to the next instruction's handler.
116 * In order to limit the cost of instrumentation, we have two handler tables:
117 * - the "main" handler table: it contains handlers for normal execution of each instruction without
118 * handling of instrumentation.
119 * - the "alternative" handler table: it contains alternative handlers which first handle
120 * instrumentation before jumping to the corresponding "normal" instruction's handler.
121 *
122 * When instrumentation is active, the interpreter uses the "alternative" handler table. Otherwise
123 * it uses the "main" handler table.
124 *
125 * The current handler table is the handler table being used by the interpreter. It is updated:
126 * - on backward branch (goto, if and switch instructions)
127 * - after invoke
128 * - when an exception is thrown.
129 * This allows to support an attaching debugger to an already running application for instance.
130 *
131 * For a fast handler table update, handler tables are stored in an array of handler tables. Each
132 * handler table is represented by the InterpreterHandlerTable enum which allows to associate it
133 * to an index in this array of handler tables ((see Instrumentation::GetInterpreterHandlerTable).
134 *
135 * Here's the current layout of this array of handler tables:
136 *
137 * ---------------------+---------------+
138 * | NOP | (handler for NOP instruction)
139 * +---------------+
140 * "main" | MOVE | (handler for MOVE instruction)
141 * handler table +---------------+
142 * | ... |
143 * +---------------+
144 * | UNUSED_FF | (handler for UNUSED_FF instruction)
145 * ---------------------+---------------+
146 * | NOP | (alternative handler for NOP instruction)
147 * +---------------+
148 * "alternative" | MOVE | (alternative handler for MOVE instruction)
149 * handler table +---------------+
150 * | ... |
151 * +---------------+
152 * | UNUSED_FF | (alternative handler for UNUSED_FF instruction)
153 * ---------------------+---------------+
154 *
155 */
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100156template<bool do_access_check, bool transaction_active>
Ian Rogerse94652f2014-12-02 11:13:19 -0800157JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowFrame& shadow_frame,
158 JValue result_register) {
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200159 // Define handler tables:
160 // - The main handler table contains execution handlers for each instruction.
161 // - The alternative handler table contains prelude handlers which check for thread suspend and
162 // manage instrumentation before jumping to the execution handler.
163 static const void* const handlersTable[instrumentation::kNumHandlerTables][kNumPackedOpcodes] = {
164 {
165 // Main handler table.
166#define INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) &&op_##code,
167#include "dex_instruction_list.h"
168 DEX_INSTRUCTION_LIST(INSTRUCTION_HANDLER)
169#undef DEX_INSTRUCTION_LIST
170#undef INSTRUCTION_HANDLER
171 }, {
172 // Alternative handler table.
173#define INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) &&alt_op_##code,
174#include "dex_instruction_list.h"
175 DEX_INSTRUCTION_LIST(INSTRUCTION_HANDLER)
176#undef DEX_INSTRUCTION_LIST
177#undef INSTRUCTION_HANDLER
178 }
179 };
180
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800181 constexpr bool do_assignability_check = do_access_check;
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200182 if (UNLIKELY(!shadow_frame.HasReferenceArray())) {
183 LOG(FATAL) << "Invalid shadow frame for interpreter use";
184 return JValue();
185 }
186 self->VerifyStack();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200187
188 uint32_t dex_pc = shadow_frame.GetDexPC();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200189 const Instruction* inst = Instruction::At(code_item->insns_ + dex_pc);
190 uint16_t inst_data;
191 const void* const* currentHandlersTable;
192 UPDATE_HANDLER_TABLE();
Igor Murashkin6918bf12015-09-27 19:19:06 -0700193 std::unique_ptr<lambda::ClosureBuilder> lambda_closure_builder;
194 size_t lambda_captured_variable_index = 0;
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000195 const auto* const instrumentation = Runtime::Current()->GetInstrumentation();
196 ArtMethod* method = shadow_frame.GetMethod();
197 jit::Jit* jit = Runtime::Current()->GetJit();
198 jit::JitInstrumentationCache* jit_instrumentation_cache = nullptr;
199 if (jit != nullptr) {
200 jit_instrumentation_cache = jit->GetInstrumentationCache();
201 }
Igor Murashkin6918bf12015-09-27 19:19:06 -0700202
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200203 // Jump to first instruction.
204 ADVANCE(0);
205 UNREACHABLE_CODE_CHECK();
206
207 HANDLE_INSTRUCTION_START(NOP)
208 ADVANCE(1);
209 HANDLE_INSTRUCTION_END();
210
211 HANDLE_INSTRUCTION_START(MOVE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200212 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
213 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200214 ADVANCE(1);
215 HANDLE_INSTRUCTION_END();
216
217 HANDLE_INSTRUCTION_START(MOVE_FROM16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200218 shadow_frame.SetVReg(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200219 shadow_frame.GetVReg(inst->VRegB_22x()));
220 ADVANCE(2);
221 HANDLE_INSTRUCTION_END();
222
223 HANDLE_INSTRUCTION_START(MOVE_16)
224 shadow_frame.SetVReg(inst->VRegA_32x(),
225 shadow_frame.GetVReg(inst->VRegB_32x()));
226 ADVANCE(3);
227 HANDLE_INSTRUCTION_END();
228
229 HANDLE_INSTRUCTION_START(MOVE_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200230 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data),
231 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200232 ADVANCE(1);
233 HANDLE_INSTRUCTION_END();
234
235 HANDLE_INSTRUCTION_START(MOVE_WIDE_FROM16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200236 shadow_frame.SetVRegLong(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200237 shadow_frame.GetVRegLong(inst->VRegB_22x()));
238 ADVANCE(2);
239 HANDLE_INSTRUCTION_END();
240
241 HANDLE_INSTRUCTION_START(MOVE_WIDE_16)
242 shadow_frame.SetVRegLong(inst->VRegA_32x(),
243 shadow_frame.GetVRegLong(inst->VRegB_32x()));
244 ADVANCE(3);
245 HANDLE_INSTRUCTION_END();
246
247 HANDLE_INSTRUCTION_START(MOVE_OBJECT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200248 shadow_frame.SetVRegReference(inst->VRegA_12x(inst_data),
249 shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200250 ADVANCE(1);
251 HANDLE_INSTRUCTION_END();
252
253 HANDLE_INSTRUCTION_START(MOVE_OBJECT_FROM16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200254 shadow_frame.SetVRegReference(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200255 shadow_frame.GetVRegReference(inst->VRegB_22x()));
256 ADVANCE(2);
257 HANDLE_INSTRUCTION_END();
258
259 HANDLE_INSTRUCTION_START(MOVE_OBJECT_16)
260 shadow_frame.SetVRegReference(inst->VRegA_32x(),
261 shadow_frame.GetVRegReference(inst->VRegB_32x()));
262 ADVANCE(3);
263 HANDLE_INSTRUCTION_END();
264
265 HANDLE_INSTRUCTION_START(MOVE_RESULT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200266 shadow_frame.SetVReg(inst->VRegA_11x(inst_data), result_register.GetI());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200267 ADVANCE(1);
268 HANDLE_INSTRUCTION_END();
269
270 HANDLE_INSTRUCTION_START(MOVE_RESULT_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200271 shadow_frame.SetVRegLong(inst->VRegA_11x(inst_data), result_register.GetJ());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200272 ADVANCE(1);
273 HANDLE_INSTRUCTION_END();
274
275 HANDLE_INSTRUCTION_START(MOVE_RESULT_OBJECT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200276 shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), result_register.GetL());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200277 ADVANCE(1);
278 HANDLE_INSTRUCTION_END();
279
280 HANDLE_INSTRUCTION_START(MOVE_EXCEPTION) {
Nicolas Geoffray14691c52015-03-05 10:40:17 +0000281 Throwable* exception = self->GetException();
Sebastien Hertz270a0e12015-01-16 19:49:09 +0100282 DCHECK(exception != nullptr) << "No pending exception on MOVE_EXCEPTION instruction";
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200283 shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), exception);
Sebastien Hertz5c004902014-05-21 10:07:42 +0200284 self->ClearException();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200285 ADVANCE(1);
286 }
287 HANDLE_INSTRUCTION_END();
288
Mathieu Chartierd7cbf8a2015-03-19 12:43:20 -0700289 HANDLE_INSTRUCTION_START(RETURN_VOID_NO_BARRIER) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200290 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700291 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700292 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200293 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200294 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200295 shadow_frame.GetMethod(), dex_pc,
296 result);
297 }
298 return result;
299 }
300 HANDLE_INSTRUCTION_END();
301
Mathieu Chartierd7cbf8a2015-03-19 12:43:20 -0700302 HANDLE_INSTRUCTION_START(RETURN_VOID) {
Hans Boehm30359612014-05-21 17:46:23 -0700303 QuasiAtomic::ThreadFenceForConstructor();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200304 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700305 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700306 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200307 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200308 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200309 shadow_frame.GetMethod(), dex_pc,
310 result);
311 }
312 return result;
313 }
314 HANDLE_INSTRUCTION_END();
315
316 HANDLE_INSTRUCTION_START(RETURN) {
317 JValue result;
318 result.SetJ(0);
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200319 result.SetI(shadow_frame.GetVReg(inst->VRegA_11x(inst_data)));
Ian Rogers7b078e82014-09-10 14:44:24 -0700320 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700321 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200322 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200323 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200324 shadow_frame.GetMethod(), dex_pc,
325 result);
326 }
327 return result;
328 }
329 HANDLE_INSTRUCTION_END();
330
331 HANDLE_INSTRUCTION_START(RETURN_WIDE) {
332 JValue result;
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200333 result.SetJ(shadow_frame.GetVRegLong(inst->VRegA_11x(inst_data)));
Ian Rogers7b078e82014-09-10 14:44:24 -0700334 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700335 HANDLE_MONITOR_CHECKS();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200336 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200337 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200338 shadow_frame.GetMethod(), dex_pc,
339 result);
340 }
341 return result;
342 }
343 HANDLE_INSTRUCTION_END();
344
345 HANDLE_INSTRUCTION_START(RETURN_OBJECT) {
346 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700347 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700348 HANDLE_MONITOR_CHECKS();
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700349 const uint8_t vreg_index = inst->VRegA_11x(inst_data);
350 Object* obj_result = shadow_frame.GetVRegReference(vreg_index);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700351 if (do_assignability_check && obj_result != nullptr) {
Vladimir Marko05792b92015-08-03 11:56:49 +0100352 size_t pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
353 Class* return_type = shadow_frame.GetMethod()->GetReturnType(true /* resolve */,
354 pointer_size);
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700355 obj_result = shadow_frame.GetVRegReference(vreg_index);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700356 if (return_type == nullptr) {
Jeff Haoa3faaf42013-09-03 19:07:00 -0700357 // Return the pending exception.
358 HANDLE_PENDING_EXCEPTION();
359 }
360 if (!obj_result->VerifierInstanceOf(return_type)) {
361 // This should never happen.
Ian Rogers1ff3c982014-08-12 02:30:58 -0700362 std::string temp1, temp2;
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000363 self->ThrowNewExceptionF("Ljava/lang/VirtualMachineError;",
Jeff Haoa3faaf42013-09-03 19:07:00 -0700364 "Returning '%s' that is not instance of return type '%s'",
Ian Rogers1ff3c982014-08-12 02:30:58 -0700365 obj_result->GetClass()->GetDescriptor(&temp1),
366 return_type->GetDescriptor(&temp2));
Jeff Haoa3faaf42013-09-03 19:07:00 -0700367 HANDLE_PENDING_EXCEPTION();
368 }
369 }
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700370 result.SetL(obj_result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200371 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200372 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200373 shadow_frame.GetMethod(), dex_pc,
374 result);
375 }
376 return result;
377 }
378 HANDLE_INSTRUCTION_END();
379
380 HANDLE_INSTRUCTION_START(CONST_4) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200381 uint32_t dst = inst->VRegA_11n(inst_data);
382 int32_t val = inst->VRegB_11n(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200383 shadow_frame.SetVReg(dst, val);
384 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700385 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200386 }
387 ADVANCE(1);
388 }
389 HANDLE_INSTRUCTION_END();
390
391 HANDLE_INSTRUCTION_START(CONST_16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200392 uint32_t dst = inst->VRegA_21s(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200393 int32_t val = inst->VRegB_21s();
394 shadow_frame.SetVReg(dst, val);
395 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700396 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200397 }
398 ADVANCE(2);
399 }
400 HANDLE_INSTRUCTION_END();
401
402 HANDLE_INSTRUCTION_START(CONST) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200403 uint32_t dst = inst->VRegA_31i(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200404 int32_t val = inst->VRegB_31i();
405 shadow_frame.SetVReg(dst, val);
406 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700407 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200408 }
409 ADVANCE(3);
410 }
411 HANDLE_INSTRUCTION_END();
412
413 HANDLE_INSTRUCTION_START(CONST_HIGH16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200414 uint32_t dst = inst->VRegA_21h(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200415 int32_t val = static_cast<int32_t>(inst->VRegB_21h() << 16);
416 shadow_frame.SetVReg(dst, val);
417 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700418 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200419 }
420 ADVANCE(2);
421 }
422 HANDLE_INSTRUCTION_END();
423
424 HANDLE_INSTRUCTION_START(CONST_WIDE_16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200425 shadow_frame.SetVRegLong(inst->VRegA_21s(inst_data), inst->VRegB_21s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200426 ADVANCE(2);
427 HANDLE_INSTRUCTION_END();
428
429 HANDLE_INSTRUCTION_START(CONST_WIDE_32)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200430 shadow_frame.SetVRegLong(inst->VRegA_31i(inst_data), inst->VRegB_31i());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200431 ADVANCE(3);
432 HANDLE_INSTRUCTION_END();
433
434 HANDLE_INSTRUCTION_START(CONST_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200435 shadow_frame.SetVRegLong(inst->VRegA_51l(inst_data), inst->VRegB_51l());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200436 ADVANCE(5);
437 HANDLE_INSTRUCTION_END();
438
439 HANDLE_INSTRUCTION_START(CONST_WIDE_HIGH16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200440 shadow_frame.SetVRegLong(inst->VRegA_21h(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200441 static_cast<uint64_t>(inst->VRegB_21h()) << 48);
442 ADVANCE(2);
443 HANDLE_INSTRUCTION_END();
444
445 HANDLE_INSTRUCTION_START(CONST_STRING) {
Ian Rogers6786a582014-10-28 12:49:06 -0700446 String* s = ResolveString(self, shadow_frame, inst->VRegB_21c());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700447 if (UNLIKELY(s == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200448 HANDLE_PENDING_EXCEPTION();
449 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200450 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200451 ADVANCE(2);
452 }
453 }
454 HANDLE_INSTRUCTION_END();
455
456 HANDLE_INSTRUCTION_START(CONST_STRING_JUMBO) {
Ian Rogers6786a582014-10-28 12:49:06 -0700457 String* s = ResolveString(self, shadow_frame, inst->VRegB_31c());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700458 if (UNLIKELY(s == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200459 HANDLE_PENDING_EXCEPTION();
460 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200461 shadow_frame.SetVRegReference(inst->VRegA_31c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200462 ADVANCE(3);
463 }
464 }
465 HANDLE_INSTRUCTION_END();
466
467 HANDLE_INSTRUCTION_START(CONST_CLASS) {
468 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
469 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700470 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200471 HANDLE_PENDING_EXCEPTION();
472 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200473 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), c);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200474 ADVANCE(2);
475 }
476 }
477 HANDLE_INSTRUCTION_END();
478
479 HANDLE_INSTRUCTION_START(MONITOR_ENTER) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200480 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700481 if (UNLIKELY(obj == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000482 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200483 HANDLE_PENDING_EXCEPTION();
484 } else {
Andreas Gampe03ec9302015-08-27 17:41:47 -0700485 DoMonitorEnter<do_access_check>(self, &shadow_frame, obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200486 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), 1);
487 }
488 }
489 HANDLE_INSTRUCTION_END();
490
491 HANDLE_INSTRUCTION_START(MONITOR_EXIT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200492 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700493 if (UNLIKELY(obj == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000494 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200495 HANDLE_PENDING_EXCEPTION();
496 } else {
Andreas Gampe03ec9302015-08-27 17:41:47 -0700497 DoMonitorExit<do_access_check>(self, &shadow_frame, obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200498 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), 1);
499 }
500 }
501 HANDLE_INSTRUCTION_END();
502
503 HANDLE_INSTRUCTION_START(CHECK_CAST) {
504 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
505 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700506 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200507 HANDLE_PENDING_EXCEPTION();
508 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200509 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_21c(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700510 if (UNLIKELY(obj != nullptr && !obj->InstanceOf(c))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200511 ThrowClassCastException(c, obj->GetClass());
512 HANDLE_PENDING_EXCEPTION();
513 } else {
514 ADVANCE(2);
515 }
516 }
517 }
518 HANDLE_INSTRUCTION_END();
519
520 HANDLE_INSTRUCTION_START(INSTANCE_OF) {
521 Class* c = ResolveVerifyAndClinit(inst->VRegC_22c(), shadow_frame.GetMethod(),
522 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700523 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200524 HANDLE_PENDING_EXCEPTION();
525 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200526 Object* obj = shadow_frame.GetVRegReference(inst->VRegB_22c(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700527 shadow_frame.SetVReg(inst->VRegA_22c(inst_data), (obj != nullptr && obj->InstanceOf(c)) ? 1 : 0);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200528 ADVANCE(2);
529 }
530 }
531 HANDLE_INSTRUCTION_END();
532
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700533 HANDLE_INSTRUCTION_START(ARRAY_LENGTH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200534 Object* array = shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700535 if (UNLIKELY(array == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000536 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200537 HANDLE_PENDING_EXCEPTION();
538 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200539 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), array->AsArray()->GetLength());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200540 ADVANCE(1);
541 }
542 }
543 HANDLE_INSTRUCTION_END();
544
545 HANDLE_INSTRUCTION_START(NEW_INSTANCE) {
Jeff Hao848f70a2014-01-15 13:49:50 -0800546 Object* obj = nullptr;
547 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
548 self, false, do_access_check);
549 if (LIKELY(c != nullptr)) {
550 if (UNLIKELY(c->IsStringClass())) {
551 gc::AllocatorType allocator_type = Runtime::Current()->GetHeap()->GetCurrentAllocator();
552 mirror::SetStringCountVisitor visitor(0);
553 obj = String::Alloc<true>(self, 0, allocator_type, visitor);
554 } else {
555 obj = AllocObjectFromCode<do_access_check, true>(
556 inst->VRegB_21c(), shadow_frame.GetMethod(), self,
557 Runtime::Current()->GetHeap()->GetCurrentAllocator());
558 }
559 }
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700560 if (UNLIKELY(obj == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200561 HANDLE_PENDING_EXCEPTION();
562 } else {
Sebastien Hertz4e99b3d2014-06-24 14:35:40 +0200563 obj->GetClass()->AssertInitializedOrInitializingInThread(self);
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700564 // Don't allow finalizable objects to be allocated during a transaction since these can't be
565 // finalized without a started runtime.
566 if (transaction_active && obj->GetClass()->IsFinalizable()) {
Sebastien Hertz45b15972015-04-03 16:07:05 +0200567 AbortTransactionF(self, "Allocating finalizable object in transaction: %s",
568 PrettyTypeOf(obj).c_str());
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700569 HANDLE_PENDING_EXCEPTION();
570 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200571 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200572 ADVANCE(2);
573 }
574 }
575 HANDLE_INSTRUCTION_END();
576
577 HANDLE_INSTRUCTION_START(NEW_ARRAY) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200578 int32_t length = shadow_frame.GetVReg(inst->VRegB_22c(inst_data));
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800579 Object* obj = AllocArrayFromCode<do_access_check, true>(
Andreas Gampe1cc7dba2014-12-17 18:43:01 -0800580 inst->VRegC_22c(), length, shadow_frame.GetMethod(), self,
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800581 Runtime::Current()->GetHeap()->GetCurrentAllocator());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700582 if (UNLIKELY(obj == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200583 HANDLE_PENDING_EXCEPTION();
584 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200585 shadow_frame.SetVRegReference(inst->VRegA_22c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200586 ADVANCE(2);
587 }
588 }
589 HANDLE_INSTRUCTION_END();
590
591 HANDLE_INSTRUCTION_START(FILLED_NEW_ARRAY) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100592 bool success =
593 DoFilledNewArray<false, do_access_check, transaction_active>(inst, shadow_frame,
594 self, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200595 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
596 }
597 HANDLE_INSTRUCTION_END();
598
599 HANDLE_INSTRUCTION_START(FILLED_NEW_ARRAY_RANGE) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100600 bool success =
601 DoFilledNewArray<true, do_access_check, transaction_active>(inst, shadow_frame,
602 self, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200603 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
604 }
605 HANDLE_INSTRUCTION_END();
606
607 HANDLE_INSTRUCTION_START(FILL_ARRAY_DATA) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200608 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_31t(inst_data));
Ian Rogers832336b2014-10-08 15:35:22 -0700609 const uint16_t* payload_addr = reinterpret_cast<const uint16_t*>(inst) + inst->VRegB_31t();
610 const Instruction::ArrayDataPayload* payload =
611 reinterpret_cast<const Instruction::ArrayDataPayload*>(payload_addr);
612 bool success = FillArrayData(obj, payload);
613 if (transaction_active && success) {
614 RecordArrayElementsInTransaction(obj->AsArray(), payload->element_count);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200615 }
Ian Rogers832336b2014-10-08 15:35:22 -0700616 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200617 }
618 HANDLE_INSTRUCTION_END();
619
620 HANDLE_INSTRUCTION_START(THROW) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200621 Object* exception = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700622 if (UNLIKELY(exception == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000623 ThrowNullPointerException("throw with null exception");
Jeff Haoa3faaf42013-09-03 19:07:00 -0700624 } else if (do_assignability_check && !exception->GetClass()->IsThrowableClass()) {
625 // This should never happen.
Ian Rogers1ff3c982014-08-12 02:30:58 -0700626 std::string temp;
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000627 self->ThrowNewExceptionF("Ljava/lang/VirtualMachineError;",
Jeff Haoa3faaf42013-09-03 19:07:00 -0700628 "Throwing '%s' that is not instance of Throwable",
Ian Rogers1ff3c982014-08-12 02:30:58 -0700629 exception->GetClass()->GetDescriptor(&temp));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200630 } else {
Nicolas Geoffray14691c52015-03-05 10:40:17 +0000631 self->SetException(exception->AsThrowable());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200632 }
633 HANDLE_PENDING_EXCEPTION();
634 }
635 HANDLE_INSTRUCTION_END();
636
637 HANDLE_INSTRUCTION_START(GOTO) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200638 int8_t offset = inst->VRegA_10t(inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000639 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200640 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000641 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200642 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700643 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200644 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200645 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200646 }
647 ADVANCE(offset);
648 }
649 HANDLE_INSTRUCTION_END();
650
651 HANDLE_INSTRUCTION_START(GOTO_16) {
652 int16_t offset = inst->VRegA_20t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000653 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200654 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000655 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200656 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700657 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200658 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200659 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200660 }
661 ADVANCE(offset);
662 }
663 HANDLE_INSTRUCTION_END();
664
665 HANDLE_INSTRUCTION_START(GOTO_32) {
666 int32_t offset = inst->VRegA_30t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000667 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200668 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000669 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200670 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700671 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200672 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200673 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200674 }
675 ADVANCE(offset);
676 }
677 HANDLE_INSTRUCTION_END();
678
679 HANDLE_INSTRUCTION_START(PACKED_SWITCH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200680 int32_t offset = DoPackedSwitch(inst, shadow_frame, inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000681 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200682 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000683 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200684 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700685 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200686 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200687 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200688 }
689 ADVANCE(offset);
690 }
691 HANDLE_INSTRUCTION_END();
692
693 HANDLE_INSTRUCTION_START(SPARSE_SWITCH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200694 int32_t offset = DoSparseSwitch(inst, shadow_frame, inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000695 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200696 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000697 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200698 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700699 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200700 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200701 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200702 }
703 ADVANCE(offset);
704 }
705 HANDLE_INSTRUCTION_END();
706
Ian Rogers647b1a82014-10-10 11:02:11 -0700707#if defined(__clang__)
708#pragma clang diagnostic push
709#pragma clang diagnostic ignored "-Wfloat-equal"
710#endif
711
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200712 HANDLE_INSTRUCTION_START(CMPL_FLOAT) {
713 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
714 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
715 int32_t result;
716 if (val1 > val2) {
717 result = 1;
718 } else if (val1 == val2) {
719 result = 0;
720 } else {
721 result = -1;
722 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200723 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200724 ADVANCE(2);
725 }
726 HANDLE_INSTRUCTION_END();
727
728 HANDLE_INSTRUCTION_START(CMPG_FLOAT) {
729 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
730 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
731 int32_t result;
732 if (val1 < val2) {
733 result = -1;
734 } else if (val1 == val2) {
735 result = 0;
736 } else {
737 result = 1;
738 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200739 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200740 ADVANCE(2);
741 }
742 HANDLE_INSTRUCTION_END();
743
744 HANDLE_INSTRUCTION_START(CMPL_DOUBLE) {
745 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
746 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
747 int32_t result;
748 if (val1 > val2) {
749 result = 1;
750 } else if (val1 == val2) {
751 result = 0;
752 } else {
753 result = -1;
754 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200755 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200756 ADVANCE(2);
757 }
758 HANDLE_INSTRUCTION_END();
759
760 HANDLE_INSTRUCTION_START(CMPG_DOUBLE) {
761 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
762 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
763 int32_t result;
764 if (val1 < val2) {
765 result = -1;
766 } else if (val1 == val2) {
767 result = 0;
768 } else {
769 result = 1;
770 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200771 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200772 ADVANCE(2);
773 }
774 HANDLE_INSTRUCTION_END();
775
Ian Rogers647b1a82014-10-10 11:02:11 -0700776#if defined(__clang__)
777#pragma clang diagnostic pop
778#endif
779
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200780 HANDLE_INSTRUCTION_START(CMP_LONG) {
781 int64_t val1 = shadow_frame.GetVRegLong(inst->VRegB_23x());
782 int64_t val2 = shadow_frame.GetVRegLong(inst->VRegC_23x());
783 int32_t result;
784 if (val1 > val2) {
785 result = 1;
786 } else if (val1 == val2) {
787 result = 0;
788 } else {
789 result = -1;
790 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200791 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200792 ADVANCE(2);
793 }
794 HANDLE_INSTRUCTION_END();
795
796 HANDLE_INSTRUCTION_START(IF_EQ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200797 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) == shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200798 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000799 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200800 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000801 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200802 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700803 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200804 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200805 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200806 }
807 ADVANCE(offset);
808 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800809 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200810 ADVANCE(2);
811 }
812 }
813 HANDLE_INSTRUCTION_END();
814
815 HANDLE_INSTRUCTION_START(IF_NE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700816 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) !=
817 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200818 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000819 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200820 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000821 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200822 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700823 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200824 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200825 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200826 }
827 ADVANCE(offset);
828 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800829 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200830 ADVANCE(2);
831 }
832 }
833 HANDLE_INSTRUCTION_END();
834
835 HANDLE_INSTRUCTION_START(IF_LT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700836 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <
837 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200838 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000839 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200840 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000841 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200842 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700843 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200844 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200845 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200846 }
847 ADVANCE(offset);
848 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800849 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200850 ADVANCE(2);
851 }
852 }
853 HANDLE_INSTRUCTION_END();
854
855 HANDLE_INSTRUCTION_START(IF_GE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700856 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >=
857 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200858 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000859 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200860 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000861 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200862 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700863 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200864 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200865 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200866 }
867 ADVANCE(offset);
868 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800869 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200870 ADVANCE(2);
871 }
872 }
873 HANDLE_INSTRUCTION_END();
874
875 HANDLE_INSTRUCTION_START(IF_GT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700876 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >
877 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200878 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000879 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200880 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000881 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200882 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700883 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200884 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200885 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200886 }
887 ADVANCE(offset);
888 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800889 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200890 ADVANCE(2);
891 }
892 }
893 HANDLE_INSTRUCTION_END();
894
895 HANDLE_INSTRUCTION_START(IF_LE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700896 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <=
897 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200898 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000899 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200900 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000901 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200902 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700903 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200904 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200905 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200906 }
907 ADVANCE(offset);
908 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800909 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200910 ADVANCE(2);
911 }
912 }
913 HANDLE_INSTRUCTION_END();
914
915 HANDLE_INSTRUCTION_START(IF_EQZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200916 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) == 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200917 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000918 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200919 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000920 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200921 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700922 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200923 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200924 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200925 }
926 ADVANCE(offset);
927 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800928 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200929 ADVANCE(2);
930 }
931 }
932 HANDLE_INSTRUCTION_END();
933
934 HANDLE_INSTRUCTION_START(IF_NEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200935 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) != 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200936 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000937 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200938 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000939 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200940 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700941 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200942 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200943 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200944 }
945 ADVANCE(offset);
946 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800947 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200948 ADVANCE(2);
949 }
950 }
951 HANDLE_INSTRUCTION_END();
952
953 HANDLE_INSTRUCTION_START(IF_LTZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200954 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) < 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200955 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000956 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200957 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000958 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200959 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700960 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200961 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200962 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200963 }
964 ADVANCE(offset);
965 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800966 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200967 ADVANCE(2);
968 }
969 }
970 HANDLE_INSTRUCTION_END();
971
972 HANDLE_INSTRUCTION_START(IF_GEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200973 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) >= 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200974 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000975 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200976 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000977 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200978 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700979 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200980 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200981 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200982 }
983 ADVANCE(offset);
984 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800985 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200986 ADVANCE(2);
987 }
988 }
989 HANDLE_INSTRUCTION_END();
990
991 HANDLE_INSTRUCTION_START(IF_GTZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200992 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) > 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200993 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000994 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200995 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000996 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200997 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700998 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200999 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02001000 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001001 }
1002 ADVANCE(offset);
1003 } else {
buzbeef1dcacc2016-02-24 14:24:24 -08001004 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001005 ADVANCE(2);
1006 }
1007 }
1008 HANDLE_INSTRUCTION_END();
1009
1010 HANDLE_INSTRUCTION_START(IF_LEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001011 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) <= 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001012 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +00001013 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001014 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +00001015 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02001016 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -07001017 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +02001018 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02001019 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001020 }
1021 ADVANCE(offset);
1022 } else {
buzbeef1dcacc2016-02-24 14:24:24 -08001023 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001024 ADVANCE(2);
1025 }
1026 }
1027 HANDLE_INSTRUCTION_END();
1028
1029 HANDLE_INSTRUCTION_START(AGET_BOOLEAN) {
1030 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001031 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001032 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001033 HANDLE_PENDING_EXCEPTION();
1034 } else {
1035 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1036 BooleanArray* array = a->AsBooleanArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001037 if (LIKELY(array->CheckIsValidIndex(index))) {
1038 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001039 ADVANCE(2);
1040 } else {
1041 HANDLE_PENDING_EXCEPTION();
1042 }
1043 }
1044 }
1045 HANDLE_INSTRUCTION_END();
1046
1047 HANDLE_INSTRUCTION_START(AGET_BYTE) {
1048 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001049 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001050 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001051 HANDLE_PENDING_EXCEPTION();
1052 } else {
1053 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1054 ByteArray* array = a->AsByteArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001055 if (LIKELY(array->CheckIsValidIndex(index))) {
1056 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001057 ADVANCE(2);
1058 } else {
1059 HANDLE_PENDING_EXCEPTION();
1060 }
1061 }
1062 }
1063 HANDLE_INSTRUCTION_END();
1064
1065 HANDLE_INSTRUCTION_START(AGET_CHAR) {
1066 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001067 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001068 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001069 HANDLE_PENDING_EXCEPTION();
1070 } else {
1071 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1072 CharArray* array = a->AsCharArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001073 if (LIKELY(array->CheckIsValidIndex(index))) {
1074 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001075 ADVANCE(2);
1076 } else {
1077 HANDLE_PENDING_EXCEPTION();
1078 }
1079 }
1080 }
1081 HANDLE_INSTRUCTION_END();
1082
1083 HANDLE_INSTRUCTION_START(AGET_SHORT) {
1084 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001085 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001086 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001087 HANDLE_PENDING_EXCEPTION();
1088 } else {
1089 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1090 ShortArray* array = a->AsShortArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001091 if (LIKELY(array->CheckIsValidIndex(index))) {
1092 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001093 ADVANCE(2);
1094 } else {
1095 HANDLE_PENDING_EXCEPTION();
1096 }
1097 }
1098 }
1099 HANDLE_INSTRUCTION_END();
1100
1101 HANDLE_INSTRUCTION_START(AGET) {
1102 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001103 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001104 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001105 HANDLE_PENDING_EXCEPTION();
1106 } else {
1107 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001108 DCHECK(a->IsIntArray() || a->IsFloatArray()) << PrettyTypeOf(a);
1109 auto* array = down_cast<IntArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001110 if (LIKELY(array->CheckIsValidIndex(index))) {
1111 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001112 ADVANCE(2);
1113 } else {
1114 HANDLE_PENDING_EXCEPTION();
1115 }
1116 }
1117 }
1118 HANDLE_INSTRUCTION_END();
1119
1120 HANDLE_INSTRUCTION_START(AGET_WIDE) {
1121 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001122 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001123 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001124 HANDLE_PENDING_EXCEPTION();
1125 } else {
1126 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001127 DCHECK(a->IsLongArray() || a->IsDoubleArray()) << PrettyTypeOf(a);
1128 auto* array = down_cast<LongArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001129 if (LIKELY(array->CheckIsValidIndex(index))) {
1130 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001131 ADVANCE(2);
1132 } else {
1133 HANDLE_PENDING_EXCEPTION();
1134 }
1135 }
1136 }
1137 HANDLE_INSTRUCTION_END();
1138
1139 HANDLE_INSTRUCTION_START(AGET_OBJECT) {
1140 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001141 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001142 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001143 HANDLE_PENDING_EXCEPTION();
1144 } else {
1145 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1146 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001147 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001148 shadow_frame.SetVRegReference(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001149 ADVANCE(2);
1150 } else {
1151 HANDLE_PENDING_EXCEPTION();
1152 }
1153 }
1154 }
1155 HANDLE_INSTRUCTION_END();
1156
1157 HANDLE_INSTRUCTION_START(APUT_BOOLEAN) {
1158 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001159 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001160 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001161 HANDLE_PENDING_EXCEPTION();
1162 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001163 uint8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001164 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1165 BooleanArray* array = a->AsBooleanArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001166 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001167 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001168 ADVANCE(2);
1169 } else {
1170 HANDLE_PENDING_EXCEPTION();
1171 }
1172 }
1173 }
1174 HANDLE_INSTRUCTION_END();
1175
1176 HANDLE_INSTRUCTION_START(APUT_BYTE) {
1177 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001178 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001179 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001180 HANDLE_PENDING_EXCEPTION();
1181 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001182 int8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001183 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1184 ByteArray* array = a->AsByteArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001185 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001186 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001187 ADVANCE(2);
1188 } else {
1189 HANDLE_PENDING_EXCEPTION();
1190 }
1191 }
1192 }
1193 HANDLE_INSTRUCTION_END();
1194
1195 HANDLE_INSTRUCTION_START(APUT_CHAR) {
1196 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001197 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001198 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001199 HANDLE_PENDING_EXCEPTION();
1200 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001201 uint16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001202 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1203 CharArray* array = a->AsCharArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001204 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001205 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001206 ADVANCE(2);
1207 } else {
1208 HANDLE_PENDING_EXCEPTION();
1209 }
1210 }
1211 }
1212 HANDLE_INSTRUCTION_END();
1213
1214 HANDLE_INSTRUCTION_START(APUT_SHORT) {
1215 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001216 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001217 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001218 HANDLE_PENDING_EXCEPTION();
1219 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001220 int16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001221 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1222 ShortArray* array = a->AsShortArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001223 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001224 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001225 ADVANCE(2);
1226 } else {
1227 HANDLE_PENDING_EXCEPTION();
1228 }
1229 }
1230 }
1231 HANDLE_INSTRUCTION_END();
1232
1233 HANDLE_INSTRUCTION_START(APUT) {
1234 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001235 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001236 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001237 HANDLE_PENDING_EXCEPTION();
1238 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001239 int32_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001240 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001241 DCHECK(a->IsIntArray() || a->IsFloatArray()) << PrettyTypeOf(a);
1242 auto* array = down_cast<IntArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001243 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001244 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001245 ADVANCE(2);
1246 } else {
1247 HANDLE_PENDING_EXCEPTION();
1248 }
1249 }
1250 }
1251 HANDLE_INSTRUCTION_END();
1252
1253 HANDLE_INSTRUCTION_START(APUT_WIDE) {
1254 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001255 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001256 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001257 HANDLE_PENDING_EXCEPTION();
1258 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001259 int64_t val = shadow_frame.GetVRegLong(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001260 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001261 DCHECK(a->IsLongArray() || a->IsDoubleArray()) << PrettyTypeOf(a);
1262 auto* array = down_cast<LongArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001263 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001264 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001265 ADVANCE(2);
1266 } else {
1267 HANDLE_PENDING_EXCEPTION();
1268 }
1269 }
1270 }
1271 HANDLE_INSTRUCTION_END();
1272
1273 HANDLE_INSTRUCTION_START(APUT_OBJECT) {
1274 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001275 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001276 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001277 HANDLE_PENDING_EXCEPTION();
1278 } else {
1279 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001280 Object* val = shadow_frame.GetVRegReference(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001281 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001282 if (LIKELY(array->CheckIsValidIndex(index) && array->CheckAssignable(val))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001283 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001284 ADVANCE(2);
1285 } else {
1286 HANDLE_PENDING_EXCEPTION();
1287 }
1288 }
1289 }
1290 HANDLE_INSTRUCTION_END();
1291
1292 HANDLE_INSTRUCTION_START(IGET_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001293 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimBoolean, do_access_check>(
1294 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001295 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1296 }
1297 HANDLE_INSTRUCTION_END();
1298
1299 HANDLE_INSTRUCTION_START(IGET_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001300 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimByte, do_access_check>(
1301 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001302 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1303 }
1304 HANDLE_INSTRUCTION_END();
1305
1306 HANDLE_INSTRUCTION_START(IGET_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001307 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimChar, do_access_check>(
1308 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001309 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1310 }
1311 HANDLE_INSTRUCTION_END();
1312
1313 HANDLE_INSTRUCTION_START(IGET_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001314 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimShort, do_access_check>(
1315 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001316 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1317 }
1318 HANDLE_INSTRUCTION_END();
1319
1320 HANDLE_INSTRUCTION_START(IGET) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001321 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimInt, do_access_check>(
1322 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001323 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1324 }
1325 HANDLE_INSTRUCTION_END();
1326
1327 HANDLE_INSTRUCTION_START(IGET_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001328 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimLong, do_access_check>(
1329 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001330 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1331 }
1332 HANDLE_INSTRUCTION_END();
1333
1334 HANDLE_INSTRUCTION_START(IGET_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001335 bool success = DoFieldGet<InstanceObjectRead, Primitive::kPrimNot, do_access_check>(
1336 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001337 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1338 }
1339 HANDLE_INSTRUCTION_END();
1340
1341 HANDLE_INSTRUCTION_START(IGET_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001342 bool success = DoIGetQuick<Primitive::kPrimInt>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001343 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1344 }
1345 HANDLE_INSTRUCTION_END();
1346
Mathieu Chartierffc605c2014-12-10 10:35:44 -08001347 HANDLE_INSTRUCTION_START(IGET_BOOLEAN_QUICK) {
1348 bool success = DoIGetQuick<Primitive::kPrimBoolean>(shadow_frame, inst, inst_data);
1349 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1350 }
1351 HANDLE_INSTRUCTION_END();
1352
1353 HANDLE_INSTRUCTION_START(IGET_BYTE_QUICK) {
1354 bool success = DoIGetQuick<Primitive::kPrimByte>(shadow_frame, inst, inst_data);
1355 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1356 }
1357 HANDLE_INSTRUCTION_END();
1358
1359 HANDLE_INSTRUCTION_START(IGET_CHAR_QUICK) {
1360 bool success = DoIGetQuick<Primitive::kPrimChar>(shadow_frame, inst, inst_data);
1361 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1362 }
1363 HANDLE_INSTRUCTION_END();
1364
1365 HANDLE_INSTRUCTION_START(IGET_SHORT_QUICK) {
1366 bool success = DoIGetQuick<Primitive::kPrimShort>(shadow_frame, inst, inst_data);
1367 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1368 }
1369 HANDLE_INSTRUCTION_END();
1370
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001371 HANDLE_INSTRUCTION_START(IGET_WIDE_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001372 bool success = DoIGetQuick<Primitive::kPrimLong>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001373 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1374 }
1375 HANDLE_INSTRUCTION_END();
1376
1377 HANDLE_INSTRUCTION_START(IGET_OBJECT_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001378 bool success = DoIGetQuick<Primitive::kPrimNot>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001379 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1380 }
1381 HANDLE_INSTRUCTION_END();
1382
1383 HANDLE_INSTRUCTION_START(SGET_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001384 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimBoolean, do_access_check>(
1385 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001386 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1387 }
1388 HANDLE_INSTRUCTION_END();
1389
1390 HANDLE_INSTRUCTION_START(SGET_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001391 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimByte, do_access_check>(
1392 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001393 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1394 }
1395 HANDLE_INSTRUCTION_END();
1396
1397 HANDLE_INSTRUCTION_START(SGET_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001398 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimChar, do_access_check>(
1399 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001400 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1401 }
1402 HANDLE_INSTRUCTION_END();
1403
1404 HANDLE_INSTRUCTION_START(SGET_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001405 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimShort, do_access_check>(
1406 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001407 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1408 }
1409 HANDLE_INSTRUCTION_END();
1410
1411 HANDLE_INSTRUCTION_START(SGET) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001412 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimInt, do_access_check>(
1413 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001414 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1415 }
1416 HANDLE_INSTRUCTION_END();
1417
1418 HANDLE_INSTRUCTION_START(SGET_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001419 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimLong, do_access_check>(
1420 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001421 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1422 }
1423 HANDLE_INSTRUCTION_END();
1424
1425 HANDLE_INSTRUCTION_START(SGET_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001426 bool success = DoFieldGet<StaticObjectRead, Primitive::kPrimNot, do_access_check>(
1427 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001428 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1429 }
1430 HANDLE_INSTRUCTION_END();
1431
1432 HANDLE_INSTRUCTION_START(IPUT_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001433 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimBoolean, do_access_check,
1434 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001435 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1436 }
1437 HANDLE_INSTRUCTION_END();
1438
1439 HANDLE_INSTRUCTION_START(IPUT_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001440 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimByte, do_access_check,
1441 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001442 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1443 }
1444 HANDLE_INSTRUCTION_END();
1445
1446 HANDLE_INSTRUCTION_START(IPUT_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001447 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimChar, do_access_check,
1448 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001449 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1450 }
1451 HANDLE_INSTRUCTION_END();
1452
1453 HANDLE_INSTRUCTION_START(IPUT_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001454 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimShort, do_access_check,
1455 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001456 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1457 }
1458 HANDLE_INSTRUCTION_END();
1459
1460 HANDLE_INSTRUCTION_START(IPUT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001461 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimInt, do_access_check,
1462 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001463 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1464 }
1465 HANDLE_INSTRUCTION_END();
1466
1467 HANDLE_INSTRUCTION_START(IPUT_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001468 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimLong, do_access_check,
1469 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001470 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1471 }
1472 HANDLE_INSTRUCTION_END();
1473
1474 HANDLE_INSTRUCTION_START(IPUT_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001475 bool success = DoFieldPut<InstanceObjectWrite, Primitive::kPrimNot, do_access_check,
1476 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001477 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1478 }
1479 HANDLE_INSTRUCTION_END();
1480
1481 HANDLE_INSTRUCTION_START(IPUT_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001482 bool success = DoIPutQuick<Primitive::kPrimInt, transaction_active>(
1483 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001484 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1485 }
1486 HANDLE_INSTRUCTION_END();
1487
Fred Shih37f05ef2014-07-16 18:38:08 -07001488 HANDLE_INSTRUCTION_START(IPUT_BOOLEAN_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001489 bool success = DoIPutQuick<Primitive::kPrimBoolean, transaction_active>(
1490 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001491 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1492 }
1493 HANDLE_INSTRUCTION_END();
1494
1495 HANDLE_INSTRUCTION_START(IPUT_BYTE_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001496 bool success = DoIPutQuick<Primitive::kPrimByte, transaction_active>(
1497 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001498 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1499 }
1500 HANDLE_INSTRUCTION_END();
1501
1502 HANDLE_INSTRUCTION_START(IPUT_CHAR_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001503 bool success = DoIPutQuick<Primitive::kPrimChar, transaction_active>(
1504 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001505 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1506 }
1507 HANDLE_INSTRUCTION_END();
1508
1509 HANDLE_INSTRUCTION_START(IPUT_SHORT_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001510 bool success = DoIPutQuick<Primitive::kPrimShort, transaction_active>(
1511 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001512 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1513 }
1514 HANDLE_INSTRUCTION_END();
1515
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001516 HANDLE_INSTRUCTION_START(IPUT_WIDE_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001517 bool success = DoIPutQuick<Primitive::kPrimLong, transaction_active>(
1518 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001519 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1520 }
1521 HANDLE_INSTRUCTION_END();
1522
1523 HANDLE_INSTRUCTION_START(IPUT_OBJECT_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001524 bool success = DoIPutQuick<Primitive::kPrimNot, transaction_active>(
1525 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001526 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1527 }
1528 HANDLE_INSTRUCTION_END();
1529
1530 HANDLE_INSTRUCTION_START(SPUT_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001531 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimBoolean, do_access_check,
1532 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001533 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1534 }
1535 HANDLE_INSTRUCTION_END();
1536
1537 HANDLE_INSTRUCTION_START(SPUT_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001538 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimByte, do_access_check,
1539 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001540 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1541 }
1542 HANDLE_INSTRUCTION_END();
1543
1544 HANDLE_INSTRUCTION_START(SPUT_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001545 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimChar, do_access_check,
1546 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001547 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1548 }
1549 HANDLE_INSTRUCTION_END();
1550
1551 HANDLE_INSTRUCTION_START(SPUT_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001552 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimShort, do_access_check,
1553 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001554 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1555 }
1556 HANDLE_INSTRUCTION_END();
1557
1558 HANDLE_INSTRUCTION_START(SPUT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001559 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimInt, do_access_check,
1560 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001561 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1562 }
1563 HANDLE_INSTRUCTION_END();
1564
1565 HANDLE_INSTRUCTION_START(SPUT_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001566 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimLong, do_access_check,
1567 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001568 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1569 }
1570 HANDLE_INSTRUCTION_END();
1571
1572 HANDLE_INSTRUCTION_START(SPUT_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001573 bool success = DoFieldPut<StaticObjectWrite, Primitive::kPrimNot, do_access_check,
1574 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001575 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1576 }
1577 HANDLE_INSTRUCTION_END();
1578
1579 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001580 bool success = DoInvoke<kVirtual, false, do_access_check>(
1581 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001582 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001583 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1584 }
1585 HANDLE_INSTRUCTION_END();
1586
1587 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001588 bool success = DoInvoke<kVirtual, true, do_access_check>(
1589 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001590 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001591 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1592 }
1593 HANDLE_INSTRUCTION_END();
1594
1595 HANDLE_INSTRUCTION_START(INVOKE_SUPER) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001596 bool success = DoInvoke<kSuper, false, do_access_check>(
1597 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001598 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001599 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1600 }
1601 HANDLE_INSTRUCTION_END();
1602
1603 HANDLE_INSTRUCTION_START(INVOKE_SUPER_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001604 bool success = DoInvoke<kSuper, true, do_access_check>(
1605 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001606 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001607 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1608 }
1609 HANDLE_INSTRUCTION_END();
1610
1611 HANDLE_INSTRUCTION_START(INVOKE_DIRECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001612 bool success = DoInvoke<kDirect, false, do_access_check>(
1613 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001614 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001615 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1616 }
1617 HANDLE_INSTRUCTION_END();
1618
1619 HANDLE_INSTRUCTION_START(INVOKE_DIRECT_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001620 bool success = DoInvoke<kDirect, true, do_access_check>(
1621 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001622 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001623 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1624 }
1625 HANDLE_INSTRUCTION_END();
1626
1627 HANDLE_INSTRUCTION_START(INVOKE_INTERFACE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001628 bool success = DoInvoke<kInterface, false, do_access_check>(
1629 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001630 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001631 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1632 }
1633 HANDLE_INSTRUCTION_END();
1634
1635 HANDLE_INSTRUCTION_START(INVOKE_INTERFACE_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001636 bool success = DoInvoke<kInterface, true, do_access_check>(
1637 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001638 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001639 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1640 }
1641 HANDLE_INSTRUCTION_END();
1642
1643 HANDLE_INSTRUCTION_START(INVOKE_STATIC) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001644 bool success = DoInvoke<kStatic, false, do_access_check>(
1645 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001646 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001647 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1648 }
1649 HANDLE_INSTRUCTION_END();
1650
1651 HANDLE_INSTRUCTION_START(INVOKE_STATIC_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001652 bool success = DoInvoke<kStatic, true, do_access_check>(
1653 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001654 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001655 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1656 }
1657 HANDLE_INSTRUCTION_END();
1658
1659 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001660 bool success = DoInvokeVirtualQuick<false>(
1661 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001662 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001663 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1664 }
1665 HANDLE_INSTRUCTION_END();
1666
1667 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001668 bool success = DoInvokeVirtualQuick<true>(
1669 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001670 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001671 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1672 }
1673 HANDLE_INSTRUCTION_END();
1674
Igor Murashkin158f35c2015-06-10 15:55:30 -07001675 HANDLE_EXPERIMENTAL_INSTRUCTION_START(INVOKE_LAMBDA) {
1676 bool success = DoInvokeLambda<do_access_check>(self, shadow_frame, inst, inst_data,
1677 &result_register);
1678 UPDATE_HANDLER_TABLE();
1679 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1680 }
1681 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
1682
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001683 HANDLE_INSTRUCTION_START(NEG_INT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001684 shadow_frame.SetVReg(
1685 inst->VRegA_12x(inst_data), -shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001686 ADVANCE(1);
1687 HANDLE_INSTRUCTION_END();
1688
1689 HANDLE_INSTRUCTION_START(NOT_INT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001690 shadow_frame.SetVReg(
1691 inst->VRegA_12x(inst_data), ~shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001692 ADVANCE(1);
1693 HANDLE_INSTRUCTION_END();
1694
1695 HANDLE_INSTRUCTION_START(NEG_LONG)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001696 shadow_frame.SetVRegLong(
1697 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001698 ADVANCE(1);
1699 HANDLE_INSTRUCTION_END();
1700
1701 HANDLE_INSTRUCTION_START(NOT_LONG)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001702 shadow_frame.SetVRegLong(
1703 inst->VRegA_12x(inst_data), ~shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001704 ADVANCE(1);
1705 HANDLE_INSTRUCTION_END();
1706
1707 HANDLE_INSTRUCTION_START(NEG_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001708 shadow_frame.SetVRegFloat(
1709 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001710 ADVANCE(1);
1711 HANDLE_INSTRUCTION_END();
1712
1713 HANDLE_INSTRUCTION_START(NEG_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001714 shadow_frame.SetVRegDouble(
1715 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001716 ADVANCE(1);
1717 HANDLE_INSTRUCTION_END();
1718
1719 HANDLE_INSTRUCTION_START(INT_TO_LONG)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001720 shadow_frame.SetVRegLong(
1721 inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001722 ADVANCE(1);
1723 HANDLE_INSTRUCTION_END();
1724
1725 HANDLE_INSTRUCTION_START(INT_TO_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001726 shadow_frame.SetVRegFloat(
1727 inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001728 ADVANCE(1);
1729 HANDLE_INSTRUCTION_END();
1730
1731 HANDLE_INSTRUCTION_START(INT_TO_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001732 shadow_frame.SetVRegDouble(
1733 inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001734 ADVANCE(1);
1735 HANDLE_INSTRUCTION_END();
1736
1737 HANDLE_INSTRUCTION_START(LONG_TO_INT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001738 shadow_frame.SetVReg(
1739 inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001740 ADVANCE(1);
1741 HANDLE_INSTRUCTION_END();
1742
1743 HANDLE_INSTRUCTION_START(LONG_TO_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001744 shadow_frame.SetVRegFloat(
1745 inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001746 ADVANCE(1);
1747 HANDLE_INSTRUCTION_END();
1748
1749 HANDLE_INSTRUCTION_START(LONG_TO_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001750 shadow_frame.SetVRegDouble(
1751 inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001752 ADVANCE(1);
1753 HANDLE_INSTRUCTION_END();
1754
1755 HANDLE_INSTRUCTION_START(FLOAT_TO_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001756 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001757 int32_t result = art_float_to_integral<int32_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001758 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001759 ADVANCE(1);
1760 }
1761 HANDLE_INSTRUCTION_END();
1762
1763 HANDLE_INSTRUCTION_START(FLOAT_TO_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001764 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001765 int64_t result = art_float_to_integral<int64_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001766 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001767 ADVANCE(1);
1768 }
1769 HANDLE_INSTRUCTION_END();
1770
1771 HANDLE_INSTRUCTION_START(FLOAT_TO_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001772 shadow_frame.SetVRegDouble(
1773 inst->VRegA_12x(inst_data), shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001774 ADVANCE(1);
1775 HANDLE_INSTRUCTION_END();
1776
1777 HANDLE_INSTRUCTION_START(DOUBLE_TO_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001778 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001779 int32_t result = art_float_to_integral<int32_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001780 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001781 ADVANCE(1);
1782 }
1783 HANDLE_INSTRUCTION_END();
1784
1785 HANDLE_INSTRUCTION_START(DOUBLE_TO_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001786 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001787 int64_t result = art_float_to_integral<int64_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001788 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001789 ADVANCE(1);
1790 }
1791 HANDLE_INSTRUCTION_END();
1792
1793 HANDLE_INSTRUCTION_START(DOUBLE_TO_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001794 shadow_frame.SetVRegFloat(
1795 inst->VRegA_12x(inst_data), shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001796 ADVANCE(1);
1797 HANDLE_INSTRUCTION_END();
1798
1799 HANDLE_INSTRUCTION_START(INT_TO_BYTE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001800 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1801 static_cast<int8_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001802 ADVANCE(1);
1803 HANDLE_INSTRUCTION_END();
1804
1805 HANDLE_INSTRUCTION_START(INT_TO_CHAR)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001806 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1807 static_cast<uint16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001808 ADVANCE(1);
1809 HANDLE_INSTRUCTION_END();
1810
1811 HANDLE_INSTRUCTION_START(INT_TO_SHORT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001812 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1813 static_cast<int16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001814 ADVANCE(1);
1815 HANDLE_INSTRUCTION_END();
1816
1817 HANDLE_INSTRUCTION_START(ADD_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001818 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001819 SafeAdd(shadow_frame.GetVReg(inst->VRegB_23x()),
1820 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001821 ADVANCE(2);
1822 HANDLE_INSTRUCTION_END();
1823
1824 HANDLE_INSTRUCTION_START(SUB_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001825 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001826 SafeSub(shadow_frame.GetVReg(inst->VRegB_23x()),
1827 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001828 ADVANCE(2);
1829 HANDLE_INSTRUCTION_END();
1830
1831 HANDLE_INSTRUCTION_START(MUL_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001832 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001833 SafeMul(shadow_frame.GetVReg(inst->VRegB_23x()),
1834 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001835 ADVANCE(2);
1836 HANDLE_INSTRUCTION_END();
1837
1838 HANDLE_INSTRUCTION_START(DIV_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001839 bool success = DoIntDivide(shadow_frame, inst->VRegA_23x(inst_data),
1840 shadow_frame.GetVReg(inst->VRegB_23x()),
1841 shadow_frame.GetVReg(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001842 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1843 }
1844 HANDLE_INSTRUCTION_END();
1845
1846 HANDLE_INSTRUCTION_START(REM_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001847 bool success = DoIntRemainder(shadow_frame, inst->VRegA_23x(inst_data),
1848 shadow_frame.GetVReg(inst->VRegB_23x()),
1849 shadow_frame.GetVReg(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001850 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1851 }
1852 HANDLE_INSTRUCTION_END();
1853
1854 HANDLE_INSTRUCTION_START(SHL_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001855 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001856 shadow_frame.GetVReg(inst->VRegB_23x()) <<
1857 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1858 ADVANCE(2);
1859 HANDLE_INSTRUCTION_END();
1860
1861 HANDLE_INSTRUCTION_START(SHR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001862 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001863 shadow_frame.GetVReg(inst->VRegB_23x()) >>
1864 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1865 ADVANCE(2);
1866 HANDLE_INSTRUCTION_END();
1867
1868 HANDLE_INSTRUCTION_START(USHR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001869 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001870 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_23x())) >>
1871 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1872 ADVANCE(2);
1873 HANDLE_INSTRUCTION_END();
1874
1875 HANDLE_INSTRUCTION_START(AND_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001876 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001877 shadow_frame.GetVReg(inst->VRegB_23x()) &
1878 shadow_frame.GetVReg(inst->VRegC_23x()));
1879 ADVANCE(2);
1880 HANDLE_INSTRUCTION_END();
1881
1882 HANDLE_INSTRUCTION_START(OR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001883 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001884 shadow_frame.GetVReg(inst->VRegB_23x()) |
1885 shadow_frame.GetVReg(inst->VRegC_23x()));
1886 ADVANCE(2);
1887 HANDLE_INSTRUCTION_END();
1888
1889 HANDLE_INSTRUCTION_START(XOR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001890 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001891 shadow_frame.GetVReg(inst->VRegB_23x()) ^
1892 shadow_frame.GetVReg(inst->VRegC_23x()));
1893 ADVANCE(2);
1894 HANDLE_INSTRUCTION_END();
1895
1896 HANDLE_INSTRUCTION_START(ADD_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001897 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001898 SafeAdd(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1899 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001900 ADVANCE(2);
1901 HANDLE_INSTRUCTION_END();
1902
1903 HANDLE_INSTRUCTION_START(SUB_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001904 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001905 SafeSub(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1906 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001907 ADVANCE(2);
1908 HANDLE_INSTRUCTION_END();
1909
1910 HANDLE_INSTRUCTION_START(MUL_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001911 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001912 SafeMul(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1913 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001914 ADVANCE(2);
1915 HANDLE_INSTRUCTION_END();
1916
1917 HANDLE_INSTRUCTION_START(DIV_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001918 bool success = DoLongDivide(shadow_frame, inst->VRegA_23x(inst_data),
1919 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1920 shadow_frame.GetVRegLong(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001921 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1922 }
1923 HANDLE_INSTRUCTION_END();
1924
1925 HANDLE_INSTRUCTION_START(REM_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001926 bool success = DoLongRemainder(shadow_frame, inst->VRegA_23x(inst_data),
1927 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1928 shadow_frame.GetVRegLong(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001929 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1930 }
1931 HANDLE_INSTRUCTION_END();
1932
1933 HANDLE_INSTRUCTION_START(AND_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001934 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001935 shadow_frame.GetVRegLong(inst->VRegB_23x()) &
1936 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1937 ADVANCE(2);
1938 HANDLE_INSTRUCTION_END();
1939
1940 HANDLE_INSTRUCTION_START(OR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001941 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001942 shadow_frame.GetVRegLong(inst->VRegB_23x()) |
1943 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1944 ADVANCE(2);
1945 HANDLE_INSTRUCTION_END();
1946
1947 HANDLE_INSTRUCTION_START(XOR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001948 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001949 shadow_frame.GetVRegLong(inst->VRegB_23x()) ^
1950 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1951 ADVANCE(2);
1952 HANDLE_INSTRUCTION_END();
1953
1954 HANDLE_INSTRUCTION_START(SHL_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001955 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001956 shadow_frame.GetVRegLong(inst->VRegB_23x()) <<
1957 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1958 ADVANCE(2);
1959 HANDLE_INSTRUCTION_END();
1960
1961 HANDLE_INSTRUCTION_START(SHR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001962 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001963 shadow_frame.GetVRegLong(inst->VRegB_23x()) >>
1964 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1965 ADVANCE(2);
1966 HANDLE_INSTRUCTION_END();
1967
1968 HANDLE_INSTRUCTION_START(USHR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001969 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001970 static_cast<uint64_t>(shadow_frame.GetVRegLong(inst->VRegB_23x())) >>
1971 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1972 ADVANCE(2);
1973 HANDLE_INSTRUCTION_END();
1974
1975 HANDLE_INSTRUCTION_START(ADD_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001976 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001977 shadow_frame.GetVRegFloat(inst->VRegB_23x()) +
1978 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1979 ADVANCE(2);
1980 HANDLE_INSTRUCTION_END();
1981
1982 HANDLE_INSTRUCTION_START(SUB_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001983 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001984 shadow_frame.GetVRegFloat(inst->VRegB_23x()) -
1985 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1986 ADVANCE(2);
1987 HANDLE_INSTRUCTION_END();
1988
1989 HANDLE_INSTRUCTION_START(MUL_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001990 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001991 shadow_frame.GetVRegFloat(inst->VRegB_23x()) *
1992 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1993 ADVANCE(2);
1994 HANDLE_INSTRUCTION_END();
1995
1996 HANDLE_INSTRUCTION_START(DIV_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001997 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001998 shadow_frame.GetVRegFloat(inst->VRegB_23x()) /
1999 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
2000 ADVANCE(2);
2001 HANDLE_INSTRUCTION_END();
2002
2003 HANDLE_INSTRUCTION_START(REM_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002004 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002005 fmodf(shadow_frame.GetVRegFloat(inst->VRegB_23x()),
2006 shadow_frame.GetVRegFloat(inst->VRegC_23x())));
2007 ADVANCE(2);
2008 HANDLE_INSTRUCTION_END();
2009
2010 HANDLE_INSTRUCTION_START(ADD_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002011 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002012 shadow_frame.GetVRegDouble(inst->VRegB_23x()) +
2013 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2014 ADVANCE(2);
2015 HANDLE_INSTRUCTION_END();
2016
2017 HANDLE_INSTRUCTION_START(SUB_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002018 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002019 shadow_frame.GetVRegDouble(inst->VRegB_23x()) -
2020 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2021 ADVANCE(2);
2022 HANDLE_INSTRUCTION_END();
2023
2024 HANDLE_INSTRUCTION_START(MUL_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002025 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002026 shadow_frame.GetVRegDouble(inst->VRegB_23x()) *
2027 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2028 ADVANCE(2);
2029 HANDLE_INSTRUCTION_END();
2030
2031 HANDLE_INSTRUCTION_START(DIV_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002032 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002033 shadow_frame.GetVRegDouble(inst->VRegB_23x()) /
2034 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2035 ADVANCE(2);
2036 HANDLE_INSTRUCTION_END();
2037
2038 HANDLE_INSTRUCTION_START(REM_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002039 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002040 fmod(shadow_frame.GetVRegDouble(inst->VRegB_23x()),
2041 shadow_frame.GetVRegDouble(inst->VRegC_23x())));
2042 ADVANCE(2);
2043 HANDLE_INSTRUCTION_END();
2044
2045 HANDLE_INSTRUCTION_START(ADD_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002046 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002047 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002048 SafeAdd(shadow_frame.GetVReg(vregA),
2049 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002050 ADVANCE(1);
2051 }
2052 HANDLE_INSTRUCTION_END();
2053
2054 HANDLE_INSTRUCTION_START(SUB_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002055 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002056 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002057 SafeSub(shadow_frame.GetVReg(vregA),
2058 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002059 ADVANCE(1);
2060 }
2061 HANDLE_INSTRUCTION_END();
2062
2063 HANDLE_INSTRUCTION_START(MUL_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002064 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002065 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002066 SafeMul(shadow_frame.GetVReg(vregA),
2067 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002068 ADVANCE(1);
2069 }
2070 HANDLE_INSTRUCTION_END();
2071
2072 HANDLE_INSTRUCTION_START(DIV_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002073 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002074 bool success = DoIntDivide(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002075 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002076 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2077 }
2078 HANDLE_INSTRUCTION_END();
2079
2080 HANDLE_INSTRUCTION_START(REM_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002081 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002082 bool success = DoIntRemainder(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002083 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002084 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2085 }
2086 HANDLE_INSTRUCTION_END();
2087
2088 HANDLE_INSTRUCTION_START(SHL_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002089 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002090 shadow_frame.SetVReg(vregA,
2091 shadow_frame.GetVReg(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002092 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002093 ADVANCE(1);
2094 }
2095 HANDLE_INSTRUCTION_END();
2096
2097 HANDLE_INSTRUCTION_START(SHR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002098 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002099 shadow_frame.SetVReg(vregA,
2100 shadow_frame.GetVReg(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002101 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002102 ADVANCE(1);
2103 }
2104 HANDLE_INSTRUCTION_END();
2105
2106 HANDLE_INSTRUCTION_START(USHR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002107 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002108 shadow_frame.SetVReg(vregA,
2109 static_cast<uint32_t>(shadow_frame.GetVReg(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002110 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002111 ADVANCE(1);
2112 }
2113 HANDLE_INSTRUCTION_END();
2114
2115 HANDLE_INSTRUCTION_START(AND_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002116 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002117 shadow_frame.SetVReg(vregA,
2118 shadow_frame.GetVReg(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002119 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002120 ADVANCE(1);
2121 }
2122 HANDLE_INSTRUCTION_END();
2123
2124 HANDLE_INSTRUCTION_START(OR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002125 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002126 shadow_frame.SetVReg(vregA,
2127 shadow_frame.GetVReg(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002128 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002129 ADVANCE(1);
2130 }
2131 HANDLE_INSTRUCTION_END();
2132
2133 HANDLE_INSTRUCTION_START(XOR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002134 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002135 shadow_frame.SetVReg(vregA,
2136 shadow_frame.GetVReg(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002137 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002138 ADVANCE(1);
2139 }
2140 HANDLE_INSTRUCTION_END();
2141
2142 HANDLE_INSTRUCTION_START(ADD_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002143 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002144 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002145 SafeAdd(shadow_frame.GetVRegLong(vregA),
2146 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002147 ADVANCE(1);
2148 }
2149 HANDLE_INSTRUCTION_END();
2150
2151 HANDLE_INSTRUCTION_START(SUB_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002152 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002153 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002154 SafeSub(shadow_frame.GetVRegLong(vregA),
2155 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002156 ADVANCE(1);
2157 }
2158 HANDLE_INSTRUCTION_END();
2159
2160 HANDLE_INSTRUCTION_START(MUL_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002161 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002162 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002163 SafeMul(shadow_frame.GetVRegLong(vregA),
2164 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002165 ADVANCE(1);
2166 }
2167 HANDLE_INSTRUCTION_END();
2168
2169 HANDLE_INSTRUCTION_START(DIV_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002170 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002171 bool success = DoLongDivide(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002172 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002173 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2174 }
2175 HANDLE_INSTRUCTION_END();
2176
2177 HANDLE_INSTRUCTION_START(REM_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002178 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002179 bool success = DoLongRemainder(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002180 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002181 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2182 }
2183 HANDLE_INSTRUCTION_END();
2184
2185 HANDLE_INSTRUCTION_START(AND_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002186 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002187 shadow_frame.SetVRegLong(vregA,
2188 shadow_frame.GetVRegLong(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002189 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002190 ADVANCE(1);
2191 }
2192 HANDLE_INSTRUCTION_END();
2193
2194 HANDLE_INSTRUCTION_START(OR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002195 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002196 shadow_frame.SetVRegLong(vregA,
2197 shadow_frame.GetVRegLong(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002198 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002199 ADVANCE(1);
2200 }
2201 HANDLE_INSTRUCTION_END();
2202
2203 HANDLE_INSTRUCTION_START(XOR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002204 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002205 shadow_frame.SetVRegLong(vregA,
2206 shadow_frame.GetVRegLong(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002207 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002208 ADVANCE(1);
2209 }
2210 HANDLE_INSTRUCTION_END();
2211
2212 HANDLE_INSTRUCTION_START(SHL_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002213 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002214 shadow_frame.SetVRegLong(vregA,
2215 shadow_frame.GetVRegLong(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002216 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002217 ADVANCE(1);
2218 }
2219 HANDLE_INSTRUCTION_END();
2220
2221 HANDLE_INSTRUCTION_START(SHR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002222 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002223 shadow_frame.SetVRegLong(vregA,
2224 shadow_frame.GetVRegLong(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002225 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002226 ADVANCE(1);
2227 }
2228 HANDLE_INSTRUCTION_END();
2229
2230 HANDLE_INSTRUCTION_START(USHR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002231 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002232 shadow_frame.SetVRegLong(vregA,
2233 static_cast<uint64_t>(shadow_frame.GetVRegLong(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002234 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002235 ADVANCE(1);
2236 }
2237 HANDLE_INSTRUCTION_END();
2238
2239 HANDLE_INSTRUCTION_START(ADD_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002240 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002241 shadow_frame.SetVRegFloat(vregA,
2242 shadow_frame.GetVRegFloat(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002243 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002244 ADVANCE(1);
2245 }
2246 HANDLE_INSTRUCTION_END();
2247
2248 HANDLE_INSTRUCTION_START(SUB_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002249 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002250 shadow_frame.SetVRegFloat(vregA,
2251 shadow_frame.GetVRegFloat(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002252 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002253 ADVANCE(1);
2254 }
2255 HANDLE_INSTRUCTION_END();
2256
2257 HANDLE_INSTRUCTION_START(MUL_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002258 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002259 shadow_frame.SetVRegFloat(vregA,
2260 shadow_frame.GetVRegFloat(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002261 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002262 ADVANCE(1);
2263 }
2264 HANDLE_INSTRUCTION_END();
2265
2266 HANDLE_INSTRUCTION_START(DIV_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002267 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002268 shadow_frame.SetVRegFloat(vregA,
2269 shadow_frame.GetVRegFloat(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002270 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002271 ADVANCE(1);
2272 }
2273 HANDLE_INSTRUCTION_END();
2274
2275 HANDLE_INSTRUCTION_START(REM_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002276 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002277 shadow_frame.SetVRegFloat(vregA,
2278 fmodf(shadow_frame.GetVRegFloat(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002279 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002280 ADVANCE(1);
2281 }
2282 HANDLE_INSTRUCTION_END();
2283
2284 HANDLE_INSTRUCTION_START(ADD_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002285 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002286 shadow_frame.SetVRegDouble(vregA,
2287 shadow_frame.GetVRegDouble(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002288 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002289 ADVANCE(1);
2290 }
2291 HANDLE_INSTRUCTION_END();
2292
2293 HANDLE_INSTRUCTION_START(SUB_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002294 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002295 shadow_frame.SetVRegDouble(vregA,
2296 shadow_frame.GetVRegDouble(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002297 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002298 ADVANCE(1);
2299 }
2300 HANDLE_INSTRUCTION_END();
2301
2302 HANDLE_INSTRUCTION_START(MUL_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002303 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002304 shadow_frame.SetVRegDouble(vregA,
2305 shadow_frame.GetVRegDouble(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002306 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002307 ADVANCE(1);
2308 }
2309 HANDLE_INSTRUCTION_END();
2310
2311 HANDLE_INSTRUCTION_START(DIV_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002312 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002313 shadow_frame.SetVRegDouble(vregA,
2314 shadow_frame.GetVRegDouble(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002315 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002316 ADVANCE(1);
2317 }
2318 HANDLE_INSTRUCTION_END();
2319
2320 HANDLE_INSTRUCTION_START(REM_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002321 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002322 shadow_frame.SetVRegDouble(vregA,
2323 fmod(shadow_frame.GetVRegDouble(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002324 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002325 ADVANCE(1);
2326 }
2327 HANDLE_INSTRUCTION_END();
2328
2329 HANDLE_INSTRUCTION_START(ADD_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002330 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002331 SafeAdd(shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2332 inst->VRegC_22s()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002333 ADVANCE(2);
2334 HANDLE_INSTRUCTION_END();
2335
2336 HANDLE_INSTRUCTION_START(RSUB_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002337 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002338 SafeSub(inst->VRegC_22s(),
2339 shadow_frame.GetVReg(inst->VRegB_22s(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002340 ADVANCE(2);
2341 HANDLE_INSTRUCTION_END();
2342
2343 HANDLE_INSTRUCTION_START(MUL_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002344 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002345 SafeMul(shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2346 inst->VRegC_22s()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002347 ADVANCE(2);
2348 HANDLE_INSTRUCTION_END();
2349
2350 HANDLE_INSTRUCTION_START(DIV_INT_LIT16) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07002351 bool success = DoIntDivide(
2352 shadow_frame, inst->VRegA_22s(inst_data), shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2353 inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002354 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2355 }
2356 HANDLE_INSTRUCTION_END();
2357
2358 HANDLE_INSTRUCTION_START(REM_INT_LIT16) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07002359 bool success = DoIntRemainder(
2360 shadow_frame, inst->VRegA_22s(inst_data), shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2361 inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002362 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2363 }
2364 HANDLE_INSTRUCTION_END();
2365
2366 HANDLE_INSTRUCTION_START(AND_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002367 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2368 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) &
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002369 inst->VRegC_22s());
2370 ADVANCE(2);
2371 HANDLE_INSTRUCTION_END();
2372
2373 HANDLE_INSTRUCTION_START(OR_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002374 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2375 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) |
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002376 inst->VRegC_22s());
2377 ADVANCE(2);
2378 HANDLE_INSTRUCTION_END();
2379
2380 HANDLE_INSTRUCTION_START(XOR_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002381 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2382 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) ^
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002383 inst->VRegC_22s());
2384 ADVANCE(2);
2385 HANDLE_INSTRUCTION_END();
2386
2387 HANDLE_INSTRUCTION_START(ADD_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002388 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002389 SafeAdd(shadow_frame.GetVReg(inst->VRegB_22b()),
2390 inst->VRegC_22b()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002391 ADVANCE(2);
2392 HANDLE_INSTRUCTION_END();
2393
2394 HANDLE_INSTRUCTION_START(RSUB_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002395 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002396 SafeSub(inst->VRegC_22b(),
2397 shadow_frame.GetVReg(inst->VRegB_22b())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002398 ADVANCE(2);
2399 HANDLE_INSTRUCTION_END();
2400
2401 HANDLE_INSTRUCTION_START(MUL_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002402 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002403 SafeMul(shadow_frame.GetVReg(inst->VRegB_22b()),
2404 inst->VRegC_22b()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002405 ADVANCE(2);
2406 HANDLE_INSTRUCTION_END();
2407
2408 HANDLE_INSTRUCTION_START(DIV_INT_LIT8) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002409 bool success = DoIntDivide(shadow_frame, inst->VRegA_22b(inst_data),
2410 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002411 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2412 }
2413 HANDLE_INSTRUCTION_END();
2414
2415 HANDLE_INSTRUCTION_START(REM_INT_LIT8) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002416 bool success = DoIntRemainder(shadow_frame, inst->VRegA_22b(inst_data),
2417 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002418 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2419 }
2420 HANDLE_INSTRUCTION_END();
2421
2422 HANDLE_INSTRUCTION_START(AND_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002423 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002424 shadow_frame.GetVReg(inst->VRegB_22b()) &
2425 inst->VRegC_22b());
2426 ADVANCE(2);
2427 HANDLE_INSTRUCTION_END();
2428
2429 HANDLE_INSTRUCTION_START(OR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002430 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002431 shadow_frame.GetVReg(inst->VRegB_22b()) |
2432 inst->VRegC_22b());
2433 ADVANCE(2);
2434 HANDLE_INSTRUCTION_END();
2435
2436 HANDLE_INSTRUCTION_START(XOR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002437 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002438 shadow_frame.GetVReg(inst->VRegB_22b()) ^
2439 inst->VRegC_22b());
2440 ADVANCE(2);
2441 HANDLE_INSTRUCTION_END();
2442
2443 HANDLE_INSTRUCTION_START(SHL_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002444 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002445 shadow_frame.GetVReg(inst->VRegB_22b()) <<
2446 (inst->VRegC_22b() & 0x1f));
2447 ADVANCE(2);
2448 HANDLE_INSTRUCTION_END();
2449
2450 HANDLE_INSTRUCTION_START(SHR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002451 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002452 shadow_frame.GetVReg(inst->VRegB_22b()) >>
2453 (inst->VRegC_22b() & 0x1f));
2454 ADVANCE(2);
2455 HANDLE_INSTRUCTION_END();
2456
2457 HANDLE_INSTRUCTION_START(USHR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002458 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002459 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_22b())) >>
2460 (inst->VRegC_22b() & 0x1f));
2461 ADVANCE(2);
2462 HANDLE_INSTRUCTION_END();
2463
Igor Murashkin158f35c2015-06-10 15:55:30 -07002464 HANDLE_EXPERIMENTAL_INSTRUCTION_START(CREATE_LAMBDA) {
Igor Murashkin6918bf12015-09-27 19:19:06 -07002465 if (lambda_closure_builder == nullptr) {
2466 // DoCreateLambda always needs a ClosureBuilder, even if it has 0 captured variables.
2467 lambda_closure_builder = MakeUnique<lambda::ClosureBuilder>();
2468 }
2469
2470 // TODO: these allocations should not leak, and the lambda method should not be local.
2471 lambda::Closure* lambda_closure =
2472 reinterpret_cast<lambda::Closure*>(alloca(lambda_closure_builder->GetSize()));
2473 bool success = DoCreateLambda<do_access_check>(self,
2474 inst,
2475 /*inout*/shadow_frame,
2476 /*inout*/lambda_closure_builder.get(),
2477 /*inout*/lambda_closure);
2478 lambda_closure_builder.reset(nullptr); // reset state of variables captured
Igor Murashkin158f35c2015-06-10 15:55:30 -07002479 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2480 }
2481 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2482
Igor Murashkin2ee54e22015-06-18 10:05:11 -07002483 HANDLE_EXPERIMENTAL_INSTRUCTION_START(BOX_LAMBDA) {
2484 bool success = DoBoxLambda<do_access_check>(self, shadow_frame, inst, inst_data);
2485 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2486 }
2487 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2488
2489 HANDLE_EXPERIMENTAL_INSTRUCTION_START(UNBOX_LAMBDA) {
2490 bool success = DoUnboxLambda<do_access_check>(self, shadow_frame, inst, inst_data);
2491 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2492 }
2493 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2494
Igor Murashkin6918bf12015-09-27 19:19:06 -07002495 HANDLE_EXPERIMENTAL_INSTRUCTION_START(CAPTURE_VARIABLE) {
2496 if (lambda_closure_builder == nullptr) {
2497 lambda_closure_builder = MakeUnique<lambda::ClosureBuilder>();
2498 }
2499
2500 bool success = DoCaptureVariable<do_access_check>(self,
2501 inst,
2502 /*inout*/shadow_frame,
2503 /*inout*/lambda_closure_builder.get());
2504
2505 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2506 }
2507 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2508
2509 HANDLE_EXPERIMENTAL_INSTRUCTION_START(LIBERATE_VARIABLE) {
2510 bool success = DoLiberateVariable<do_access_check>(self,
2511 inst,
2512 lambda_captured_variable_index,
2513 /*inout*/shadow_frame);
2514 // Temporarily only allow sequences of 'liberate-variable, liberate-variable, ...'
2515 lambda_captured_variable_index++;
2516 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2517 }
2518 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2519
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002520 HANDLE_INSTRUCTION_START(UNUSED_3E)
Ian Rogerse94652f2014-12-02 11:13:19 -08002521 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002522 HANDLE_INSTRUCTION_END();
2523
2524 HANDLE_INSTRUCTION_START(UNUSED_3F)
Ian Rogerse94652f2014-12-02 11:13:19 -08002525 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002526 HANDLE_INSTRUCTION_END();
2527
2528 HANDLE_INSTRUCTION_START(UNUSED_40)
Ian Rogerse94652f2014-12-02 11:13:19 -08002529 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002530 HANDLE_INSTRUCTION_END();
2531
2532 HANDLE_INSTRUCTION_START(UNUSED_41)
Ian Rogerse94652f2014-12-02 11:13:19 -08002533 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002534 HANDLE_INSTRUCTION_END();
2535
2536 HANDLE_INSTRUCTION_START(UNUSED_42)
Ian Rogerse94652f2014-12-02 11:13:19 -08002537 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002538 HANDLE_INSTRUCTION_END();
2539
2540 HANDLE_INSTRUCTION_START(UNUSED_43)
Ian Rogerse94652f2014-12-02 11:13:19 -08002541 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002542 HANDLE_INSTRUCTION_END();
2543
2544 HANDLE_INSTRUCTION_START(UNUSED_79)
Ian Rogerse94652f2014-12-02 11:13:19 -08002545 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002546 HANDLE_INSTRUCTION_END();
2547
2548 HANDLE_INSTRUCTION_START(UNUSED_7A)
Ian Rogerse94652f2014-12-02 11:13:19 -08002549 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002550 HANDLE_INSTRUCTION_END();
2551
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002552 HANDLE_INSTRUCTION_START(UNUSED_F4)
Ian Rogerse94652f2014-12-02 11:13:19 -08002553 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002554 HANDLE_INSTRUCTION_END();
2555
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002556 HANDLE_INSTRUCTION_START(UNUSED_FA)
Ian Rogerse94652f2014-12-02 11:13:19 -08002557 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002558 HANDLE_INSTRUCTION_END();
2559
2560 HANDLE_INSTRUCTION_START(UNUSED_FB)
Ian Rogerse94652f2014-12-02 11:13:19 -08002561 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002562 HANDLE_INSTRUCTION_END();
2563
2564 HANDLE_INSTRUCTION_START(UNUSED_FC)
Ian Rogerse94652f2014-12-02 11:13:19 -08002565 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002566 HANDLE_INSTRUCTION_END();
2567
2568 HANDLE_INSTRUCTION_START(UNUSED_FD)
Ian Rogerse94652f2014-12-02 11:13:19 -08002569 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002570 HANDLE_INSTRUCTION_END();
2571
2572 HANDLE_INSTRUCTION_START(UNUSED_FE)
Ian Rogerse94652f2014-12-02 11:13:19 -08002573 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002574 HANDLE_INSTRUCTION_END();
2575
2576 HANDLE_INSTRUCTION_START(UNUSED_FF)
Ian Rogerse94652f2014-12-02 11:13:19 -08002577 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002578 HANDLE_INSTRUCTION_END();
2579
2580 exception_pending_label: {
2581 CHECK(self->IsExceptionPending());
Sebastien Hertz1eda2262013-09-09 16:53:14 +02002582 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -07002583 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +02002584 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02002585 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002586 uint32_t found_dex_pc = FindNextInstructionFollowingException(self, shadow_frame, dex_pc,
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002587 instrumentation);
2588 if (found_dex_pc == DexFile::kDexNoIndex) {
Andreas Gampe03ec9302015-08-27 17:41:47 -07002589 // Structured locking is to be enforced for abnormal termination, too.
2590 shadow_frame.GetLockCountData().CheckAllMonitorsReleasedOrThrow<do_assignability_check>(self);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002591 return JValue(); /* Handled in caller. */
2592 } else {
2593 int32_t displacement = static_cast<int32_t>(found_dex_pc) - static_cast<int32_t>(dex_pc);
2594 ADVANCE(displacement);
2595 }
2596 }
2597
Sebastien Hertz8379b222014-02-24 17:38:15 +01002598// Create alternative instruction handlers dedicated to instrumentation.
2599// Return instructions must not call Instrumentation::DexPcMovedEvent since they already call
2600// Instrumentation::MethodExited. This is to avoid posting debugger events twice for this location.
Sebastien Hertze713d932014-05-15 10:48:53 +02002601// Note: we do not use the kReturn instruction flag here (to test the instruction is a return). The
2602// compiler seems to not evaluate "(Instruction::FlagsOf(Instruction::code) & kReturn) != 0" to
2603// a constant condition that would remove the "if" statement so the test is free.
Sebastien Hertz9d6bf692015-04-10 12:12:33 +02002604#define INSTRUMENTATION_INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) \
2605 alt_op_##code: { \
2606 Runtime* const runtime = Runtime::Current(); \
2607 const instrumentation::Instrumentation* instrumentation = runtime->GetInstrumentation(); \
2608 if (UNLIKELY(instrumentation->HasDexPcListeners())) { \
2609 Object* this_object = shadow_frame.GetThisObject(code_item->ins_size_); \
2610 instrumentation->DexPcMovedEvent(self, this_object, shadow_frame.GetMethod(), dex_pc); \
2611 } \
2612 UPDATE_HANDLER_TABLE(); \
2613 goto *handlersTable[instrumentation::kMainHandlerTable][Instruction::code]; \
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002614 }
2615#include "dex_instruction_list.h"
2616 DEX_INSTRUCTION_LIST(INSTRUMENTATION_INSTRUCTION_HANDLER)
2617#undef DEX_INSTRUCTION_LIST
2618#undef INSTRUMENTATION_INSTRUCTION_HANDLER
2619} // NOLINT(readability/fn_size)
2620
2621// Explicit definitions of ExecuteGotoImpl.
Mathieu Chartier90443472015-07-16 20:32:27 -07002622template SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR
Ian Rogerse94652f2014-12-02 11:13:19 -08002623JValue ExecuteGotoImpl<true, false>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002624 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -07002625template SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR
Ian Rogerse94652f2014-12-02 11:13:19 -08002626JValue ExecuteGotoImpl<false, false>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002627 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -07002628template SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -08002629JValue ExecuteGotoImpl<true, true>(Thread* self, const DexFile::CodeItem* code_item,
2630 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -07002631template SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -08002632JValue ExecuteGotoImpl<false, true>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002633 ShadowFrame& shadow_frame, JValue result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002634
2635} // namespace interpreter
2636} // namespace art
Colin Crosse84e4f72015-03-18 14:01:19 -07002637
2638#endif