blob: d70a7c4e3026dd41ee3e5d5143391aad09a380b2 [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();
Vladimir Markod7779832016-04-05 11:48:02 +0000293 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200294 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200295 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200296 shadow_frame.GetMethod(), dex_pc,
297 result);
298 }
299 return result;
300 }
301 HANDLE_INSTRUCTION_END();
302
Mathieu Chartierd7cbf8a2015-03-19 12:43:20 -0700303 HANDLE_INSTRUCTION_START(RETURN_VOID) {
Hans Boehm30359612014-05-21 17:46:23 -0700304 QuasiAtomic::ThreadFenceForConstructor();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200305 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700306 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700307 HANDLE_MONITOR_CHECKS();
Vladimir Markod7779832016-04-05 11:48:02 +0000308 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200309 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200310 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200311 shadow_frame.GetMethod(), dex_pc,
312 result);
313 }
314 return result;
315 }
316 HANDLE_INSTRUCTION_END();
317
318 HANDLE_INSTRUCTION_START(RETURN) {
319 JValue result;
320 result.SetJ(0);
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200321 result.SetI(shadow_frame.GetVReg(inst->VRegA_11x(inst_data)));
Ian Rogers7b078e82014-09-10 14:44:24 -0700322 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700323 HANDLE_MONITOR_CHECKS();
Vladimir Markod7779832016-04-05 11:48:02 +0000324 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200325 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200326 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200327 shadow_frame.GetMethod(), dex_pc,
328 result);
329 }
330 return result;
331 }
332 HANDLE_INSTRUCTION_END();
333
334 HANDLE_INSTRUCTION_START(RETURN_WIDE) {
335 JValue result;
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200336 result.SetJ(shadow_frame.GetVRegLong(inst->VRegA_11x(inst_data)));
Ian Rogers7b078e82014-09-10 14:44:24 -0700337 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700338 HANDLE_MONITOR_CHECKS();
Vladimir Markod7779832016-04-05 11:48:02 +0000339 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200340 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200341 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200342 shadow_frame.GetMethod(), dex_pc,
343 result);
344 }
345 return result;
346 }
347 HANDLE_INSTRUCTION_END();
348
349 HANDLE_INSTRUCTION_START(RETURN_OBJECT) {
350 JValue result;
Ian Rogers7b078e82014-09-10 14:44:24 -0700351 self->AllowThreadSuspension();
Andreas Gampe03ec9302015-08-27 17:41:47 -0700352 HANDLE_MONITOR_CHECKS();
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700353 const uint8_t vreg_index = inst->VRegA_11x(inst_data);
354 Object* obj_result = shadow_frame.GetVRegReference(vreg_index);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700355 if (do_assignability_check && obj_result != nullptr) {
Vladimir Marko05792b92015-08-03 11:56:49 +0100356 size_t pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
357 Class* return_type = shadow_frame.GetMethod()->GetReturnType(true /* resolve */,
358 pointer_size);
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700359 obj_result = shadow_frame.GetVRegReference(vreg_index);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700360 if (return_type == nullptr) {
Jeff Haoa3faaf42013-09-03 19:07:00 -0700361 // Return the pending exception.
362 HANDLE_PENDING_EXCEPTION();
363 }
364 if (!obj_result->VerifierInstanceOf(return_type)) {
365 // This should never happen.
Ian Rogers1ff3c982014-08-12 02:30:58 -0700366 std::string temp1, temp2;
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000367 self->ThrowNewExceptionF("Ljava/lang/VirtualMachineError;",
Jeff Haoa3faaf42013-09-03 19:07:00 -0700368 "Returning '%s' that is not instance of return type '%s'",
Ian Rogers1ff3c982014-08-12 02:30:58 -0700369 obj_result->GetClass()->GetDescriptor(&temp1),
370 return_type->GetDescriptor(&temp2));
Jeff Haoa3faaf42013-09-03 19:07:00 -0700371 HANDLE_PENDING_EXCEPTION();
372 }
373 }
Mathieu Chartierbfd9a432014-05-21 17:43:44 -0700374 result.SetL(obj_result);
Vladimir Markod7779832016-04-05 11:48:02 +0000375 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200376 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200377 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200378 shadow_frame.GetMethod(), dex_pc,
379 result);
380 }
381 return result;
382 }
383 HANDLE_INSTRUCTION_END();
384
385 HANDLE_INSTRUCTION_START(CONST_4) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200386 uint32_t dst = inst->VRegA_11n(inst_data);
387 int32_t val = inst->VRegB_11n(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200388 shadow_frame.SetVReg(dst, val);
389 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700390 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200391 }
392 ADVANCE(1);
393 }
394 HANDLE_INSTRUCTION_END();
395
396 HANDLE_INSTRUCTION_START(CONST_16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200397 uint32_t dst = inst->VRegA_21s(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200398 int32_t val = inst->VRegB_21s();
399 shadow_frame.SetVReg(dst, val);
400 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700401 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200402 }
403 ADVANCE(2);
404 }
405 HANDLE_INSTRUCTION_END();
406
407 HANDLE_INSTRUCTION_START(CONST) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200408 uint32_t dst = inst->VRegA_31i(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200409 int32_t val = inst->VRegB_31i();
410 shadow_frame.SetVReg(dst, val);
411 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700412 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200413 }
414 ADVANCE(3);
415 }
416 HANDLE_INSTRUCTION_END();
417
418 HANDLE_INSTRUCTION_START(CONST_HIGH16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200419 uint32_t dst = inst->VRegA_21h(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200420 int32_t val = static_cast<int32_t>(inst->VRegB_21h() << 16);
421 shadow_frame.SetVReg(dst, val);
422 if (val == 0) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700423 shadow_frame.SetVRegReference(dst, nullptr);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200424 }
425 ADVANCE(2);
426 }
427 HANDLE_INSTRUCTION_END();
428
429 HANDLE_INSTRUCTION_START(CONST_WIDE_16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200430 shadow_frame.SetVRegLong(inst->VRegA_21s(inst_data), inst->VRegB_21s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200431 ADVANCE(2);
432 HANDLE_INSTRUCTION_END();
433
434 HANDLE_INSTRUCTION_START(CONST_WIDE_32)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200435 shadow_frame.SetVRegLong(inst->VRegA_31i(inst_data), inst->VRegB_31i());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200436 ADVANCE(3);
437 HANDLE_INSTRUCTION_END();
438
439 HANDLE_INSTRUCTION_START(CONST_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200440 shadow_frame.SetVRegLong(inst->VRegA_51l(inst_data), inst->VRegB_51l());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200441 ADVANCE(5);
442 HANDLE_INSTRUCTION_END();
443
444 HANDLE_INSTRUCTION_START(CONST_WIDE_HIGH16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200445 shadow_frame.SetVRegLong(inst->VRegA_21h(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200446 static_cast<uint64_t>(inst->VRegB_21h()) << 48);
447 ADVANCE(2);
448 HANDLE_INSTRUCTION_END();
449
450 HANDLE_INSTRUCTION_START(CONST_STRING) {
Ian Rogers6786a582014-10-28 12:49:06 -0700451 String* s = ResolveString(self, shadow_frame, inst->VRegB_21c());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700452 if (UNLIKELY(s == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200453 HANDLE_PENDING_EXCEPTION();
454 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200455 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200456 ADVANCE(2);
457 }
458 }
459 HANDLE_INSTRUCTION_END();
460
461 HANDLE_INSTRUCTION_START(CONST_STRING_JUMBO) {
Ian Rogers6786a582014-10-28 12:49:06 -0700462 String* s = ResolveString(self, shadow_frame, inst->VRegB_31c());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700463 if (UNLIKELY(s == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200464 HANDLE_PENDING_EXCEPTION();
465 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200466 shadow_frame.SetVRegReference(inst->VRegA_31c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200467 ADVANCE(3);
468 }
469 }
470 HANDLE_INSTRUCTION_END();
471
472 HANDLE_INSTRUCTION_START(CONST_CLASS) {
473 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
474 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700475 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200476 HANDLE_PENDING_EXCEPTION();
477 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200478 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), c);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200479 ADVANCE(2);
480 }
481 }
482 HANDLE_INSTRUCTION_END();
483
484 HANDLE_INSTRUCTION_START(MONITOR_ENTER) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200485 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700486 if (UNLIKELY(obj == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000487 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200488 HANDLE_PENDING_EXCEPTION();
489 } else {
Andreas Gampe03ec9302015-08-27 17:41:47 -0700490 DoMonitorEnter<do_access_check>(self, &shadow_frame, obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200491 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), 1);
492 }
493 }
494 HANDLE_INSTRUCTION_END();
495
496 HANDLE_INSTRUCTION_START(MONITOR_EXIT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200497 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700498 if (UNLIKELY(obj == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000499 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200500 HANDLE_PENDING_EXCEPTION();
501 } else {
Andreas Gampe03ec9302015-08-27 17:41:47 -0700502 DoMonitorExit<do_access_check>(self, &shadow_frame, obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200503 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), 1);
504 }
505 }
506 HANDLE_INSTRUCTION_END();
507
508 HANDLE_INSTRUCTION_START(CHECK_CAST) {
509 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
510 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700511 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200512 HANDLE_PENDING_EXCEPTION();
513 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200514 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_21c(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700515 if (UNLIKELY(obj != nullptr && !obj->InstanceOf(c))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200516 ThrowClassCastException(c, obj->GetClass());
517 HANDLE_PENDING_EXCEPTION();
518 } else {
519 ADVANCE(2);
520 }
521 }
522 }
523 HANDLE_INSTRUCTION_END();
524
525 HANDLE_INSTRUCTION_START(INSTANCE_OF) {
526 Class* c = ResolveVerifyAndClinit(inst->VRegC_22c(), shadow_frame.GetMethod(),
527 self, false, do_access_check);
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700528 if (UNLIKELY(c == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200529 HANDLE_PENDING_EXCEPTION();
530 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200531 Object* obj = shadow_frame.GetVRegReference(inst->VRegB_22c(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700532 shadow_frame.SetVReg(inst->VRegA_22c(inst_data), (obj != nullptr && obj->InstanceOf(c)) ? 1 : 0);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200533 ADVANCE(2);
534 }
535 }
536 HANDLE_INSTRUCTION_END();
537
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700538 HANDLE_INSTRUCTION_START(ARRAY_LENGTH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200539 Object* array = shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700540 if (UNLIKELY(array == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000541 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200542 HANDLE_PENDING_EXCEPTION();
543 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200544 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), array->AsArray()->GetLength());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200545 ADVANCE(1);
546 }
547 }
548 HANDLE_INSTRUCTION_END();
549
550 HANDLE_INSTRUCTION_START(NEW_INSTANCE) {
Jeff Hao848f70a2014-01-15 13:49:50 -0800551 Object* obj = nullptr;
552 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
553 self, false, do_access_check);
554 if (LIKELY(c != nullptr)) {
555 if (UNLIKELY(c->IsStringClass())) {
556 gc::AllocatorType allocator_type = Runtime::Current()->GetHeap()->GetCurrentAllocator();
557 mirror::SetStringCountVisitor visitor(0);
558 obj = String::Alloc<true>(self, 0, allocator_type, visitor);
559 } else {
560 obj = AllocObjectFromCode<do_access_check, true>(
561 inst->VRegB_21c(), shadow_frame.GetMethod(), self,
562 Runtime::Current()->GetHeap()->GetCurrentAllocator());
563 }
564 }
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700565 if (UNLIKELY(obj == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200566 HANDLE_PENDING_EXCEPTION();
567 } else {
Sebastien Hertz4e99b3d2014-06-24 14:35:40 +0200568 obj->GetClass()->AssertInitializedOrInitializingInThread(self);
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700569 // Don't allow finalizable objects to be allocated during a transaction since these can't be
570 // finalized without a started runtime.
571 if (transaction_active && obj->GetClass()->IsFinalizable()) {
Sebastien Hertz45b15972015-04-03 16:07:05 +0200572 AbortTransactionF(self, "Allocating finalizable object in transaction: %s",
573 PrettyTypeOf(obj).c_str());
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700574 HANDLE_PENDING_EXCEPTION();
575 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200576 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200577 ADVANCE(2);
578 }
579 }
580 HANDLE_INSTRUCTION_END();
581
582 HANDLE_INSTRUCTION_START(NEW_ARRAY) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200583 int32_t length = shadow_frame.GetVReg(inst->VRegB_22c(inst_data));
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800584 Object* obj = AllocArrayFromCode<do_access_check, true>(
Andreas Gampe1cc7dba2014-12-17 18:43:01 -0800585 inst->VRegC_22c(), length, shadow_frame.GetMethod(), self,
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800586 Runtime::Current()->GetHeap()->GetCurrentAllocator());
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700587 if (UNLIKELY(obj == nullptr)) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200588 HANDLE_PENDING_EXCEPTION();
589 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200590 shadow_frame.SetVRegReference(inst->VRegA_22c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200591 ADVANCE(2);
592 }
593 }
594 HANDLE_INSTRUCTION_END();
595
596 HANDLE_INSTRUCTION_START(FILLED_NEW_ARRAY) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100597 bool success =
598 DoFilledNewArray<false, do_access_check, transaction_active>(inst, shadow_frame,
599 self, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200600 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
601 }
602 HANDLE_INSTRUCTION_END();
603
604 HANDLE_INSTRUCTION_START(FILLED_NEW_ARRAY_RANGE) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100605 bool success =
606 DoFilledNewArray<true, do_access_check, transaction_active>(inst, shadow_frame,
607 self, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200608 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
609 }
610 HANDLE_INSTRUCTION_END();
611
612 HANDLE_INSTRUCTION_START(FILL_ARRAY_DATA) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200613 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_31t(inst_data));
Ian Rogers832336b2014-10-08 15:35:22 -0700614 const uint16_t* payload_addr = reinterpret_cast<const uint16_t*>(inst) + inst->VRegB_31t();
615 const Instruction::ArrayDataPayload* payload =
616 reinterpret_cast<const Instruction::ArrayDataPayload*>(payload_addr);
617 bool success = FillArrayData(obj, payload);
618 if (transaction_active && success) {
619 RecordArrayElementsInTransaction(obj->AsArray(), payload->element_count);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200620 }
Ian Rogers832336b2014-10-08 15:35:22 -0700621 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200622 }
623 HANDLE_INSTRUCTION_END();
624
625 HANDLE_INSTRUCTION_START(THROW) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200626 Object* exception = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700627 if (UNLIKELY(exception == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000628 ThrowNullPointerException("throw with null exception");
Jeff Haoa3faaf42013-09-03 19:07:00 -0700629 } else if (do_assignability_check && !exception->GetClass()->IsThrowableClass()) {
630 // This should never happen.
Ian Rogers1ff3c982014-08-12 02:30:58 -0700631 std::string temp;
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +0000632 self->ThrowNewExceptionF("Ljava/lang/VirtualMachineError;",
Jeff Haoa3faaf42013-09-03 19:07:00 -0700633 "Throwing '%s' that is not instance of Throwable",
Ian Rogers1ff3c982014-08-12 02:30:58 -0700634 exception->GetClass()->GetDescriptor(&temp));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200635 } else {
Nicolas Geoffray14691c52015-03-05 10:40:17 +0000636 self->SetException(exception->AsThrowable());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200637 }
638 HANDLE_PENDING_EXCEPTION();
639 }
640 HANDLE_INSTRUCTION_END();
641
642 HANDLE_INSTRUCTION_START(GOTO) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200643 int8_t offset = inst->VRegA_10t(inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000644 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200645 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000646 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200647 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700648 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200649 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200650 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200651 }
652 ADVANCE(offset);
653 }
654 HANDLE_INSTRUCTION_END();
655
656 HANDLE_INSTRUCTION_START(GOTO_16) {
657 int16_t offset = inst->VRegA_20t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000658 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200659 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000660 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200661 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700662 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200663 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200664 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200665 }
666 ADVANCE(offset);
667 }
668 HANDLE_INSTRUCTION_END();
669
670 HANDLE_INSTRUCTION_START(GOTO_32) {
671 int32_t offset = inst->VRegA_30t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000672 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200673 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000674 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200675 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700676 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200677 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200678 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200679 }
680 ADVANCE(offset);
681 }
682 HANDLE_INSTRUCTION_END();
683
684 HANDLE_INSTRUCTION_START(PACKED_SWITCH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200685 int32_t offset = DoPackedSwitch(inst, shadow_frame, inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000686 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200687 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000688 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200689 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700690 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200691 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200692 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200693 }
694 ADVANCE(offset);
695 }
696 HANDLE_INSTRUCTION_END();
697
698 HANDLE_INSTRUCTION_START(SPARSE_SWITCH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200699 int32_t offset = DoSparseSwitch(inst, shadow_frame, inst_data);
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000700 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200701 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000702 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200703 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700704 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200705 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200706 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200707 }
708 ADVANCE(offset);
709 }
710 HANDLE_INSTRUCTION_END();
711
Ian Rogers647b1a82014-10-10 11:02:11 -0700712#if defined(__clang__)
713#pragma clang diagnostic push
714#pragma clang diagnostic ignored "-Wfloat-equal"
715#endif
716
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200717 HANDLE_INSTRUCTION_START(CMPL_FLOAT) {
718 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
719 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
720 int32_t result;
721 if (val1 > val2) {
722 result = 1;
723 } else if (val1 == val2) {
724 result = 0;
725 } else {
726 result = -1;
727 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200728 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200729 ADVANCE(2);
730 }
731 HANDLE_INSTRUCTION_END();
732
733 HANDLE_INSTRUCTION_START(CMPG_FLOAT) {
734 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
735 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
736 int32_t result;
737 if (val1 < val2) {
738 result = -1;
739 } else if (val1 == val2) {
740 result = 0;
741 } else {
742 result = 1;
743 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200744 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200745 ADVANCE(2);
746 }
747 HANDLE_INSTRUCTION_END();
748
749 HANDLE_INSTRUCTION_START(CMPL_DOUBLE) {
750 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
751 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
752 int32_t result;
753 if (val1 > val2) {
754 result = 1;
755 } else if (val1 == val2) {
756 result = 0;
757 } else {
758 result = -1;
759 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200760 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200761 ADVANCE(2);
762 }
763 HANDLE_INSTRUCTION_END();
764
765 HANDLE_INSTRUCTION_START(CMPG_DOUBLE) {
766 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
767 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
768 int32_t result;
769 if (val1 < val2) {
770 result = -1;
771 } else if (val1 == val2) {
772 result = 0;
773 } else {
774 result = 1;
775 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200776 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200777 ADVANCE(2);
778 }
779 HANDLE_INSTRUCTION_END();
780
Ian Rogers647b1a82014-10-10 11:02:11 -0700781#if defined(__clang__)
782#pragma clang diagnostic pop
783#endif
784
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200785 HANDLE_INSTRUCTION_START(CMP_LONG) {
786 int64_t val1 = shadow_frame.GetVRegLong(inst->VRegB_23x());
787 int64_t val2 = shadow_frame.GetVRegLong(inst->VRegC_23x());
788 int32_t result;
789 if (val1 > val2) {
790 result = 1;
791 } else if (val1 == val2) {
792 result = 0;
793 } else {
794 result = -1;
795 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200796 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200797 ADVANCE(2);
798 }
799 HANDLE_INSTRUCTION_END();
800
801 HANDLE_INSTRUCTION_START(IF_EQ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200802 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) == shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200803 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000804 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200805 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000806 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200807 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700808 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200809 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200810 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200811 }
812 ADVANCE(offset);
813 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800814 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200815 ADVANCE(2);
816 }
817 }
818 HANDLE_INSTRUCTION_END();
819
820 HANDLE_INSTRUCTION_START(IF_NE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700821 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) !=
822 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200823 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000824 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200825 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000826 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200827 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700828 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200829 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200830 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200831 }
832 ADVANCE(offset);
833 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800834 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200835 ADVANCE(2);
836 }
837 }
838 HANDLE_INSTRUCTION_END();
839
840 HANDLE_INSTRUCTION_START(IF_LT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700841 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <
842 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200843 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000844 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200845 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000846 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200847 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700848 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200849 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200850 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200851 }
852 ADVANCE(offset);
853 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800854 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200855 ADVANCE(2);
856 }
857 }
858 HANDLE_INSTRUCTION_END();
859
860 HANDLE_INSTRUCTION_START(IF_GE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700861 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >=
862 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200863 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000864 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200865 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000866 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200867 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700868 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200869 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200870 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200871 }
872 ADVANCE(offset);
873 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800874 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200875 ADVANCE(2);
876 }
877 }
878 HANDLE_INSTRUCTION_END();
879
880 HANDLE_INSTRUCTION_START(IF_GT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700881 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >
882 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200883 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000884 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200885 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000886 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200887 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700888 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200889 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200890 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200891 }
892 ADVANCE(offset);
893 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800894 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200895 ADVANCE(2);
896 }
897 }
898 HANDLE_INSTRUCTION_END();
899
900 HANDLE_INSTRUCTION_START(IF_LE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700901 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <=
902 shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200903 int16_t offset = inst->VRegC_22t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000904 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200905 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000906 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200907 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700908 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200909 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200910 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200911 }
912 ADVANCE(offset);
913 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800914 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200915 ADVANCE(2);
916 }
917 }
918 HANDLE_INSTRUCTION_END();
919
920 HANDLE_INSTRUCTION_START(IF_EQZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200921 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) == 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200922 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000923 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200924 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000925 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200926 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700927 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200928 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200929 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200930 }
931 ADVANCE(offset);
932 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800933 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200934 ADVANCE(2);
935 }
936 }
937 HANDLE_INSTRUCTION_END();
938
939 HANDLE_INSTRUCTION_START(IF_NEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200940 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) != 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200941 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000942 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200943 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000944 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200945 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700946 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200947 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200948 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200949 }
950 ADVANCE(offset);
951 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800952 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200953 ADVANCE(2);
954 }
955 }
956 HANDLE_INSTRUCTION_END();
957
958 HANDLE_INSTRUCTION_START(IF_LTZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200959 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) < 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200960 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000961 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200962 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000963 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200964 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700965 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200966 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200967 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200968 }
969 ADVANCE(offset);
970 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800971 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200972 ADVANCE(2);
973 }
974 }
975 HANDLE_INSTRUCTION_END();
976
977 HANDLE_INSTRUCTION_START(IF_GEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200978 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) >= 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200979 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000980 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200981 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +0000982 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200983 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -0700984 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200985 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200986 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200987 }
988 ADVANCE(offset);
989 } else {
buzbeef1dcacc2016-02-24 14:24:24 -0800990 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200991 ADVANCE(2);
992 }
993 }
994 HANDLE_INSTRUCTION_END();
995
996 HANDLE_INSTRUCTION_START(IF_GTZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200997 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) > 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200998 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +0000999 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001000 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +00001001 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02001002 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -07001003 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +02001004 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02001005 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001006 }
1007 ADVANCE(offset);
1008 } else {
buzbeef1dcacc2016-02-24 14:24:24 -08001009 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001010 ADVANCE(2);
1011 }
1012 }
1013 HANDLE_INSTRUCTION_END();
1014
1015 HANDLE_INSTRUCTION_START(IF_LEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001016 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) <= 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001017 int16_t offset = inst->VRegB_21t();
Nicolas Geoffray81f0f952016-01-20 16:25:19 +00001018 BRANCH_INSTRUMENTATION(offset);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001019 if (IsBackwardBranch(offset)) {
Bill Buzbee4a8ac9c2016-03-25 13:16:55 +00001020 HOTNESS_UPDATE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02001021 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -07001022 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +02001023 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02001024 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001025 }
1026 ADVANCE(offset);
1027 } else {
buzbeef1dcacc2016-02-24 14:24:24 -08001028 BRANCH_INSTRUMENTATION(2);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001029 ADVANCE(2);
1030 }
1031 }
1032 HANDLE_INSTRUCTION_END();
1033
1034 HANDLE_INSTRUCTION_START(AGET_BOOLEAN) {
1035 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001036 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001037 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001038 HANDLE_PENDING_EXCEPTION();
1039 } else {
1040 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1041 BooleanArray* array = a->AsBooleanArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001042 if (LIKELY(array->CheckIsValidIndex(index))) {
1043 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001044 ADVANCE(2);
1045 } else {
1046 HANDLE_PENDING_EXCEPTION();
1047 }
1048 }
1049 }
1050 HANDLE_INSTRUCTION_END();
1051
1052 HANDLE_INSTRUCTION_START(AGET_BYTE) {
1053 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001054 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001055 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001056 HANDLE_PENDING_EXCEPTION();
1057 } else {
1058 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1059 ByteArray* array = a->AsByteArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001060 if (LIKELY(array->CheckIsValidIndex(index))) {
1061 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001062 ADVANCE(2);
1063 } else {
1064 HANDLE_PENDING_EXCEPTION();
1065 }
1066 }
1067 }
1068 HANDLE_INSTRUCTION_END();
1069
1070 HANDLE_INSTRUCTION_START(AGET_CHAR) {
1071 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001072 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001073 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001074 HANDLE_PENDING_EXCEPTION();
1075 } else {
1076 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1077 CharArray* array = a->AsCharArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001078 if (LIKELY(array->CheckIsValidIndex(index))) {
1079 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001080 ADVANCE(2);
1081 } else {
1082 HANDLE_PENDING_EXCEPTION();
1083 }
1084 }
1085 }
1086 HANDLE_INSTRUCTION_END();
1087
1088 HANDLE_INSTRUCTION_START(AGET_SHORT) {
1089 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001090 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001091 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001092 HANDLE_PENDING_EXCEPTION();
1093 } else {
1094 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1095 ShortArray* array = a->AsShortArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001096 if (LIKELY(array->CheckIsValidIndex(index))) {
1097 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001098 ADVANCE(2);
1099 } else {
1100 HANDLE_PENDING_EXCEPTION();
1101 }
1102 }
1103 }
1104 HANDLE_INSTRUCTION_END();
1105
1106 HANDLE_INSTRUCTION_START(AGET) {
1107 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001108 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001109 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001110 HANDLE_PENDING_EXCEPTION();
1111 } else {
1112 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001113 DCHECK(a->IsIntArray() || a->IsFloatArray()) << PrettyTypeOf(a);
1114 auto* array = down_cast<IntArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001115 if (LIKELY(array->CheckIsValidIndex(index))) {
1116 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001117 ADVANCE(2);
1118 } else {
1119 HANDLE_PENDING_EXCEPTION();
1120 }
1121 }
1122 }
1123 HANDLE_INSTRUCTION_END();
1124
1125 HANDLE_INSTRUCTION_START(AGET_WIDE) {
1126 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001127 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001128 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001129 HANDLE_PENDING_EXCEPTION();
1130 } else {
1131 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001132 DCHECK(a->IsLongArray() || a->IsDoubleArray()) << PrettyTypeOf(a);
1133 auto* array = down_cast<LongArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001134 if (LIKELY(array->CheckIsValidIndex(index))) {
1135 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001136 ADVANCE(2);
1137 } else {
1138 HANDLE_PENDING_EXCEPTION();
1139 }
1140 }
1141 }
1142 HANDLE_INSTRUCTION_END();
1143
1144 HANDLE_INSTRUCTION_START(AGET_OBJECT) {
1145 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001146 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001147 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001148 HANDLE_PENDING_EXCEPTION();
1149 } else {
1150 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1151 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001152 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001153 shadow_frame.SetVRegReference(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001154 ADVANCE(2);
1155 } else {
1156 HANDLE_PENDING_EXCEPTION();
1157 }
1158 }
1159 }
1160 HANDLE_INSTRUCTION_END();
1161
1162 HANDLE_INSTRUCTION_START(APUT_BOOLEAN) {
1163 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001164 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001165 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001166 HANDLE_PENDING_EXCEPTION();
1167 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001168 uint8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001169 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1170 BooleanArray* array = a->AsBooleanArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001171 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001172 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001173 ADVANCE(2);
1174 } else {
1175 HANDLE_PENDING_EXCEPTION();
1176 }
1177 }
1178 }
1179 HANDLE_INSTRUCTION_END();
1180
1181 HANDLE_INSTRUCTION_START(APUT_BYTE) {
1182 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001183 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001184 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001185 HANDLE_PENDING_EXCEPTION();
1186 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001187 int8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001188 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1189 ByteArray* array = a->AsByteArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001190 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001191 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001192 ADVANCE(2);
1193 } else {
1194 HANDLE_PENDING_EXCEPTION();
1195 }
1196 }
1197 }
1198 HANDLE_INSTRUCTION_END();
1199
1200 HANDLE_INSTRUCTION_START(APUT_CHAR) {
1201 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001202 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001203 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001204 HANDLE_PENDING_EXCEPTION();
1205 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001206 uint16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001207 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1208 CharArray* array = a->AsCharArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001209 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001210 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001211 ADVANCE(2);
1212 } else {
1213 HANDLE_PENDING_EXCEPTION();
1214 }
1215 }
1216 }
1217 HANDLE_INSTRUCTION_END();
1218
1219 HANDLE_INSTRUCTION_START(APUT_SHORT) {
1220 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001221 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001222 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001223 HANDLE_PENDING_EXCEPTION();
1224 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001225 int16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001226 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1227 ShortArray* array = a->AsShortArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001228 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001229 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001230 ADVANCE(2);
1231 } else {
1232 HANDLE_PENDING_EXCEPTION();
1233 }
1234 }
1235 }
1236 HANDLE_INSTRUCTION_END();
1237
1238 HANDLE_INSTRUCTION_START(APUT) {
1239 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001240 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001241 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001242 HANDLE_PENDING_EXCEPTION();
1243 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001244 int32_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001245 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001246 DCHECK(a->IsIntArray() || a->IsFloatArray()) << PrettyTypeOf(a);
1247 auto* array = down_cast<IntArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001248 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001249 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001250 ADVANCE(2);
1251 } else {
1252 HANDLE_PENDING_EXCEPTION();
1253 }
1254 }
1255 }
1256 HANDLE_INSTRUCTION_END();
1257
1258 HANDLE_INSTRUCTION_START(APUT_WIDE) {
1259 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001260 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001261 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001262 HANDLE_PENDING_EXCEPTION();
1263 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001264 int64_t val = shadow_frame.GetVRegLong(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001265 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Mathieu Chartiere401d142015-04-22 13:56:20 -07001266 DCHECK(a->IsLongArray() || a->IsDoubleArray()) << PrettyTypeOf(a);
1267 auto* array = down_cast<LongArray*>(a);
Sebastien Hertzabff6432014-01-27 18:01:39 +01001268 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001269 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001270 ADVANCE(2);
1271 } else {
1272 HANDLE_PENDING_EXCEPTION();
1273 }
1274 }
1275 }
1276 HANDLE_INSTRUCTION_END();
1277
1278 HANDLE_INSTRUCTION_START(APUT_OBJECT) {
1279 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001280 if (UNLIKELY(a == nullptr)) {
Nicolas Geoffray0aa50ce2015-03-10 11:03:29 +00001281 ThrowNullPointerExceptionFromInterpreter();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001282 HANDLE_PENDING_EXCEPTION();
1283 } else {
1284 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001285 Object* val = shadow_frame.GetVRegReference(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001286 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001287 if (LIKELY(array->CheckIsValidIndex(index) && array->CheckAssignable(val))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001288 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001289 ADVANCE(2);
1290 } else {
1291 HANDLE_PENDING_EXCEPTION();
1292 }
1293 }
1294 }
1295 HANDLE_INSTRUCTION_END();
1296
1297 HANDLE_INSTRUCTION_START(IGET_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001298 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimBoolean, do_access_check>(
1299 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001300 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1301 }
1302 HANDLE_INSTRUCTION_END();
1303
1304 HANDLE_INSTRUCTION_START(IGET_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001305 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimByte, do_access_check>(
1306 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001307 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1308 }
1309 HANDLE_INSTRUCTION_END();
1310
1311 HANDLE_INSTRUCTION_START(IGET_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001312 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimChar, do_access_check>(
1313 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001314 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1315 }
1316 HANDLE_INSTRUCTION_END();
1317
1318 HANDLE_INSTRUCTION_START(IGET_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001319 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimShort, do_access_check>(
1320 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001321 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1322 }
1323 HANDLE_INSTRUCTION_END();
1324
1325 HANDLE_INSTRUCTION_START(IGET) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001326 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimInt, do_access_check>(
1327 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001328 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1329 }
1330 HANDLE_INSTRUCTION_END();
1331
1332 HANDLE_INSTRUCTION_START(IGET_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001333 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimLong, do_access_check>(
1334 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001335 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1336 }
1337 HANDLE_INSTRUCTION_END();
1338
1339 HANDLE_INSTRUCTION_START(IGET_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001340 bool success = DoFieldGet<InstanceObjectRead, Primitive::kPrimNot, do_access_check>(
1341 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001342 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1343 }
1344 HANDLE_INSTRUCTION_END();
1345
1346 HANDLE_INSTRUCTION_START(IGET_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001347 bool success = DoIGetQuick<Primitive::kPrimInt>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001348 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1349 }
1350 HANDLE_INSTRUCTION_END();
1351
Mathieu Chartierffc605c2014-12-10 10:35:44 -08001352 HANDLE_INSTRUCTION_START(IGET_BOOLEAN_QUICK) {
1353 bool success = DoIGetQuick<Primitive::kPrimBoolean>(shadow_frame, inst, inst_data);
1354 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1355 }
1356 HANDLE_INSTRUCTION_END();
1357
1358 HANDLE_INSTRUCTION_START(IGET_BYTE_QUICK) {
1359 bool success = DoIGetQuick<Primitive::kPrimByte>(shadow_frame, inst, inst_data);
1360 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1361 }
1362 HANDLE_INSTRUCTION_END();
1363
1364 HANDLE_INSTRUCTION_START(IGET_CHAR_QUICK) {
1365 bool success = DoIGetQuick<Primitive::kPrimChar>(shadow_frame, inst, inst_data);
1366 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1367 }
1368 HANDLE_INSTRUCTION_END();
1369
1370 HANDLE_INSTRUCTION_START(IGET_SHORT_QUICK) {
1371 bool success = DoIGetQuick<Primitive::kPrimShort>(shadow_frame, inst, inst_data);
1372 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1373 }
1374 HANDLE_INSTRUCTION_END();
1375
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001376 HANDLE_INSTRUCTION_START(IGET_WIDE_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001377 bool success = DoIGetQuick<Primitive::kPrimLong>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001378 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1379 }
1380 HANDLE_INSTRUCTION_END();
1381
1382 HANDLE_INSTRUCTION_START(IGET_OBJECT_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001383 bool success = DoIGetQuick<Primitive::kPrimNot>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001384 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1385 }
1386 HANDLE_INSTRUCTION_END();
1387
1388 HANDLE_INSTRUCTION_START(SGET_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001389 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimBoolean, do_access_check>(
1390 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001391 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1392 }
1393 HANDLE_INSTRUCTION_END();
1394
1395 HANDLE_INSTRUCTION_START(SGET_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001396 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimByte, do_access_check>(
1397 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001398 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1399 }
1400 HANDLE_INSTRUCTION_END();
1401
1402 HANDLE_INSTRUCTION_START(SGET_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001403 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimChar, do_access_check>(
1404 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001405 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1406 }
1407 HANDLE_INSTRUCTION_END();
1408
1409 HANDLE_INSTRUCTION_START(SGET_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001410 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimShort, do_access_check>(
1411 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001412 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1413 }
1414 HANDLE_INSTRUCTION_END();
1415
1416 HANDLE_INSTRUCTION_START(SGET) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001417 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimInt, do_access_check>(
1418 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001419 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1420 }
1421 HANDLE_INSTRUCTION_END();
1422
1423 HANDLE_INSTRUCTION_START(SGET_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001424 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimLong, do_access_check>(
1425 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001426 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1427 }
1428 HANDLE_INSTRUCTION_END();
1429
1430 HANDLE_INSTRUCTION_START(SGET_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001431 bool success = DoFieldGet<StaticObjectRead, Primitive::kPrimNot, do_access_check>(
1432 self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001433 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1434 }
1435 HANDLE_INSTRUCTION_END();
1436
1437 HANDLE_INSTRUCTION_START(IPUT_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001438 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimBoolean, do_access_check,
1439 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001440 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1441 }
1442 HANDLE_INSTRUCTION_END();
1443
1444 HANDLE_INSTRUCTION_START(IPUT_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001445 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimByte, do_access_check,
1446 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001447 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1448 }
1449 HANDLE_INSTRUCTION_END();
1450
1451 HANDLE_INSTRUCTION_START(IPUT_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001452 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimChar, do_access_check,
1453 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001454 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1455 }
1456 HANDLE_INSTRUCTION_END();
1457
1458 HANDLE_INSTRUCTION_START(IPUT_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001459 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimShort, do_access_check,
1460 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001461 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1462 }
1463 HANDLE_INSTRUCTION_END();
1464
1465 HANDLE_INSTRUCTION_START(IPUT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001466 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimInt, do_access_check,
1467 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001468 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1469 }
1470 HANDLE_INSTRUCTION_END();
1471
1472 HANDLE_INSTRUCTION_START(IPUT_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001473 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimLong, do_access_check,
1474 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001475 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1476 }
1477 HANDLE_INSTRUCTION_END();
1478
1479 HANDLE_INSTRUCTION_START(IPUT_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001480 bool success = DoFieldPut<InstanceObjectWrite, Primitive::kPrimNot, do_access_check,
1481 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001482 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1483 }
1484 HANDLE_INSTRUCTION_END();
1485
1486 HANDLE_INSTRUCTION_START(IPUT_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001487 bool success = DoIPutQuick<Primitive::kPrimInt, transaction_active>(
1488 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001489 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1490 }
1491 HANDLE_INSTRUCTION_END();
1492
Fred Shih37f05ef2014-07-16 18:38:08 -07001493 HANDLE_INSTRUCTION_START(IPUT_BOOLEAN_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001494 bool success = DoIPutQuick<Primitive::kPrimBoolean, transaction_active>(
1495 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001496 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1497 }
1498 HANDLE_INSTRUCTION_END();
1499
1500 HANDLE_INSTRUCTION_START(IPUT_BYTE_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001501 bool success = DoIPutQuick<Primitive::kPrimByte, transaction_active>(
1502 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001503 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1504 }
1505 HANDLE_INSTRUCTION_END();
1506
1507 HANDLE_INSTRUCTION_START(IPUT_CHAR_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001508 bool success = DoIPutQuick<Primitive::kPrimChar, transaction_active>(
1509 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001510 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1511 }
1512 HANDLE_INSTRUCTION_END();
1513
1514 HANDLE_INSTRUCTION_START(IPUT_SHORT_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001515 bool success = DoIPutQuick<Primitive::kPrimShort, transaction_active>(
1516 shadow_frame, inst, inst_data);
Fred Shih37f05ef2014-07-16 18:38:08 -07001517 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1518 }
1519 HANDLE_INSTRUCTION_END();
1520
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001521 HANDLE_INSTRUCTION_START(IPUT_WIDE_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001522 bool success = DoIPutQuick<Primitive::kPrimLong, transaction_active>(
1523 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001524 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1525 }
1526 HANDLE_INSTRUCTION_END();
1527
1528 HANDLE_INSTRUCTION_START(IPUT_OBJECT_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001529 bool success = DoIPutQuick<Primitive::kPrimNot, transaction_active>(
1530 shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001531 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1532 }
1533 HANDLE_INSTRUCTION_END();
1534
1535 HANDLE_INSTRUCTION_START(SPUT_BOOLEAN) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001536 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimBoolean, do_access_check,
1537 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001538 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1539 }
1540 HANDLE_INSTRUCTION_END();
1541
1542 HANDLE_INSTRUCTION_START(SPUT_BYTE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001543 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimByte, do_access_check,
1544 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001545 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1546 }
1547 HANDLE_INSTRUCTION_END();
1548
1549 HANDLE_INSTRUCTION_START(SPUT_CHAR) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001550 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimChar, do_access_check,
1551 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001552 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1553 }
1554 HANDLE_INSTRUCTION_END();
1555
1556 HANDLE_INSTRUCTION_START(SPUT_SHORT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001557 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimShort, do_access_check,
1558 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001559 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1560 }
1561 HANDLE_INSTRUCTION_END();
1562
1563 HANDLE_INSTRUCTION_START(SPUT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001564 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimInt, do_access_check,
1565 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001566 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1567 }
1568 HANDLE_INSTRUCTION_END();
1569
1570 HANDLE_INSTRUCTION_START(SPUT_WIDE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001571 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimLong, do_access_check,
1572 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001573 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1574 }
1575 HANDLE_INSTRUCTION_END();
1576
1577 HANDLE_INSTRUCTION_START(SPUT_OBJECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001578 bool success = DoFieldPut<StaticObjectWrite, Primitive::kPrimNot, do_access_check,
1579 transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001580 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1581 }
1582 HANDLE_INSTRUCTION_END();
1583
1584 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001585 bool success = DoInvoke<kVirtual, false, do_access_check>(
1586 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001587 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001588 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1589 }
1590 HANDLE_INSTRUCTION_END();
1591
1592 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001593 bool success = DoInvoke<kVirtual, true, do_access_check>(
1594 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001595 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001596 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1597 }
1598 HANDLE_INSTRUCTION_END();
1599
1600 HANDLE_INSTRUCTION_START(INVOKE_SUPER) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001601 bool success = DoInvoke<kSuper, false, do_access_check>(
1602 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001603 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001604 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1605 }
1606 HANDLE_INSTRUCTION_END();
1607
1608 HANDLE_INSTRUCTION_START(INVOKE_SUPER_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001609 bool success = DoInvoke<kSuper, true, do_access_check>(
1610 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001611 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001612 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1613 }
1614 HANDLE_INSTRUCTION_END();
1615
1616 HANDLE_INSTRUCTION_START(INVOKE_DIRECT) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001617 bool success = DoInvoke<kDirect, false, do_access_check>(
1618 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001619 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001620 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1621 }
1622 HANDLE_INSTRUCTION_END();
1623
1624 HANDLE_INSTRUCTION_START(INVOKE_DIRECT_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001625 bool success = DoInvoke<kDirect, true, do_access_check>(
1626 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001627 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001628 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1629 }
1630 HANDLE_INSTRUCTION_END();
1631
1632 HANDLE_INSTRUCTION_START(INVOKE_INTERFACE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001633 bool success = DoInvoke<kInterface, false, do_access_check>(
1634 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001635 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001636 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1637 }
1638 HANDLE_INSTRUCTION_END();
1639
1640 HANDLE_INSTRUCTION_START(INVOKE_INTERFACE_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001641 bool success = DoInvoke<kInterface, true, do_access_check>(
1642 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001643 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001644 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1645 }
1646 HANDLE_INSTRUCTION_END();
1647
1648 HANDLE_INSTRUCTION_START(INVOKE_STATIC) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001649 bool success = DoInvoke<kStatic, false, do_access_check>(
1650 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001651 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001652 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1653 }
1654 HANDLE_INSTRUCTION_END();
1655
1656 HANDLE_INSTRUCTION_START(INVOKE_STATIC_RANGE) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001657 bool success = DoInvoke<kStatic, true, do_access_check>(
1658 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001659 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001660 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1661 }
1662 HANDLE_INSTRUCTION_END();
1663
1664 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001665 bool success = DoInvokeVirtualQuick<false>(
1666 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001667 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001668 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1669 }
1670 HANDLE_INSTRUCTION_END();
1671
1672 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE_QUICK) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001673 bool success = DoInvokeVirtualQuick<true>(
1674 self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001675 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001676 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1677 }
1678 HANDLE_INSTRUCTION_END();
1679
Igor Murashkin158f35c2015-06-10 15:55:30 -07001680 HANDLE_EXPERIMENTAL_INSTRUCTION_START(INVOKE_LAMBDA) {
1681 bool success = DoInvokeLambda<do_access_check>(self, shadow_frame, inst, inst_data,
1682 &result_register);
1683 UPDATE_HANDLER_TABLE();
1684 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1685 }
1686 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
1687
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001688 HANDLE_INSTRUCTION_START(NEG_INT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001689 shadow_frame.SetVReg(
1690 inst->VRegA_12x(inst_data), -shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001691 ADVANCE(1);
1692 HANDLE_INSTRUCTION_END();
1693
1694 HANDLE_INSTRUCTION_START(NOT_INT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001695 shadow_frame.SetVReg(
1696 inst->VRegA_12x(inst_data), ~shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001697 ADVANCE(1);
1698 HANDLE_INSTRUCTION_END();
1699
1700 HANDLE_INSTRUCTION_START(NEG_LONG)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001701 shadow_frame.SetVRegLong(
1702 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001703 ADVANCE(1);
1704 HANDLE_INSTRUCTION_END();
1705
1706 HANDLE_INSTRUCTION_START(NOT_LONG)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001707 shadow_frame.SetVRegLong(
1708 inst->VRegA_12x(inst_data), ~shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001709 ADVANCE(1);
1710 HANDLE_INSTRUCTION_END();
1711
1712 HANDLE_INSTRUCTION_START(NEG_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001713 shadow_frame.SetVRegFloat(
1714 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001715 ADVANCE(1);
1716 HANDLE_INSTRUCTION_END();
1717
1718 HANDLE_INSTRUCTION_START(NEG_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001719 shadow_frame.SetVRegDouble(
1720 inst->VRegA_12x(inst_data), -shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001721 ADVANCE(1);
1722 HANDLE_INSTRUCTION_END();
1723
1724 HANDLE_INSTRUCTION_START(INT_TO_LONG)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001725 shadow_frame.SetVRegLong(
1726 inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001727 ADVANCE(1);
1728 HANDLE_INSTRUCTION_END();
1729
1730 HANDLE_INSTRUCTION_START(INT_TO_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001731 shadow_frame.SetVRegFloat(
1732 inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001733 ADVANCE(1);
1734 HANDLE_INSTRUCTION_END();
1735
1736 HANDLE_INSTRUCTION_START(INT_TO_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001737 shadow_frame.SetVRegDouble(
1738 inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001739 ADVANCE(1);
1740 HANDLE_INSTRUCTION_END();
1741
1742 HANDLE_INSTRUCTION_START(LONG_TO_INT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001743 shadow_frame.SetVReg(
1744 inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001745 ADVANCE(1);
1746 HANDLE_INSTRUCTION_END();
1747
1748 HANDLE_INSTRUCTION_START(LONG_TO_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001749 shadow_frame.SetVRegFloat(
1750 inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001751 ADVANCE(1);
1752 HANDLE_INSTRUCTION_END();
1753
1754 HANDLE_INSTRUCTION_START(LONG_TO_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001755 shadow_frame.SetVRegDouble(
1756 inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001757 ADVANCE(1);
1758 HANDLE_INSTRUCTION_END();
1759
1760 HANDLE_INSTRUCTION_START(FLOAT_TO_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001761 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001762 int32_t result = art_float_to_integral<int32_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001763 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001764 ADVANCE(1);
1765 }
1766 HANDLE_INSTRUCTION_END();
1767
1768 HANDLE_INSTRUCTION_START(FLOAT_TO_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001769 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001770 int64_t result = art_float_to_integral<int64_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001771 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001772 ADVANCE(1);
1773 }
1774 HANDLE_INSTRUCTION_END();
1775
1776 HANDLE_INSTRUCTION_START(FLOAT_TO_DOUBLE)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001777 shadow_frame.SetVRegDouble(
1778 inst->VRegA_12x(inst_data), shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001779 ADVANCE(1);
1780 HANDLE_INSTRUCTION_END();
1781
1782 HANDLE_INSTRUCTION_START(DOUBLE_TO_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001783 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001784 int32_t result = art_float_to_integral<int32_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001785 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001786 ADVANCE(1);
1787 }
1788 HANDLE_INSTRUCTION_END();
1789
1790 HANDLE_INSTRUCTION_START(DOUBLE_TO_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001791 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001792 int64_t result = art_float_to_integral<int64_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001793 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001794 ADVANCE(1);
1795 }
1796 HANDLE_INSTRUCTION_END();
1797
1798 HANDLE_INSTRUCTION_START(DOUBLE_TO_FLOAT)
Mathieu Chartier2cebb242015-04-21 16:50:40 -07001799 shadow_frame.SetVRegFloat(
1800 inst->VRegA_12x(inst_data), shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001801 ADVANCE(1);
1802 HANDLE_INSTRUCTION_END();
1803
1804 HANDLE_INSTRUCTION_START(INT_TO_BYTE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001805 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1806 static_cast<int8_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001807 ADVANCE(1);
1808 HANDLE_INSTRUCTION_END();
1809
1810 HANDLE_INSTRUCTION_START(INT_TO_CHAR)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001811 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1812 static_cast<uint16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001813 ADVANCE(1);
1814 HANDLE_INSTRUCTION_END();
1815
1816 HANDLE_INSTRUCTION_START(INT_TO_SHORT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001817 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1818 static_cast<int16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001819 ADVANCE(1);
1820 HANDLE_INSTRUCTION_END();
1821
1822 HANDLE_INSTRUCTION_START(ADD_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001823 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001824 SafeAdd(shadow_frame.GetVReg(inst->VRegB_23x()),
1825 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001826 ADVANCE(2);
1827 HANDLE_INSTRUCTION_END();
1828
1829 HANDLE_INSTRUCTION_START(SUB_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001830 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001831 SafeSub(shadow_frame.GetVReg(inst->VRegB_23x()),
1832 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001833 ADVANCE(2);
1834 HANDLE_INSTRUCTION_END();
1835
1836 HANDLE_INSTRUCTION_START(MUL_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001837 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001838 SafeMul(shadow_frame.GetVReg(inst->VRegB_23x()),
1839 shadow_frame.GetVReg(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001840 ADVANCE(2);
1841 HANDLE_INSTRUCTION_END();
1842
1843 HANDLE_INSTRUCTION_START(DIV_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001844 bool success = DoIntDivide(shadow_frame, inst->VRegA_23x(inst_data),
1845 shadow_frame.GetVReg(inst->VRegB_23x()),
1846 shadow_frame.GetVReg(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001847 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1848 }
1849 HANDLE_INSTRUCTION_END();
1850
1851 HANDLE_INSTRUCTION_START(REM_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001852 bool success = DoIntRemainder(shadow_frame, inst->VRegA_23x(inst_data),
1853 shadow_frame.GetVReg(inst->VRegB_23x()),
1854 shadow_frame.GetVReg(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001855 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1856 }
1857 HANDLE_INSTRUCTION_END();
1858
1859 HANDLE_INSTRUCTION_START(SHL_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001860 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001861 shadow_frame.GetVReg(inst->VRegB_23x()) <<
1862 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1863 ADVANCE(2);
1864 HANDLE_INSTRUCTION_END();
1865
1866 HANDLE_INSTRUCTION_START(SHR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001867 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001868 shadow_frame.GetVReg(inst->VRegB_23x()) >>
1869 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1870 ADVANCE(2);
1871 HANDLE_INSTRUCTION_END();
1872
1873 HANDLE_INSTRUCTION_START(USHR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001874 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001875 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_23x())) >>
1876 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1877 ADVANCE(2);
1878 HANDLE_INSTRUCTION_END();
1879
1880 HANDLE_INSTRUCTION_START(AND_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001881 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001882 shadow_frame.GetVReg(inst->VRegB_23x()) &
1883 shadow_frame.GetVReg(inst->VRegC_23x()));
1884 ADVANCE(2);
1885 HANDLE_INSTRUCTION_END();
1886
1887 HANDLE_INSTRUCTION_START(OR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001888 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001889 shadow_frame.GetVReg(inst->VRegB_23x()) |
1890 shadow_frame.GetVReg(inst->VRegC_23x()));
1891 ADVANCE(2);
1892 HANDLE_INSTRUCTION_END();
1893
1894 HANDLE_INSTRUCTION_START(XOR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001895 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001896 shadow_frame.GetVReg(inst->VRegB_23x()) ^
1897 shadow_frame.GetVReg(inst->VRegC_23x()));
1898 ADVANCE(2);
1899 HANDLE_INSTRUCTION_END();
1900
1901 HANDLE_INSTRUCTION_START(ADD_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001902 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001903 SafeAdd(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1904 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001905 ADVANCE(2);
1906 HANDLE_INSTRUCTION_END();
1907
1908 HANDLE_INSTRUCTION_START(SUB_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001909 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001910 SafeSub(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1911 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001912 ADVANCE(2);
1913 HANDLE_INSTRUCTION_END();
1914
1915 HANDLE_INSTRUCTION_START(MUL_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001916 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07001917 SafeMul(shadow_frame.GetVRegLong(inst->VRegB_23x()),
1918 shadow_frame.GetVRegLong(inst->VRegC_23x())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001919 ADVANCE(2);
1920 HANDLE_INSTRUCTION_END();
1921
1922 HANDLE_INSTRUCTION_START(DIV_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001923 bool success = DoLongDivide(shadow_frame, inst->VRegA_23x(inst_data),
1924 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1925 shadow_frame.GetVRegLong(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001926 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1927 }
1928 HANDLE_INSTRUCTION_END();
1929
1930 HANDLE_INSTRUCTION_START(REM_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001931 bool success = DoLongRemainder(shadow_frame, inst->VRegA_23x(inst_data),
1932 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1933 shadow_frame.GetVRegLong(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001934 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1935 }
1936 HANDLE_INSTRUCTION_END();
1937
1938 HANDLE_INSTRUCTION_START(AND_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001939 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001940 shadow_frame.GetVRegLong(inst->VRegB_23x()) &
1941 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1942 ADVANCE(2);
1943 HANDLE_INSTRUCTION_END();
1944
1945 HANDLE_INSTRUCTION_START(OR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001946 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001947 shadow_frame.GetVRegLong(inst->VRegB_23x()) |
1948 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1949 ADVANCE(2);
1950 HANDLE_INSTRUCTION_END();
1951
1952 HANDLE_INSTRUCTION_START(XOR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001953 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001954 shadow_frame.GetVRegLong(inst->VRegB_23x()) ^
1955 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1956 ADVANCE(2);
1957 HANDLE_INSTRUCTION_END();
1958
1959 HANDLE_INSTRUCTION_START(SHL_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001960 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001961 shadow_frame.GetVRegLong(inst->VRegB_23x()) <<
1962 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1963 ADVANCE(2);
1964 HANDLE_INSTRUCTION_END();
1965
1966 HANDLE_INSTRUCTION_START(SHR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001967 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001968 shadow_frame.GetVRegLong(inst->VRegB_23x()) >>
1969 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1970 ADVANCE(2);
1971 HANDLE_INSTRUCTION_END();
1972
1973 HANDLE_INSTRUCTION_START(USHR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001974 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001975 static_cast<uint64_t>(shadow_frame.GetVRegLong(inst->VRegB_23x())) >>
1976 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1977 ADVANCE(2);
1978 HANDLE_INSTRUCTION_END();
1979
1980 HANDLE_INSTRUCTION_START(ADD_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001981 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001982 shadow_frame.GetVRegFloat(inst->VRegB_23x()) +
1983 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1984 ADVANCE(2);
1985 HANDLE_INSTRUCTION_END();
1986
1987 HANDLE_INSTRUCTION_START(SUB_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001988 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001989 shadow_frame.GetVRegFloat(inst->VRegB_23x()) -
1990 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1991 ADVANCE(2);
1992 HANDLE_INSTRUCTION_END();
1993
1994 HANDLE_INSTRUCTION_START(MUL_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001995 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001996 shadow_frame.GetVRegFloat(inst->VRegB_23x()) *
1997 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1998 ADVANCE(2);
1999 HANDLE_INSTRUCTION_END();
2000
2001 HANDLE_INSTRUCTION_START(DIV_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002002 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002003 shadow_frame.GetVRegFloat(inst->VRegB_23x()) /
2004 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
2005 ADVANCE(2);
2006 HANDLE_INSTRUCTION_END();
2007
2008 HANDLE_INSTRUCTION_START(REM_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002009 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002010 fmodf(shadow_frame.GetVRegFloat(inst->VRegB_23x()),
2011 shadow_frame.GetVRegFloat(inst->VRegC_23x())));
2012 ADVANCE(2);
2013 HANDLE_INSTRUCTION_END();
2014
2015 HANDLE_INSTRUCTION_START(ADD_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002016 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002017 shadow_frame.GetVRegDouble(inst->VRegB_23x()) +
2018 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2019 ADVANCE(2);
2020 HANDLE_INSTRUCTION_END();
2021
2022 HANDLE_INSTRUCTION_START(SUB_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002023 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002024 shadow_frame.GetVRegDouble(inst->VRegB_23x()) -
2025 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2026 ADVANCE(2);
2027 HANDLE_INSTRUCTION_END();
2028
2029 HANDLE_INSTRUCTION_START(MUL_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002030 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002031 shadow_frame.GetVRegDouble(inst->VRegB_23x()) *
2032 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2033 ADVANCE(2);
2034 HANDLE_INSTRUCTION_END();
2035
2036 HANDLE_INSTRUCTION_START(DIV_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002037 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002038 shadow_frame.GetVRegDouble(inst->VRegB_23x()) /
2039 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
2040 ADVANCE(2);
2041 HANDLE_INSTRUCTION_END();
2042
2043 HANDLE_INSTRUCTION_START(REM_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002044 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002045 fmod(shadow_frame.GetVRegDouble(inst->VRegB_23x()),
2046 shadow_frame.GetVRegDouble(inst->VRegC_23x())));
2047 ADVANCE(2);
2048 HANDLE_INSTRUCTION_END();
2049
2050 HANDLE_INSTRUCTION_START(ADD_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002051 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002052 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002053 SafeAdd(shadow_frame.GetVReg(vregA),
2054 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002055 ADVANCE(1);
2056 }
2057 HANDLE_INSTRUCTION_END();
2058
2059 HANDLE_INSTRUCTION_START(SUB_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002060 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002061 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002062 SafeSub(shadow_frame.GetVReg(vregA),
2063 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002064 ADVANCE(1);
2065 }
2066 HANDLE_INSTRUCTION_END();
2067
2068 HANDLE_INSTRUCTION_START(MUL_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002069 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002070 shadow_frame.SetVReg(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002071 SafeMul(shadow_frame.GetVReg(vregA),
2072 shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002073 ADVANCE(1);
2074 }
2075 HANDLE_INSTRUCTION_END();
2076
2077 HANDLE_INSTRUCTION_START(DIV_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002078 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002079 bool success = DoIntDivide(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002080 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002081 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2082 }
2083 HANDLE_INSTRUCTION_END();
2084
2085 HANDLE_INSTRUCTION_START(REM_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002086 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002087 bool success = DoIntRemainder(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002088 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002089 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2090 }
2091 HANDLE_INSTRUCTION_END();
2092
2093 HANDLE_INSTRUCTION_START(SHL_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002094 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002095 shadow_frame.SetVReg(vregA,
2096 shadow_frame.GetVReg(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002097 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002098 ADVANCE(1);
2099 }
2100 HANDLE_INSTRUCTION_END();
2101
2102 HANDLE_INSTRUCTION_START(SHR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002103 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002104 shadow_frame.SetVReg(vregA,
2105 shadow_frame.GetVReg(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002106 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002107 ADVANCE(1);
2108 }
2109 HANDLE_INSTRUCTION_END();
2110
2111 HANDLE_INSTRUCTION_START(USHR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002112 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002113 shadow_frame.SetVReg(vregA,
2114 static_cast<uint32_t>(shadow_frame.GetVReg(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002115 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002116 ADVANCE(1);
2117 }
2118 HANDLE_INSTRUCTION_END();
2119
2120 HANDLE_INSTRUCTION_START(AND_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002121 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002122 shadow_frame.SetVReg(vregA,
2123 shadow_frame.GetVReg(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002124 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002125 ADVANCE(1);
2126 }
2127 HANDLE_INSTRUCTION_END();
2128
2129 HANDLE_INSTRUCTION_START(OR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002130 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002131 shadow_frame.SetVReg(vregA,
2132 shadow_frame.GetVReg(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002133 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002134 ADVANCE(1);
2135 }
2136 HANDLE_INSTRUCTION_END();
2137
2138 HANDLE_INSTRUCTION_START(XOR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002139 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002140 shadow_frame.SetVReg(vregA,
2141 shadow_frame.GetVReg(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002142 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002143 ADVANCE(1);
2144 }
2145 HANDLE_INSTRUCTION_END();
2146
2147 HANDLE_INSTRUCTION_START(ADD_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002148 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002149 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002150 SafeAdd(shadow_frame.GetVRegLong(vregA),
2151 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002152 ADVANCE(1);
2153 }
2154 HANDLE_INSTRUCTION_END();
2155
2156 HANDLE_INSTRUCTION_START(SUB_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002157 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002158 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002159 SafeSub(shadow_frame.GetVRegLong(vregA),
2160 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002161 ADVANCE(1);
2162 }
2163 HANDLE_INSTRUCTION_END();
2164
2165 HANDLE_INSTRUCTION_START(MUL_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002166 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002167 shadow_frame.SetVRegLong(vregA,
Ian Rogersf72a11d2014-10-30 15:41:08 -07002168 SafeMul(shadow_frame.GetVRegLong(vregA),
2169 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002170 ADVANCE(1);
2171 }
2172 HANDLE_INSTRUCTION_END();
2173
2174 HANDLE_INSTRUCTION_START(DIV_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002175 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002176 bool success = DoLongDivide(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002177 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002178 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2179 }
2180 HANDLE_INSTRUCTION_END();
2181
2182 HANDLE_INSTRUCTION_START(REM_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002183 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002184 bool success = DoLongRemainder(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002185 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002186 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
2187 }
2188 HANDLE_INSTRUCTION_END();
2189
2190 HANDLE_INSTRUCTION_START(AND_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002191 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002192 shadow_frame.SetVRegLong(vregA,
2193 shadow_frame.GetVRegLong(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002194 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002195 ADVANCE(1);
2196 }
2197 HANDLE_INSTRUCTION_END();
2198
2199 HANDLE_INSTRUCTION_START(OR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002200 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002201 shadow_frame.SetVRegLong(vregA,
2202 shadow_frame.GetVRegLong(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002203 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002204 ADVANCE(1);
2205 }
2206 HANDLE_INSTRUCTION_END();
2207
2208 HANDLE_INSTRUCTION_START(XOR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002209 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002210 shadow_frame.SetVRegLong(vregA,
2211 shadow_frame.GetVRegLong(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002212 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002213 ADVANCE(1);
2214 }
2215 HANDLE_INSTRUCTION_END();
2216
2217 HANDLE_INSTRUCTION_START(SHL_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002218 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002219 shadow_frame.SetVRegLong(vregA,
2220 shadow_frame.GetVRegLong(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002221 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002222 ADVANCE(1);
2223 }
2224 HANDLE_INSTRUCTION_END();
2225
2226 HANDLE_INSTRUCTION_START(SHR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002227 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002228 shadow_frame.SetVRegLong(vregA,
2229 shadow_frame.GetVRegLong(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002230 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002231 ADVANCE(1);
2232 }
2233 HANDLE_INSTRUCTION_END();
2234
2235 HANDLE_INSTRUCTION_START(USHR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002236 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002237 shadow_frame.SetVRegLong(vregA,
2238 static_cast<uint64_t>(shadow_frame.GetVRegLong(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002239 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002240 ADVANCE(1);
2241 }
2242 HANDLE_INSTRUCTION_END();
2243
2244 HANDLE_INSTRUCTION_START(ADD_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002245 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002246 shadow_frame.SetVRegFloat(vregA,
2247 shadow_frame.GetVRegFloat(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002248 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002249 ADVANCE(1);
2250 }
2251 HANDLE_INSTRUCTION_END();
2252
2253 HANDLE_INSTRUCTION_START(SUB_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002254 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002255 shadow_frame.SetVRegFloat(vregA,
2256 shadow_frame.GetVRegFloat(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002257 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002258 ADVANCE(1);
2259 }
2260 HANDLE_INSTRUCTION_END();
2261
2262 HANDLE_INSTRUCTION_START(MUL_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002263 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002264 shadow_frame.SetVRegFloat(vregA,
2265 shadow_frame.GetVRegFloat(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002266 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002267 ADVANCE(1);
2268 }
2269 HANDLE_INSTRUCTION_END();
2270
2271 HANDLE_INSTRUCTION_START(DIV_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002272 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002273 shadow_frame.SetVRegFloat(vregA,
2274 shadow_frame.GetVRegFloat(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002275 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002276 ADVANCE(1);
2277 }
2278 HANDLE_INSTRUCTION_END();
2279
2280 HANDLE_INSTRUCTION_START(REM_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002281 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002282 shadow_frame.SetVRegFloat(vregA,
2283 fmodf(shadow_frame.GetVRegFloat(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002284 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002285 ADVANCE(1);
2286 }
2287 HANDLE_INSTRUCTION_END();
2288
2289 HANDLE_INSTRUCTION_START(ADD_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002290 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002291 shadow_frame.SetVRegDouble(vregA,
2292 shadow_frame.GetVRegDouble(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002293 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002294 ADVANCE(1);
2295 }
2296 HANDLE_INSTRUCTION_END();
2297
2298 HANDLE_INSTRUCTION_START(SUB_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002299 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002300 shadow_frame.SetVRegDouble(vregA,
2301 shadow_frame.GetVRegDouble(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002302 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002303 ADVANCE(1);
2304 }
2305 HANDLE_INSTRUCTION_END();
2306
2307 HANDLE_INSTRUCTION_START(MUL_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002308 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002309 shadow_frame.SetVRegDouble(vregA,
2310 shadow_frame.GetVRegDouble(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002311 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002312 ADVANCE(1);
2313 }
2314 HANDLE_INSTRUCTION_END();
2315
2316 HANDLE_INSTRUCTION_START(DIV_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002317 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002318 shadow_frame.SetVRegDouble(vregA,
2319 shadow_frame.GetVRegDouble(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002320 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002321 ADVANCE(1);
2322 }
2323 HANDLE_INSTRUCTION_END();
2324
2325 HANDLE_INSTRUCTION_START(REM_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002326 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002327 shadow_frame.SetVRegDouble(vregA,
2328 fmod(shadow_frame.GetVRegDouble(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002329 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002330 ADVANCE(1);
2331 }
2332 HANDLE_INSTRUCTION_END();
2333
2334 HANDLE_INSTRUCTION_START(ADD_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002335 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002336 SafeAdd(shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2337 inst->VRegC_22s()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002338 ADVANCE(2);
2339 HANDLE_INSTRUCTION_END();
2340
2341 HANDLE_INSTRUCTION_START(RSUB_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002342 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002343 SafeSub(inst->VRegC_22s(),
2344 shadow_frame.GetVReg(inst->VRegB_22s(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002345 ADVANCE(2);
2346 HANDLE_INSTRUCTION_END();
2347
2348 HANDLE_INSTRUCTION_START(MUL_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002349 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002350 SafeMul(shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2351 inst->VRegC_22s()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002352 ADVANCE(2);
2353 HANDLE_INSTRUCTION_END();
2354
2355 HANDLE_INSTRUCTION_START(DIV_INT_LIT16) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07002356 bool success = DoIntDivide(
2357 shadow_frame, inst->VRegA_22s(inst_data), shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2358 inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002359 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2360 }
2361 HANDLE_INSTRUCTION_END();
2362
2363 HANDLE_INSTRUCTION_START(REM_INT_LIT16) {
Mathieu Chartier2cebb242015-04-21 16:50:40 -07002364 bool success = DoIntRemainder(
2365 shadow_frame, inst->VRegA_22s(inst_data), shadow_frame.GetVReg(inst->VRegB_22s(inst_data)),
2366 inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002367 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2368 }
2369 HANDLE_INSTRUCTION_END();
2370
2371 HANDLE_INSTRUCTION_START(AND_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002372 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2373 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) &
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002374 inst->VRegC_22s());
2375 ADVANCE(2);
2376 HANDLE_INSTRUCTION_END();
2377
2378 HANDLE_INSTRUCTION_START(OR_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002379 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2380 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) |
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002381 inst->VRegC_22s());
2382 ADVANCE(2);
2383 HANDLE_INSTRUCTION_END();
2384
2385 HANDLE_INSTRUCTION_START(XOR_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002386 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2387 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) ^
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002388 inst->VRegC_22s());
2389 ADVANCE(2);
2390 HANDLE_INSTRUCTION_END();
2391
2392 HANDLE_INSTRUCTION_START(ADD_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002393 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002394 SafeAdd(shadow_frame.GetVReg(inst->VRegB_22b()),
2395 inst->VRegC_22b()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002396 ADVANCE(2);
2397 HANDLE_INSTRUCTION_END();
2398
2399 HANDLE_INSTRUCTION_START(RSUB_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002400 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002401 SafeSub(inst->VRegC_22b(),
2402 shadow_frame.GetVReg(inst->VRegB_22b())));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002403 ADVANCE(2);
2404 HANDLE_INSTRUCTION_END();
2405
2406 HANDLE_INSTRUCTION_START(MUL_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002407 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Ian Rogersf72a11d2014-10-30 15:41:08 -07002408 SafeMul(shadow_frame.GetVReg(inst->VRegB_22b()),
2409 inst->VRegC_22b()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002410 ADVANCE(2);
2411 HANDLE_INSTRUCTION_END();
2412
2413 HANDLE_INSTRUCTION_START(DIV_INT_LIT8) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002414 bool success = DoIntDivide(shadow_frame, inst->VRegA_22b(inst_data),
2415 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002416 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2417 }
2418 HANDLE_INSTRUCTION_END();
2419
2420 HANDLE_INSTRUCTION_START(REM_INT_LIT8) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002421 bool success = DoIntRemainder(shadow_frame, inst->VRegA_22b(inst_data),
2422 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002423 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2424 }
2425 HANDLE_INSTRUCTION_END();
2426
2427 HANDLE_INSTRUCTION_START(AND_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002428 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002429 shadow_frame.GetVReg(inst->VRegB_22b()) &
2430 inst->VRegC_22b());
2431 ADVANCE(2);
2432 HANDLE_INSTRUCTION_END();
2433
2434 HANDLE_INSTRUCTION_START(OR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002435 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002436 shadow_frame.GetVReg(inst->VRegB_22b()) |
2437 inst->VRegC_22b());
2438 ADVANCE(2);
2439 HANDLE_INSTRUCTION_END();
2440
2441 HANDLE_INSTRUCTION_START(XOR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002442 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002443 shadow_frame.GetVReg(inst->VRegB_22b()) ^
2444 inst->VRegC_22b());
2445 ADVANCE(2);
2446 HANDLE_INSTRUCTION_END();
2447
2448 HANDLE_INSTRUCTION_START(SHL_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002449 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002450 shadow_frame.GetVReg(inst->VRegB_22b()) <<
2451 (inst->VRegC_22b() & 0x1f));
2452 ADVANCE(2);
2453 HANDLE_INSTRUCTION_END();
2454
2455 HANDLE_INSTRUCTION_START(SHR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002456 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002457 shadow_frame.GetVReg(inst->VRegB_22b()) >>
2458 (inst->VRegC_22b() & 0x1f));
2459 ADVANCE(2);
2460 HANDLE_INSTRUCTION_END();
2461
2462 HANDLE_INSTRUCTION_START(USHR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002463 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002464 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_22b())) >>
2465 (inst->VRegC_22b() & 0x1f));
2466 ADVANCE(2);
2467 HANDLE_INSTRUCTION_END();
2468
Igor Murashkin158f35c2015-06-10 15:55:30 -07002469 HANDLE_EXPERIMENTAL_INSTRUCTION_START(CREATE_LAMBDA) {
Igor Murashkin6918bf12015-09-27 19:19:06 -07002470 if (lambda_closure_builder == nullptr) {
2471 // DoCreateLambda always needs a ClosureBuilder, even if it has 0 captured variables.
2472 lambda_closure_builder = MakeUnique<lambda::ClosureBuilder>();
2473 }
2474
2475 // TODO: these allocations should not leak, and the lambda method should not be local.
2476 lambda::Closure* lambda_closure =
2477 reinterpret_cast<lambda::Closure*>(alloca(lambda_closure_builder->GetSize()));
2478 bool success = DoCreateLambda<do_access_check>(self,
2479 inst,
2480 /*inout*/shadow_frame,
2481 /*inout*/lambda_closure_builder.get(),
2482 /*inout*/lambda_closure);
2483 lambda_closure_builder.reset(nullptr); // reset state of variables captured
Igor Murashkin158f35c2015-06-10 15:55:30 -07002484 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2485 }
2486 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2487
Igor Murashkin2ee54e22015-06-18 10:05:11 -07002488 HANDLE_EXPERIMENTAL_INSTRUCTION_START(BOX_LAMBDA) {
2489 bool success = DoBoxLambda<do_access_check>(self, shadow_frame, inst, inst_data);
2490 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2491 }
2492 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2493
2494 HANDLE_EXPERIMENTAL_INSTRUCTION_START(UNBOX_LAMBDA) {
2495 bool success = DoUnboxLambda<do_access_check>(self, shadow_frame, inst, inst_data);
2496 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2497 }
2498 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2499
Igor Murashkin6918bf12015-09-27 19:19:06 -07002500 HANDLE_EXPERIMENTAL_INSTRUCTION_START(CAPTURE_VARIABLE) {
2501 if (lambda_closure_builder == nullptr) {
2502 lambda_closure_builder = MakeUnique<lambda::ClosureBuilder>();
2503 }
2504
2505 bool success = DoCaptureVariable<do_access_check>(self,
2506 inst,
2507 /*inout*/shadow_frame,
2508 /*inout*/lambda_closure_builder.get());
2509
2510 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2511 }
2512 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2513
2514 HANDLE_EXPERIMENTAL_INSTRUCTION_START(LIBERATE_VARIABLE) {
2515 bool success = DoLiberateVariable<do_access_check>(self,
2516 inst,
2517 lambda_captured_variable_index,
2518 /*inout*/shadow_frame);
2519 // Temporarily only allow sequences of 'liberate-variable, liberate-variable, ...'
2520 lambda_captured_variable_index++;
2521 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2522 }
2523 HANDLE_EXPERIMENTAL_INSTRUCTION_END();
2524
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002525 HANDLE_INSTRUCTION_START(UNUSED_3E)
Ian Rogerse94652f2014-12-02 11:13:19 -08002526 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002527 HANDLE_INSTRUCTION_END();
2528
2529 HANDLE_INSTRUCTION_START(UNUSED_3F)
Ian Rogerse94652f2014-12-02 11:13:19 -08002530 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002531 HANDLE_INSTRUCTION_END();
2532
2533 HANDLE_INSTRUCTION_START(UNUSED_40)
Ian Rogerse94652f2014-12-02 11:13:19 -08002534 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002535 HANDLE_INSTRUCTION_END();
2536
2537 HANDLE_INSTRUCTION_START(UNUSED_41)
Ian Rogerse94652f2014-12-02 11:13:19 -08002538 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002539 HANDLE_INSTRUCTION_END();
2540
2541 HANDLE_INSTRUCTION_START(UNUSED_42)
Ian Rogerse94652f2014-12-02 11:13:19 -08002542 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002543 HANDLE_INSTRUCTION_END();
2544
2545 HANDLE_INSTRUCTION_START(UNUSED_43)
Ian Rogerse94652f2014-12-02 11:13:19 -08002546 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002547 HANDLE_INSTRUCTION_END();
2548
2549 HANDLE_INSTRUCTION_START(UNUSED_79)
Ian Rogerse94652f2014-12-02 11:13:19 -08002550 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002551 HANDLE_INSTRUCTION_END();
2552
2553 HANDLE_INSTRUCTION_START(UNUSED_7A)
Ian Rogerse94652f2014-12-02 11:13:19 -08002554 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002555 HANDLE_INSTRUCTION_END();
2556
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002557 HANDLE_INSTRUCTION_START(UNUSED_F4)
Ian Rogerse94652f2014-12-02 11:13:19 -08002558 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002559 HANDLE_INSTRUCTION_END();
2560
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002561 HANDLE_INSTRUCTION_START(UNUSED_FA)
Ian Rogerse94652f2014-12-02 11:13:19 -08002562 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002563 HANDLE_INSTRUCTION_END();
2564
2565 HANDLE_INSTRUCTION_START(UNUSED_FB)
Ian Rogerse94652f2014-12-02 11:13:19 -08002566 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002567 HANDLE_INSTRUCTION_END();
2568
2569 HANDLE_INSTRUCTION_START(UNUSED_FC)
Ian Rogerse94652f2014-12-02 11:13:19 -08002570 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002571 HANDLE_INSTRUCTION_END();
2572
2573 HANDLE_INSTRUCTION_START(UNUSED_FD)
Ian Rogerse94652f2014-12-02 11:13:19 -08002574 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002575 HANDLE_INSTRUCTION_END();
2576
2577 HANDLE_INSTRUCTION_START(UNUSED_FE)
Ian Rogerse94652f2014-12-02 11:13:19 -08002578 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002579 HANDLE_INSTRUCTION_END();
2580
2581 HANDLE_INSTRUCTION_START(UNUSED_FF)
Ian Rogerse94652f2014-12-02 11:13:19 -08002582 UnexpectedOpcode(inst, shadow_frame);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002583 HANDLE_INSTRUCTION_END();
2584
2585 exception_pending_label: {
2586 CHECK(self->IsExceptionPending());
Sebastien Hertz1eda2262013-09-09 16:53:14 +02002587 if (UNLIKELY(self->TestAllFlags())) {
Ian Rogers7b078e82014-09-10 14:44:24 -07002588 self->CheckSuspend();
Sebastien Hertzee1997a2013-09-19 14:47:09 +02002589 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02002590 }
Vladimir Markod7779832016-04-05 11:48:02 +00002591 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002592 uint32_t found_dex_pc = FindNextInstructionFollowingException(self, shadow_frame, dex_pc,
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002593 instrumentation);
2594 if (found_dex_pc == DexFile::kDexNoIndex) {
Andreas Gampe03ec9302015-08-27 17:41:47 -07002595 // Structured locking is to be enforced for abnormal termination, too.
2596 shadow_frame.GetLockCountData().CheckAllMonitorsReleasedOrThrow<do_assignability_check>(self);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002597 return JValue(); /* Handled in caller. */
2598 } else {
2599 int32_t displacement = static_cast<int32_t>(found_dex_pc) - static_cast<int32_t>(dex_pc);
2600 ADVANCE(displacement);
2601 }
2602 }
2603
Sebastien Hertz8379b222014-02-24 17:38:15 +01002604// Create alternative instruction handlers dedicated to instrumentation.
2605// Return instructions must not call Instrumentation::DexPcMovedEvent since they already call
2606// Instrumentation::MethodExited. This is to avoid posting debugger events twice for this location.
Sebastien Hertze713d932014-05-15 10:48:53 +02002607// Note: we do not use the kReturn instruction flag here (to test the instruction is a return). The
2608// compiler seems to not evaluate "(Instruction::FlagsOf(Instruction::code) & kReturn) != 0" to
2609// a constant condition that would remove the "if" statement so the test is free.
Sebastien Hertz9d6bf692015-04-10 12:12:33 +02002610#define INSTRUMENTATION_INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) \
2611 alt_op_##code: { \
2612 Runtime* const runtime = Runtime::Current(); \
2613 const instrumentation::Instrumentation* instrumentation = runtime->GetInstrumentation(); \
2614 if (UNLIKELY(instrumentation->HasDexPcListeners())) { \
2615 Object* this_object = shadow_frame.GetThisObject(code_item->ins_size_); \
2616 instrumentation->DexPcMovedEvent(self, this_object, shadow_frame.GetMethod(), dex_pc); \
2617 } \
2618 UPDATE_HANDLER_TABLE(); \
2619 goto *handlersTable[instrumentation::kMainHandlerTable][Instruction::code]; \
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002620 }
2621#include "dex_instruction_list.h"
2622 DEX_INSTRUCTION_LIST(INSTRUMENTATION_INSTRUCTION_HANDLER)
2623#undef DEX_INSTRUCTION_LIST
2624#undef INSTRUMENTATION_INSTRUCTION_HANDLER
2625} // NOLINT(readability/fn_size)
2626
2627// Explicit definitions of ExecuteGotoImpl.
Mathieu Chartier90443472015-07-16 20:32:27 -07002628template SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR
Ian Rogerse94652f2014-12-02 11:13:19 -08002629JValue ExecuteGotoImpl<true, false>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002630 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -07002631template SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR
Ian Rogerse94652f2014-12-02 11:13:19 -08002632JValue ExecuteGotoImpl<false, false>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002633 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -07002634template SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -08002635JValue ExecuteGotoImpl<true, true>(Thread* self, const DexFile::CodeItem* code_item,
2636 ShadowFrame& shadow_frame, JValue result_register);
Mathieu Chartier90443472015-07-16 20:32:27 -07002637template SHARED_REQUIRES(Locks::mutator_lock_)
Ian Rogerse94652f2014-12-02 11:13:19 -08002638JValue ExecuteGotoImpl<false, true>(Thread* self, const DexFile::CodeItem* code_item,
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002639 ShadowFrame& shadow_frame, JValue result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002640
2641} // namespace interpreter
2642} // namespace art
Colin Crosse84e4f72015-03-18 14:01:19 -07002643
2644#endif