blob: e425e9132e22e232bdc02ced03eceda41e962f44 [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
17#include "interpreter_common.h"
18
19namespace art {
20namespace interpreter {
21
22// In the following macros, we expect the following local variables exist:
23// - "self": the current Thread*.
24// - "inst" : the current Instruction*.
Sebastien Hertz3b588e02013-09-11 14:33:18 +020025// - "inst_data" : the current instruction's first 16 bits.
Sebastien Hertz8ece0502013-08-07 11:26:41 +020026// - "dex_pc": the current pc.
27// - "shadow_frame": the current shadow frame.
Sebastien Hertz8ece0502013-08-07 11:26:41 +020028// - "mh": the current MethodHelper.
29// - "currentHandlersTable": the current table of pointer to each instruction handler.
30
31// Advance to the next instruction and updates interpreter state.
Sebastien Hertz8ece0502013-08-07 11:26:41 +020032#define ADVANCE(_offset) \
33 do { \
34 int32_t disp = static_cast<int32_t>(_offset); \
35 inst = inst->RelativeAt(disp); \
36 dex_pc = static_cast<uint32_t>(static_cast<int32_t>(dex_pc) + disp); \
37 shadow_frame.SetDexPC(dex_pc); \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020038 TraceExecution(shadow_frame, inst, dex_pc, mh); \
Sebastien Hertz3b588e02013-09-11 14:33:18 +020039 inst_data = inst->Fetch16(0); \
40 goto *currentHandlersTable[inst->Opcode(inst_data)]; \
Sebastien Hertz8ece0502013-08-07 11:26:41 +020041 } while (false)
42
43#define HANDLE_PENDING_EXCEPTION() goto exception_pending_label
44
45#define POSSIBLY_HANDLE_PENDING_EXCEPTION(_is_exception_pending, _offset) \
46 do { \
47 if (UNLIKELY(_is_exception_pending)) { \
48 HANDLE_PENDING_EXCEPTION(); \
49 } else { \
50 ADVANCE(_offset); \
51 } \
52 } while (false)
53
Sebastien Hertzee1997a2013-09-19 14:47:09 +020054#define UPDATE_HANDLER_TABLE() \
55 currentHandlersTable = handlersTable[Runtime::Current()->GetInstrumentation()->GetInterpreterHandlerTable()]
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +020056
Sebastien Hertz8ece0502013-08-07 11:26:41 +020057#define UNREACHABLE_CODE_CHECK() \
58 do { \
59 if (kIsDebugBuild) { \
60 LOG(FATAL) << "We should not be here !"; \
61 } \
62 } while (false)
63
64#define HANDLE_INSTRUCTION_START(opcode) op_##opcode: // NOLINT(whitespace/labels)
65#define HANDLE_INSTRUCTION_END() UNREACHABLE_CODE_CHECK()
66
Sebastien Hertzee1997a2013-09-19 14:47:09 +020067/**
68 * Interpreter based on computed goto tables.
69 *
70 * Each instruction is associated to a handler. This handler is responsible for executing the
71 * instruction and jump to the next instruction's handler.
72 * In order to limit the cost of instrumentation, we have two handler tables:
73 * - the "main" handler table: it contains handlers for normal execution of each instruction without
74 * handling of instrumentation.
75 * - the "alternative" handler table: it contains alternative handlers which first handle
76 * instrumentation before jumping to the corresponding "normal" instruction's handler.
77 *
78 * When instrumentation is active, the interpreter uses the "alternative" handler table. Otherwise
79 * it uses the "main" handler table.
80 *
81 * The current handler table is the handler table being used by the interpreter. It is updated:
82 * - on backward branch (goto, if and switch instructions)
83 * - after invoke
84 * - when an exception is thrown.
85 * This allows to support an attaching debugger to an already running application for instance.
86 *
87 * For a fast handler table update, handler tables are stored in an array of handler tables. Each
88 * handler table is represented by the InterpreterHandlerTable enum which allows to associate it
89 * to an index in this array of handler tables ((see Instrumentation::GetInterpreterHandlerTable).
90 *
91 * Here's the current layout of this array of handler tables:
92 *
93 * ---------------------+---------------+
94 * | NOP | (handler for NOP instruction)
95 * +---------------+
96 * "main" | MOVE | (handler for MOVE instruction)
97 * handler table +---------------+
98 * | ... |
99 * +---------------+
100 * | UNUSED_FF | (handler for UNUSED_FF instruction)
101 * ---------------------+---------------+
102 * | NOP | (alternative handler for NOP instruction)
103 * +---------------+
104 * "alternative" | MOVE | (alternative handler for MOVE instruction)
105 * handler table +---------------+
106 * | ... |
107 * +---------------+
108 * | UNUSED_FF | (alternative handler for UNUSED_FF instruction)
109 * ---------------------+---------------+
110 *
111 */
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100112template<bool do_access_check, bool transaction_active>
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200113JValue ExecuteGotoImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item,
114 ShadowFrame& shadow_frame, JValue result_register) {
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200115 // Define handler tables:
116 // - The main handler table contains execution handlers for each instruction.
117 // - The alternative handler table contains prelude handlers which check for thread suspend and
118 // manage instrumentation before jumping to the execution handler.
119 static const void* const handlersTable[instrumentation::kNumHandlerTables][kNumPackedOpcodes] = {
120 {
121 // Main handler table.
122#define INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) &&op_##code,
123#include "dex_instruction_list.h"
124 DEX_INSTRUCTION_LIST(INSTRUCTION_HANDLER)
125#undef DEX_INSTRUCTION_LIST
126#undef INSTRUCTION_HANDLER
127 }, {
128 // Alternative handler table.
129#define INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) &&alt_op_##code,
130#include "dex_instruction_list.h"
131 DEX_INSTRUCTION_LIST(INSTRUCTION_HANDLER)
132#undef DEX_INSTRUCTION_LIST
133#undef INSTRUCTION_HANDLER
134 }
135 };
136
137 const bool do_assignability_check = do_access_check;
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200138 if (UNLIKELY(!shadow_frame.HasReferenceArray())) {
139 LOG(FATAL) << "Invalid shadow frame for interpreter use";
140 return JValue();
141 }
142 self->VerifyStack();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200143
144 uint32_t dex_pc = shadow_frame.GetDexPC();
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200145 const Instruction* inst = Instruction::At(code_item->insns_ + dex_pc);
146 uint16_t inst_data;
147 const void* const* currentHandlersTable;
148 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200149 if (LIKELY(dex_pc == 0)) { // We are entering the method as opposed to deoptimizing..
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200150 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200151 if (UNLIKELY(instrumentation->HasMethodEntryListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200152 instrumentation->MethodEnterEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200153 shadow_frame.GetMethod(), 0);
154 }
155 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200156
157 // Jump to first instruction.
158 ADVANCE(0);
159 UNREACHABLE_CODE_CHECK();
160
161 HANDLE_INSTRUCTION_START(NOP)
162 ADVANCE(1);
163 HANDLE_INSTRUCTION_END();
164
165 HANDLE_INSTRUCTION_START(MOVE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200166 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
167 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200168 ADVANCE(1);
169 HANDLE_INSTRUCTION_END();
170
171 HANDLE_INSTRUCTION_START(MOVE_FROM16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200172 shadow_frame.SetVReg(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200173 shadow_frame.GetVReg(inst->VRegB_22x()));
174 ADVANCE(2);
175 HANDLE_INSTRUCTION_END();
176
177 HANDLE_INSTRUCTION_START(MOVE_16)
178 shadow_frame.SetVReg(inst->VRegA_32x(),
179 shadow_frame.GetVReg(inst->VRegB_32x()));
180 ADVANCE(3);
181 HANDLE_INSTRUCTION_END();
182
183 HANDLE_INSTRUCTION_START(MOVE_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200184 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data),
185 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200186 ADVANCE(1);
187 HANDLE_INSTRUCTION_END();
188
189 HANDLE_INSTRUCTION_START(MOVE_WIDE_FROM16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200190 shadow_frame.SetVRegLong(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200191 shadow_frame.GetVRegLong(inst->VRegB_22x()));
192 ADVANCE(2);
193 HANDLE_INSTRUCTION_END();
194
195 HANDLE_INSTRUCTION_START(MOVE_WIDE_16)
196 shadow_frame.SetVRegLong(inst->VRegA_32x(),
197 shadow_frame.GetVRegLong(inst->VRegB_32x()));
198 ADVANCE(3);
199 HANDLE_INSTRUCTION_END();
200
201 HANDLE_INSTRUCTION_START(MOVE_OBJECT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200202 shadow_frame.SetVRegReference(inst->VRegA_12x(inst_data),
203 shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200204 ADVANCE(1);
205 HANDLE_INSTRUCTION_END();
206
207 HANDLE_INSTRUCTION_START(MOVE_OBJECT_FROM16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200208 shadow_frame.SetVRegReference(inst->VRegA_22x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200209 shadow_frame.GetVRegReference(inst->VRegB_22x()));
210 ADVANCE(2);
211 HANDLE_INSTRUCTION_END();
212
213 HANDLE_INSTRUCTION_START(MOVE_OBJECT_16)
214 shadow_frame.SetVRegReference(inst->VRegA_32x(),
215 shadow_frame.GetVRegReference(inst->VRegB_32x()));
216 ADVANCE(3);
217 HANDLE_INSTRUCTION_END();
218
219 HANDLE_INSTRUCTION_START(MOVE_RESULT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200220 shadow_frame.SetVReg(inst->VRegA_11x(inst_data), result_register.GetI());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200221 ADVANCE(1);
222 HANDLE_INSTRUCTION_END();
223
224 HANDLE_INSTRUCTION_START(MOVE_RESULT_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200225 shadow_frame.SetVRegLong(inst->VRegA_11x(inst_data), result_register.GetJ());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200226 ADVANCE(1);
227 HANDLE_INSTRUCTION_END();
228
229 HANDLE_INSTRUCTION_START(MOVE_RESULT_OBJECT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200230 shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), result_register.GetL());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200231 ADVANCE(1);
232 HANDLE_INSTRUCTION_END();
233
234 HANDLE_INSTRUCTION_START(MOVE_EXCEPTION) {
235 Throwable* exception = self->GetException(NULL);
236 self->ClearException();
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200237 shadow_frame.SetVRegReference(inst->VRegA_11x(inst_data), exception);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200238 ADVANCE(1);
239 }
240 HANDLE_INSTRUCTION_END();
241
242 HANDLE_INSTRUCTION_START(RETURN_VOID) {
243 JValue result;
Sebastien Hertz043036f2013-09-09 18:26:48 +0200244 if (do_access_check) {
245 // If access checks are required then the dex-to-dex compiler and analysis of
246 // whether the class has final fields hasn't been performed. Conservatively
247 // perform the memory barrier now.
Ian Rogersb122a4b2013-11-19 18:00:50 -0800248 QuasiAtomic::MembarStoreLoad();
Sebastien Hertz043036f2013-09-09 18:26:48 +0200249 }
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200250 if (UNLIKELY(self->TestAllFlags())) {
251 CheckSuspend(self);
252 }
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200253 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200254 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200255 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200256 shadow_frame.GetMethod(), dex_pc,
257 result);
258 }
259 return result;
260 }
261 HANDLE_INSTRUCTION_END();
262
263 HANDLE_INSTRUCTION_START(RETURN_VOID_BARRIER) {
Ian Rogersb122a4b2013-11-19 18:00:50 -0800264 QuasiAtomic::MembarStoreLoad();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200265 JValue result;
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200266 if (UNLIKELY(self->TestAllFlags())) {
267 CheckSuspend(self);
268 }
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200269 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200270 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200271 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200272 shadow_frame.GetMethod(), dex_pc,
273 result);
274 }
275 return result;
276 }
277 HANDLE_INSTRUCTION_END();
278
279 HANDLE_INSTRUCTION_START(RETURN) {
280 JValue result;
281 result.SetJ(0);
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200282 result.SetI(shadow_frame.GetVReg(inst->VRegA_11x(inst_data)));
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200283 if (UNLIKELY(self->TestAllFlags())) {
284 CheckSuspend(self);
285 }
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200286 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200287 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200288 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200289 shadow_frame.GetMethod(), dex_pc,
290 result);
291 }
292 return result;
293 }
294 HANDLE_INSTRUCTION_END();
295
296 HANDLE_INSTRUCTION_START(RETURN_WIDE) {
297 JValue result;
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200298 result.SetJ(shadow_frame.GetVRegLong(inst->VRegA_11x(inst_data)));
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200299 if (UNLIKELY(self->TestAllFlags())) {
300 CheckSuspend(self);
301 }
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200302 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200303 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200304 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200305 shadow_frame.GetMethod(), dex_pc,
306 result);
307 }
308 return result;
309 }
310 HANDLE_INSTRUCTION_END();
311
312 HANDLE_INSTRUCTION_START(RETURN_OBJECT) {
313 JValue result;
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200314 if (UNLIKELY(self->TestAllFlags())) {
315 CheckSuspend(self);
316 }
Mathieu Chartiere861ebd2013-10-09 15:01:21 -0700317 Object* obj_result = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
318 result.SetJ(0);
319 result.SetL(obj_result);
Jeff Haoa3faaf42013-09-03 19:07:00 -0700320 if (do_assignability_check && obj_result != NULL) {
321 Class* return_type = MethodHelper(shadow_frame.GetMethod()).GetReturnType();
322 if (return_type == NULL) {
323 // Return the pending exception.
324 HANDLE_PENDING_EXCEPTION();
325 }
326 if (!obj_result->VerifierInstanceOf(return_type)) {
327 // This should never happen.
328 self->ThrowNewExceptionF(self->GetCurrentLocationForThrow(),
329 "Ljava/lang/VirtualMachineError;",
330 "Returning '%s' that is not instance of return type '%s'",
331 ClassHelper(obj_result->GetClass()).GetDescriptor(),
332 ClassHelper(return_type).GetDescriptor());
333 HANDLE_PENDING_EXCEPTION();
334 }
335 }
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200336 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200337 if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
Sebastien Hertz947ff082013-09-17 14:10:13 +0200338 instrumentation->MethodExitEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200339 shadow_frame.GetMethod(), dex_pc,
340 result);
341 }
342 return result;
343 }
344 HANDLE_INSTRUCTION_END();
345
346 HANDLE_INSTRUCTION_START(CONST_4) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200347 uint32_t dst = inst->VRegA_11n(inst_data);
348 int32_t val = inst->VRegB_11n(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200349 shadow_frame.SetVReg(dst, val);
350 if (val == 0) {
351 shadow_frame.SetVRegReference(dst, NULL);
352 }
353 ADVANCE(1);
354 }
355 HANDLE_INSTRUCTION_END();
356
357 HANDLE_INSTRUCTION_START(CONST_16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200358 uint32_t dst = inst->VRegA_21s(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200359 int32_t val = inst->VRegB_21s();
360 shadow_frame.SetVReg(dst, val);
361 if (val == 0) {
362 shadow_frame.SetVRegReference(dst, NULL);
363 }
364 ADVANCE(2);
365 }
366 HANDLE_INSTRUCTION_END();
367
368 HANDLE_INSTRUCTION_START(CONST) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200369 uint32_t dst = inst->VRegA_31i(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200370 int32_t val = inst->VRegB_31i();
371 shadow_frame.SetVReg(dst, val);
372 if (val == 0) {
373 shadow_frame.SetVRegReference(dst, NULL);
374 }
375 ADVANCE(3);
376 }
377 HANDLE_INSTRUCTION_END();
378
379 HANDLE_INSTRUCTION_START(CONST_HIGH16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200380 uint32_t dst = inst->VRegA_21h(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200381 int32_t val = static_cast<int32_t>(inst->VRegB_21h() << 16);
382 shadow_frame.SetVReg(dst, val);
383 if (val == 0) {
384 shadow_frame.SetVRegReference(dst, NULL);
385 }
386 ADVANCE(2);
387 }
388 HANDLE_INSTRUCTION_END();
389
390 HANDLE_INSTRUCTION_START(CONST_WIDE_16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200391 shadow_frame.SetVRegLong(inst->VRegA_21s(inst_data), inst->VRegB_21s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200392 ADVANCE(2);
393 HANDLE_INSTRUCTION_END();
394
395 HANDLE_INSTRUCTION_START(CONST_WIDE_32)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200396 shadow_frame.SetVRegLong(inst->VRegA_31i(inst_data), inst->VRegB_31i());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200397 ADVANCE(3);
398 HANDLE_INSTRUCTION_END();
399
400 HANDLE_INSTRUCTION_START(CONST_WIDE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200401 shadow_frame.SetVRegLong(inst->VRegA_51l(inst_data), inst->VRegB_51l());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200402 ADVANCE(5);
403 HANDLE_INSTRUCTION_END();
404
405 HANDLE_INSTRUCTION_START(CONST_WIDE_HIGH16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200406 shadow_frame.SetVRegLong(inst->VRegA_21h(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200407 static_cast<uint64_t>(inst->VRegB_21h()) << 48);
408 ADVANCE(2);
409 HANDLE_INSTRUCTION_END();
410
411 HANDLE_INSTRUCTION_START(CONST_STRING) {
412 String* s = ResolveString(self, mh, inst->VRegB_21c());
413 if (UNLIKELY(s == NULL)) {
414 HANDLE_PENDING_EXCEPTION();
415 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200416 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200417 ADVANCE(2);
418 }
419 }
420 HANDLE_INSTRUCTION_END();
421
422 HANDLE_INSTRUCTION_START(CONST_STRING_JUMBO) {
423 String* s = ResolveString(self, mh, inst->VRegB_31c());
424 if (UNLIKELY(s == NULL)) {
425 HANDLE_PENDING_EXCEPTION();
426 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200427 shadow_frame.SetVRegReference(inst->VRegA_31c(inst_data), s);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200428 ADVANCE(3);
429 }
430 }
431 HANDLE_INSTRUCTION_END();
432
433 HANDLE_INSTRUCTION_START(CONST_CLASS) {
434 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
435 self, false, do_access_check);
436 if (UNLIKELY(c == NULL)) {
437 HANDLE_PENDING_EXCEPTION();
438 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200439 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), c);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200440 ADVANCE(2);
441 }
442 }
443 HANDLE_INSTRUCTION_END();
444
445 HANDLE_INSTRUCTION_START(MONITOR_ENTER) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200446 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200447 if (UNLIKELY(obj == NULL)) {
448 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
449 HANDLE_PENDING_EXCEPTION();
450 } else {
451 DoMonitorEnter(self, obj);
452 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), 1);
453 }
454 }
455 HANDLE_INSTRUCTION_END();
456
457 HANDLE_INSTRUCTION_START(MONITOR_EXIT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200458 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200459 if (UNLIKELY(obj == NULL)) {
460 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
461 HANDLE_PENDING_EXCEPTION();
462 } else {
463 DoMonitorExit(self, obj);
464 POSSIBLY_HANDLE_PENDING_EXCEPTION(self->IsExceptionPending(), 1);
465 }
466 }
467 HANDLE_INSTRUCTION_END();
468
469 HANDLE_INSTRUCTION_START(CHECK_CAST) {
470 Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(),
471 self, false, do_access_check);
472 if (UNLIKELY(c == NULL)) {
473 HANDLE_PENDING_EXCEPTION();
474 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200475 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_21c(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200476 if (UNLIKELY(obj != NULL && !obj->InstanceOf(c))) {
477 ThrowClassCastException(c, obj->GetClass());
478 HANDLE_PENDING_EXCEPTION();
479 } else {
480 ADVANCE(2);
481 }
482 }
483 }
484 HANDLE_INSTRUCTION_END();
485
486 HANDLE_INSTRUCTION_START(INSTANCE_OF) {
487 Class* c = ResolveVerifyAndClinit(inst->VRegC_22c(), shadow_frame.GetMethod(),
488 self, false, do_access_check);
489 if (UNLIKELY(c == NULL)) {
490 HANDLE_PENDING_EXCEPTION();
491 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200492 Object* obj = shadow_frame.GetVRegReference(inst->VRegB_22c(inst_data));
493 shadow_frame.SetVReg(inst->VRegA_22c(inst_data), (obj != NULL && obj->InstanceOf(c)) ? 1 : 0);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200494 ADVANCE(2);
495 }
496 }
497 HANDLE_INSTRUCTION_END();
498
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700499 HANDLE_INSTRUCTION_START(ARRAY_LENGTH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200500 Object* array = shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200501 if (UNLIKELY(array == NULL)) {
502 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
503 HANDLE_PENDING_EXCEPTION();
504 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200505 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), array->AsArray()->GetLength());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200506 ADVANCE(1);
507 }
508 }
509 HANDLE_INSTRUCTION_END();
510
511 HANDLE_INSTRUCTION_START(NEW_INSTANCE) {
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700512 Runtime* runtime = Runtime::Current();
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800513 Object* obj = AllocObjectFromCode<do_access_check, true>(
514 inst->VRegB_21c(), shadow_frame.GetMethod(), self,
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700515 runtime->GetHeap()->GetCurrentAllocator());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200516 if (UNLIKELY(obj == NULL)) {
517 HANDLE_PENDING_EXCEPTION();
518 } else {
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700519 // Don't allow finalizable objects to be allocated during a transaction since these can't be
520 // finalized without a started runtime.
521 if (transaction_active && obj->GetClass()->IsFinalizable()) {
Ian Rogers2fa98e22014-05-06 15:26:39 -0700522 AbortTransaction(self, "Allocating finalizable object in transaction: %s",
Mathieu Chartierb2c7ead2014-04-29 11:13:16 -0700523 PrettyTypeOf(obj).c_str());
524 HANDLE_PENDING_EXCEPTION();
525 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200526 shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200527 ADVANCE(2);
528 }
529 }
530 HANDLE_INSTRUCTION_END();
531
532 HANDLE_INSTRUCTION_START(NEW_ARRAY) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200533 int32_t length = shadow_frame.GetVReg(inst->VRegB_22c(inst_data));
Mathieu Chartiercbb2d202013-11-14 17:45:16 -0800534 Object* obj = AllocArrayFromCode<do_access_check, true>(
535 inst->VRegC_22c(), shadow_frame.GetMethod(), length, self,
536 Runtime::Current()->GetHeap()->GetCurrentAllocator());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200537 if (UNLIKELY(obj == NULL)) {
538 HANDLE_PENDING_EXCEPTION();
539 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200540 shadow_frame.SetVRegReference(inst->VRegA_22c(inst_data), obj);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200541 ADVANCE(2);
542 }
543 }
544 HANDLE_INSTRUCTION_END();
545
546 HANDLE_INSTRUCTION_START(FILLED_NEW_ARRAY) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100547 bool success =
548 DoFilledNewArray<false, do_access_check, transaction_active>(inst, shadow_frame,
549 self, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200550 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
551 }
552 HANDLE_INSTRUCTION_END();
553
554 HANDLE_INSTRUCTION_START(FILLED_NEW_ARRAY_RANGE) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100555 bool success =
556 DoFilledNewArray<true, do_access_check, transaction_active>(inst, shadow_frame,
557 self, &result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200558 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
559 }
560 HANDLE_INSTRUCTION_END();
561
562 HANDLE_INSTRUCTION_START(FILL_ARRAY_DATA) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200563 Object* obj = shadow_frame.GetVRegReference(inst->VRegA_31t(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200564 if (UNLIKELY(obj == NULL)) {
565 ThrowNullPointerException(NULL, "null array in FILL_ARRAY_DATA");
566 HANDLE_PENDING_EXCEPTION();
567 } else {
568 Array* array = obj->AsArray();
569 DCHECK(array->IsArrayInstance() && !array->IsObjectArray());
570 const uint16_t* payload_addr = reinterpret_cast<const uint16_t*>(inst) + inst->VRegB_31t();
571 const Instruction::ArrayDataPayload* payload =
572 reinterpret_cast<const Instruction::ArrayDataPayload*>(payload_addr);
573 if (UNLIKELY(static_cast<int32_t>(payload->element_count) > array->GetLength())) {
574 self->ThrowNewExceptionF(shadow_frame.GetCurrentLocationForThrow(),
575 "Ljava/lang/ArrayIndexOutOfBoundsException;",
576 "failed FILL_ARRAY_DATA; length=%d, index=%d",
577 array->GetLength(), payload->element_count);
578 HANDLE_PENDING_EXCEPTION();
579 } else {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +0100580 if (transaction_active) {
581 RecordArrayElementsInTransaction(array, payload->element_count);
582 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200583 uint32_t size_in_bytes = payload->element_count * payload->element_width;
Ian Rogersef7d42f2014-01-06 12:55:46 -0800584 memcpy(array->GetRawData(payload->element_width, 0), payload->data, size_in_bytes);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200585 ADVANCE(3);
586 }
587 }
588 }
589 HANDLE_INSTRUCTION_END();
590
591 HANDLE_INSTRUCTION_START(THROW) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200592 Object* exception = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200593 if (UNLIKELY(exception == NULL)) {
594 ThrowNullPointerException(NULL, "throw with null exception");
Jeff Haoa3faaf42013-09-03 19:07:00 -0700595 } else if (do_assignability_check && !exception->GetClass()->IsThrowableClass()) {
596 // This should never happen.
597 self->ThrowNewExceptionF(self->GetCurrentLocationForThrow(),
598 "Ljava/lang/VirtualMachineError;",
599 "Throwing '%s' that is not instance of Throwable",
600 ClassHelper(exception->GetClass()).GetDescriptor());
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200601 } else {
602 self->SetException(shadow_frame.GetCurrentLocationForThrow(), exception->AsThrowable());
603 }
604 HANDLE_PENDING_EXCEPTION();
605 }
606 HANDLE_INSTRUCTION_END();
607
608 HANDLE_INSTRUCTION_START(GOTO) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200609 int8_t offset = inst->VRegA_10t(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200610 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200611 if (UNLIKELY(self->TestAllFlags())) {
612 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200613 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200614 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200615 }
616 ADVANCE(offset);
617 }
618 HANDLE_INSTRUCTION_END();
619
620 HANDLE_INSTRUCTION_START(GOTO_16) {
621 int16_t offset = inst->VRegA_20t();
622 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200623 if (UNLIKELY(self->TestAllFlags())) {
624 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200625 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200626 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200627 }
628 ADVANCE(offset);
629 }
630 HANDLE_INSTRUCTION_END();
631
632 HANDLE_INSTRUCTION_START(GOTO_32) {
633 int32_t offset = inst->VRegA_30t();
634 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200635 if (UNLIKELY(self->TestAllFlags())) {
636 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200637 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200638 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200639 }
640 ADVANCE(offset);
641 }
642 HANDLE_INSTRUCTION_END();
643
644 HANDLE_INSTRUCTION_START(PACKED_SWITCH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200645 int32_t offset = DoPackedSwitch(inst, shadow_frame, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200646 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200647 if (UNLIKELY(self->TestAllFlags())) {
648 CheckSuspend(self);
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(SPARSE_SWITCH) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200657 int32_t offset = DoSparseSwitch(inst, shadow_frame, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200658 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200659 if (UNLIKELY(self->TestAllFlags())) {
660 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200661 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200662 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200663 }
664 ADVANCE(offset);
665 }
666 HANDLE_INSTRUCTION_END();
667
668 HANDLE_INSTRUCTION_START(CMPL_FLOAT) {
669 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
670 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
671 int32_t result;
672 if (val1 > val2) {
673 result = 1;
674 } else if (val1 == val2) {
675 result = 0;
676 } else {
677 result = -1;
678 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200679 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200680 ADVANCE(2);
681 }
682 HANDLE_INSTRUCTION_END();
683
684 HANDLE_INSTRUCTION_START(CMPG_FLOAT) {
685 float val1 = shadow_frame.GetVRegFloat(inst->VRegB_23x());
686 float val2 = shadow_frame.GetVRegFloat(inst->VRegC_23x());
687 int32_t result;
688 if (val1 < val2) {
689 result = -1;
690 } else if (val1 == val2) {
691 result = 0;
692 } else {
693 result = 1;
694 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200695 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200696 ADVANCE(2);
697 }
698 HANDLE_INSTRUCTION_END();
699
700 HANDLE_INSTRUCTION_START(CMPL_DOUBLE) {
701 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
702 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
703 int32_t result;
704 if (val1 > val2) {
705 result = 1;
706 } else if (val1 == val2) {
707 result = 0;
708 } else {
709 result = -1;
710 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200711 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200712 ADVANCE(2);
713 }
714 HANDLE_INSTRUCTION_END();
715
716 HANDLE_INSTRUCTION_START(CMPG_DOUBLE) {
717 double val1 = shadow_frame.GetVRegDouble(inst->VRegB_23x());
718 double val2 = shadow_frame.GetVRegDouble(inst->VRegC_23x());
719 int32_t result;
720 if (val1 < val2) {
721 result = -1;
722 } else if (val1 == val2) {
723 result = 0;
724 } else {
725 result = 1;
726 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200727 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200728 ADVANCE(2);
729 }
730 HANDLE_INSTRUCTION_END();
731
732 HANDLE_INSTRUCTION_START(CMP_LONG) {
733 int64_t val1 = shadow_frame.GetVRegLong(inst->VRegB_23x());
734 int64_t val2 = shadow_frame.GetVRegLong(inst->VRegC_23x());
735 int32_t result;
736 if (val1 > val2) {
737 result = 1;
738 } else if (val1 == val2) {
739 result = 0;
740 } else {
741 result = -1;
742 }
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200743 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200744 ADVANCE(2);
745 }
746 HANDLE_INSTRUCTION_END();
747
748 HANDLE_INSTRUCTION_START(IF_EQ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200749 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) == shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200750 int16_t offset = inst->VRegC_22t();
751 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200752 if (UNLIKELY(self->TestAllFlags())) {
753 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200754 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200755 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200756 }
757 ADVANCE(offset);
758 } else {
759 ADVANCE(2);
760 }
761 }
762 HANDLE_INSTRUCTION_END();
763
764 HANDLE_INSTRUCTION_START(IF_NE) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200765 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) != shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200766 int16_t offset = inst->VRegC_22t();
767 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200768 if (UNLIKELY(self->TestAllFlags())) {
769 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200770 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200771 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200772 }
773 ADVANCE(offset);
774 } else {
775 ADVANCE(2);
776 }
777 }
778 HANDLE_INSTRUCTION_END();
779
780 HANDLE_INSTRUCTION_START(IF_LT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200781 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) < shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200782 int16_t offset = inst->VRegC_22t();
783 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200784 if (UNLIKELY(self->TestAllFlags())) {
785 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200786 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200787 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200788 }
789 ADVANCE(offset);
790 } else {
791 ADVANCE(2);
792 }
793 }
794 HANDLE_INSTRUCTION_END();
795
796 HANDLE_INSTRUCTION_START(IF_GE) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200797 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >= shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200798 int16_t offset = inst->VRegC_22t();
799 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200800 if (UNLIKELY(self->TestAllFlags())) {
801 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200802 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200803 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200804 }
805 ADVANCE(offset);
806 } else {
807 ADVANCE(2);
808 }
809 }
810 HANDLE_INSTRUCTION_END();
811
812 HANDLE_INSTRUCTION_START(IF_GT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200813 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) > shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200814 int16_t offset = inst->VRegC_22t();
815 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200816 if (UNLIKELY(self->TestAllFlags())) {
817 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200818 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200819 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200820 }
821 ADVANCE(offset);
822 } else {
823 ADVANCE(2);
824 }
825 }
826 HANDLE_INSTRUCTION_END();
827
828 HANDLE_INSTRUCTION_START(IF_LE) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200829 if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <= shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200830 int16_t offset = inst->VRegC_22t();
831 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200832 if (UNLIKELY(self->TestAllFlags())) {
833 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200834 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200835 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200836 }
837 ADVANCE(offset);
838 } else {
839 ADVANCE(2);
840 }
841 }
842 HANDLE_INSTRUCTION_END();
843
844 HANDLE_INSTRUCTION_START(IF_EQZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200845 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) == 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200846 int16_t offset = inst->VRegB_21t();
847 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200848 if (UNLIKELY(self->TestAllFlags())) {
849 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200850 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200851 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200852 }
853 ADVANCE(offset);
854 } else {
855 ADVANCE(2);
856 }
857 }
858 HANDLE_INSTRUCTION_END();
859
860 HANDLE_INSTRUCTION_START(IF_NEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200861 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) != 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200862 int16_t offset = inst->VRegB_21t();
863 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200864 if (UNLIKELY(self->TestAllFlags())) {
865 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200866 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200867 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200868 }
869 ADVANCE(offset);
870 } else {
871 ADVANCE(2);
872 }
873 }
874 HANDLE_INSTRUCTION_END();
875
876 HANDLE_INSTRUCTION_START(IF_LTZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200877 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) < 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200878 int16_t offset = inst->VRegB_21t();
879 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200880 if (UNLIKELY(self->TestAllFlags())) {
881 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200882 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200883 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200884 }
885 ADVANCE(offset);
886 } else {
887 ADVANCE(2);
888 }
889 }
890 HANDLE_INSTRUCTION_END();
891
892 HANDLE_INSTRUCTION_START(IF_GEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200893 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) >= 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200894 int16_t offset = inst->VRegB_21t();
895 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200896 if (UNLIKELY(self->TestAllFlags())) {
897 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200898 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200899 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200900 }
901 ADVANCE(offset);
902 } else {
903 ADVANCE(2);
904 }
905 }
906 HANDLE_INSTRUCTION_END();
907
908 HANDLE_INSTRUCTION_START(IF_GTZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200909 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) > 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200910 int16_t offset = inst->VRegB_21t();
911 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200912 if (UNLIKELY(self->TestAllFlags())) {
913 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200914 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200915 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200916 }
917 ADVANCE(offset);
918 } else {
919 ADVANCE(2);
920 }
921 }
922 HANDLE_INSTRUCTION_END();
923
924 HANDLE_INSTRUCTION_START(IF_LEZ) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +0200925 if (shadow_frame.GetVReg(inst->VRegA_21t(inst_data)) <= 0) {
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200926 int16_t offset = inst->VRegB_21t();
927 if (IsBackwardBranch(offset)) {
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200928 if (UNLIKELY(self->TestAllFlags())) {
929 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +0200930 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +0200931 }
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200932 }
933 ADVANCE(offset);
934 } else {
935 ADVANCE(2);
936 }
937 }
938 HANDLE_INSTRUCTION_END();
939
940 HANDLE_INSTRUCTION_START(AGET_BOOLEAN) {
941 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
942 if (UNLIKELY(a == NULL)) {
943 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
944 HANDLE_PENDING_EXCEPTION();
945 } else {
946 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
947 BooleanArray* array = a->AsBooleanArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +0100948 if (LIKELY(array->CheckIsValidIndex(index))) {
949 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200950 ADVANCE(2);
951 } else {
952 HANDLE_PENDING_EXCEPTION();
953 }
954 }
955 }
956 HANDLE_INSTRUCTION_END();
957
958 HANDLE_INSTRUCTION_START(AGET_BYTE) {
959 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
960 if (UNLIKELY(a == NULL)) {
961 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
962 HANDLE_PENDING_EXCEPTION();
963 } else {
964 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
965 ByteArray* array = a->AsByteArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +0100966 if (LIKELY(array->CheckIsValidIndex(index))) {
967 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200968 ADVANCE(2);
969 } else {
970 HANDLE_PENDING_EXCEPTION();
971 }
972 }
973 }
974 HANDLE_INSTRUCTION_END();
975
976 HANDLE_INSTRUCTION_START(AGET_CHAR) {
977 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
978 if (UNLIKELY(a == NULL)) {
979 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
980 HANDLE_PENDING_EXCEPTION();
981 } else {
982 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
983 CharArray* array = a->AsCharArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +0100984 if (LIKELY(array->CheckIsValidIndex(index))) {
985 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +0200986 ADVANCE(2);
987 } else {
988 HANDLE_PENDING_EXCEPTION();
989 }
990 }
991 }
992 HANDLE_INSTRUCTION_END();
993
994 HANDLE_INSTRUCTION_START(AGET_SHORT) {
995 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
996 if (UNLIKELY(a == NULL)) {
997 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
998 HANDLE_PENDING_EXCEPTION();
999 } else {
1000 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1001 ShortArray* array = a->AsShortArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001002 if (LIKELY(array->CheckIsValidIndex(index))) {
1003 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001004 ADVANCE(2);
1005 } else {
1006 HANDLE_PENDING_EXCEPTION();
1007 }
1008 }
1009 }
1010 HANDLE_INSTRUCTION_END();
1011
1012 HANDLE_INSTRUCTION_START(AGET) {
1013 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1014 if (UNLIKELY(a == NULL)) {
1015 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1016 HANDLE_PENDING_EXCEPTION();
1017 } else {
1018 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1019 IntArray* array = a->AsIntArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001020 if (LIKELY(array->CheckIsValidIndex(index))) {
1021 shadow_frame.SetVReg(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001022 ADVANCE(2);
1023 } else {
1024 HANDLE_PENDING_EXCEPTION();
1025 }
1026 }
1027 }
1028 HANDLE_INSTRUCTION_END();
1029
1030 HANDLE_INSTRUCTION_START(AGET_WIDE) {
1031 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1032 if (UNLIKELY(a == NULL)) {
1033 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1034 HANDLE_PENDING_EXCEPTION();
1035 } else {
1036 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1037 LongArray* array = a->AsLongArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001038 if (LIKELY(array->CheckIsValidIndex(index))) {
1039 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001040 ADVANCE(2);
1041 } else {
1042 HANDLE_PENDING_EXCEPTION();
1043 }
1044 }
1045 }
1046 HANDLE_INSTRUCTION_END();
1047
1048 HANDLE_INSTRUCTION_START(AGET_OBJECT) {
1049 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1050 if (UNLIKELY(a == NULL)) {
1051 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1052 HANDLE_PENDING_EXCEPTION();
1053 } else {
1054 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1055 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001056 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001057 shadow_frame.SetVRegReference(inst->VRegA_23x(inst_data), array->GetWithoutChecks(index));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001058 ADVANCE(2);
1059 } else {
1060 HANDLE_PENDING_EXCEPTION();
1061 }
1062 }
1063 }
1064 HANDLE_INSTRUCTION_END();
1065
1066 HANDLE_INSTRUCTION_START(APUT_BOOLEAN) {
1067 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1068 if (UNLIKELY(a == NULL)) {
1069 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1070 HANDLE_PENDING_EXCEPTION();
1071 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001072 uint8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001073 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1074 BooleanArray* array = a->AsBooleanArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001075 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001076 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001077 ADVANCE(2);
1078 } else {
1079 HANDLE_PENDING_EXCEPTION();
1080 }
1081 }
1082 }
1083 HANDLE_INSTRUCTION_END();
1084
1085 HANDLE_INSTRUCTION_START(APUT_BYTE) {
1086 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1087 if (UNLIKELY(a == NULL)) {
1088 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1089 HANDLE_PENDING_EXCEPTION();
1090 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001091 int8_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001092 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1093 ByteArray* array = a->AsByteArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001094 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001095 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001096 ADVANCE(2);
1097 } else {
1098 HANDLE_PENDING_EXCEPTION();
1099 }
1100 }
1101 }
1102 HANDLE_INSTRUCTION_END();
1103
1104 HANDLE_INSTRUCTION_START(APUT_CHAR) {
1105 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1106 if (UNLIKELY(a == NULL)) {
1107 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1108 HANDLE_PENDING_EXCEPTION();
1109 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001110 uint16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001111 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1112 CharArray* array = a->AsCharArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001113 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001114 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001115 ADVANCE(2);
1116 } else {
1117 HANDLE_PENDING_EXCEPTION();
1118 }
1119 }
1120 }
1121 HANDLE_INSTRUCTION_END();
1122
1123 HANDLE_INSTRUCTION_START(APUT_SHORT) {
1124 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1125 if (UNLIKELY(a == NULL)) {
1126 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1127 HANDLE_PENDING_EXCEPTION();
1128 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001129 int16_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001130 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1131 ShortArray* array = a->AsShortArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001132 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001133 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001134 ADVANCE(2);
1135 } else {
1136 HANDLE_PENDING_EXCEPTION();
1137 }
1138 }
1139 }
1140 HANDLE_INSTRUCTION_END();
1141
1142 HANDLE_INSTRUCTION_START(APUT) {
1143 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1144 if (UNLIKELY(a == NULL)) {
1145 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1146 HANDLE_PENDING_EXCEPTION();
1147 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001148 int32_t val = shadow_frame.GetVReg(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001149 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1150 IntArray* array = a->AsIntArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001151 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001152 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001153 ADVANCE(2);
1154 } else {
1155 HANDLE_PENDING_EXCEPTION();
1156 }
1157 }
1158 }
1159 HANDLE_INSTRUCTION_END();
1160
1161 HANDLE_INSTRUCTION_START(APUT_WIDE) {
1162 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1163 if (UNLIKELY(a == NULL)) {
1164 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1165 HANDLE_PENDING_EXCEPTION();
1166 } else {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001167 int64_t val = shadow_frame.GetVRegLong(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001168 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
1169 LongArray* array = a->AsLongArray();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001170 if (LIKELY(array->CheckIsValidIndex(index))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001171 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001172 ADVANCE(2);
1173 } else {
1174 HANDLE_PENDING_EXCEPTION();
1175 }
1176 }
1177 }
1178 HANDLE_INSTRUCTION_END();
1179
1180 HANDLE_INSTRUCTION_START(APUT_OBJECT) {
1181 Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x());
1182 if (UNLIKELY(a == NULL)) {
1183 ThrowNullPointerExceptionFromDexPC(shadow_frame.GetCurrentLocationForThrow());
1184 HANDLE_PENDING_EXCEPTION();
1185 } else {
1186 int32_t index = shadow_frame.GetVReg(inst->VRegC_23x());
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001187 Object* val = shadow_frame.GetVRegReference(inst->VRegA_23x(inst_data));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001188 ObjectArray<Object>* array = a->AsObjectArray<Object>();
Sebastien Hertzabff6432014-01-27 18:01:39 +01001189 if (LIKELY(array->CheckIsValidIndex(index) && array->CheckAssignable(val))) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001190 array->SetWithoutChecks<transaction_active>(index, val);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001191 ADVANCE(2);
1192 } else {
1193 HANDLE_PENDING_EXCEPTION();
1194 }
1195 }
1196 }
1197 HANDLE_INSTRUCTION_END();
1198
1199 HANDLE_INSTRUCTION_START(IGET_BOOLEAN) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001200 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimBoolean, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001201 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1202 }
1203 HANDLE_INSTRUCTION_END();
1204
1205 HANDLE_INSTRUCTION_START(IGET_BYTE) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001206 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimByte, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001207 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1208 }
1209 HANDLE_INSTRUCTION_END();
1210
1211 HANDLE_INSTRUCTION_START(IGET_CHAR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001212 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimChar, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001213 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1214 }
1215 HANDLE_INSTRUCTION_END();
1216
1217 HANDLE_INSTRUCTION_START(IGET_SHORT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001218 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimShort, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001219 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1220 }
1221 HANDLE_INSTRUCTION_END();
1222
1223 HANDLE_INSTRUCTION_START(IGET) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001224 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimInt, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001225 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1226 }
1227 HANDLE_INSTRUCTION_END();
1228
1229 HANDLE_INSTRUCTION_START(IGET_WIDE) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001230 bool success = DoFieldGet<InstancePrimitiveRead, Primitive::kPrimLong, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001231 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1232 }
1233 HANDLE_INSTRUCTION_END();
1234
1235 HANDLE_INSTRUCTION_START(IGET_OBJECT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001236 bool success = DoFieldGet<InstanceObjectRead, Primitive::kPrimNot, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001237 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1238 }
1239 HANDLE_INSTRUCTION_END();
1240
1241 HANDLE_INSTRUCTION_START(IGET_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001242 bool success = DoIGetQuick<Primitive::kPrimInt>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001243 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1244 }
1245 HANDLE_INSTRUCTION_END();
1246
1247 HANDLE_INSTRUCTION_START(IGET_WIDE_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001248 bool success = DoIGetQuick<Primitive::kPrimLong>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001249 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1250 }
1251 HANDLE_INSTRUCTION_END();
1252
1253 HANDLE_INSTRUCTION_START(IGET_OBJECT_QUICK) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001254 bool success = DoIGetQuick<Primitive::kPrimNot>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001255 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1256 }
1257 HANDLE_INSTRUCTION_END();
1258
1259 HANDLE_INSTRUCTION_START(SGET_BOOLEAN) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001260 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimBoolean, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001261 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1262 }
1263 HANDLE_INSTRUCTION_END();
1264
1265 HANDLE_INSTRUCTION_START(SGET_BYTE) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001266 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimByte, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001267 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1268 }
1269 HANDLE_INSTRUCTION_END();
1270
1271 HANDLE_INSTRUCTION_START(SGET_CHAR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001272 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimChar, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001273 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1274 }
1275 HANDLE_INSTRUCTION_END();
1276
1277 HANDLE_INSTRUCTION_START(SGET_SHORT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001278 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimShort, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001279 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1280 }
1281 HANDLE_INSTRUCTION_END();
1282
1283 HANDLE_INSTRUCTION_START(SGET) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001284 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimInt, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001285 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1286 }
1287 HANDLE_INSTRUCTION_END();
1288
1289 HANDLE_INSTRUCTION_START(SGET_WIDE) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001290 bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimLong, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001291 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1292 }
1293 HANDLE_INSTRUCTION_END();
1294
1295 HANDLE_INSTRUCTION_START(SGET_OBJECT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001296 bool success = DoFieldGet<StaticObjectRead, Primitive::kPrimNot, do_access_check>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001297 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1298 }
1299 HANDLE_INSTRUCTION_END();
1300
1301 HANDLE_INSTRUCTION_START(IPUT_BOOLEAN) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001302 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimBoolean, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001303 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1304 }
1305 HANDLE_INSTRUCTION_END();
1306
1307 HANDLE_INSTRUCTION_START(IPUT_BYTE) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001308 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimByte, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001309 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1310 }
1311 HANDLE_INSTRUCTION_END();
1312
1313 HANDLE_INSTRUCTION_START(IPUT_CHAR) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001314 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimChar, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001315 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1316 }
1317 HANDLE_INSTRUCTION_END();
1318
1319 HANDLE_INSTRUCTION_START(IPUT_SHORT) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001320 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimShort, do_access_check, transaction_active>(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(IPUT) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001326 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimInt, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001327 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1328 }
1329 HANDLE_INSTRUCTION_END();
1330
1331 HANDLE_INSTRUCTION_START(IPUT_WIDE) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001332 bool success = DoFieldPut<InstancePrimitiveWrite, Primitive::kPrimLong, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001333 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1334 }
1335 HANDLE_INSTRUCTION_END();
1336
1337 HANDLE_INSTRUCTION_START(IPUT_OBJECT) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001338 bool success = DoFieldPut<InstanceObjectWrite, Primitive::kPrimNot, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001339 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1340 }
1341 HANDLE_INSTRUCTION_END();
1342
1343 HANDLE_INSTRUCTION_START(IPUT_QUICK) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001344 bool success = DoIPutQuick<Primitive::kPrimInt, transaction_active>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001345 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1346 }
1347 HANDLE_INSTRUCTION_END();
1348
1349 HANDLE_INSTRUCTION_START(IPUT_WIDE_QUICK) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001350 bool success = DoIPutQuick<Primitive::kPrimLong, transaction_active>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001351 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1352 }
1353 HANDLE_INSTRUCTION_END();
1354
1355 HANDLE_INSTRUCTION_START(IPUT_OBJECT_QUICK) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001356 bool success = DoIPutQuick<Primitive::kPrimNot, transaction_active>(shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001357 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1358 }
1359 HANDLE_INSTRUCTION_END();
1360
1361 HANDLE_INSTRUCTION_START(SPUT_BOOLEAN) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001362 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimBoolean, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001363 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1364 }
1365 HANDLE_INSTRUCTION_END();
1366
1367 HANDLE_INSTRUCTION_START(SPUT_BYTE) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001368 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimByte, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001369 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1370 }
1371 HANDLE_INSTRUCTION_END();
1372
1373 HANDLE_INSTRUCTION_START(SPUT_CHAR) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001374 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimChar, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001375 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1376 }
1377 HANDLE_INSTRUCTION_END();
1378
1379 HANDLE_INSTRUCTION_START(SPUT_SHORT) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001380 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimShort, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001381 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1382 }
1383 HANDLE_INSTRUCTION_END();
1384
1385 HANDLE_INSTRUCTION_START(SPUT) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001386 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimInt, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001387 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1388 }
1389 HANDLE_INSTRUCTION_END();
1390
1391 HANDLE_INSTRUCTION_START(SPUT_WIDE) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001392 bool success = DoFieldPut<StaticPrimitiveWrite, Primitive::kPrimLong, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001393 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1394 }
1395 HANDLE_INSTRUCTION_END();
1396
1397 HANDLE_INSTRUCTION_START(SPUT_OBJECT) {
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01001398 bool success = DoFieldPut<StaticObjectWrite, Primitive::kPrimNot, do_access_check, transaction_active>(self, shadow_frame, inst, inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001399 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1400 }
1401 HANDLE_INSTRUCTION_END();
1402
1403 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001404 bool success = DoInvoke<kVirtual, false, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001405 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001406 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1407 }
1408 HANDLE_INSTRUCTION_END();
1409
1410 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001411 bool success = DoInvoke<kVirtual, true, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001412 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001413 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1414 }
1415 HANDLE_INSTRUCTION_END();
1416
1417 HANDLE_INSTRUCTION_START(INVOKE_SUPER) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001418 bool success = DoInvoke<kSuper, false, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001419 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001420 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1421 }
1422 HANDLE_INSTRUCTION_END();
1423
1424 HANDLE_INSTRUCTION_START(INVOKE_SUPER_RANGE) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001425 bool success = DoInvoke<kSuper, true, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001426 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001427 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1428 }
1429 HANDLE_INSTRUCTION_END();
1430
1431 HANDLE_INSTRUCTION_START(INVOKE_DIRECT) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001432 bool success = DoInvoke<kDirect, false, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001433 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001434 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1435 }
1436 HANDLE_INSTRUCTION_END();
1437
1438 HANDLE_INSTRUCTION_START(INVOKE_DIRECT_RANGE) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001439 bool success = DoInvoke<kDirect, true, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001440 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001441 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1442 }
1443 HANDLE_INSTRUCTION_END();
1444
1445 HANDLE_INSTRUCTION_START(INVOKE_INTERFACE) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001446 bool success = DoInvoke<kInterface, false, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001447 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001448 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1449 }
1450 HANDLE_INSTRUCTION_END();
1451
1452 HANDLE_INSTRUCTION_START(INVOKE_INTERFACE_RANGE) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001453 bool success = DoInvoke<kInterface, true, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001454 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001455 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1456 }
1457 HANDLE_INSTRUCTION_END();
1458
1459 HANDLE_INSTRUCTION_START(INVOKE_STATIC) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001460 bool success = DoInvoke<kStatic, false, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001461 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001462 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1463 }
1464 HANDLE_INSTRUCTION_END();
1465
1466 HANDLE_INSTRUCTION_START(INVOKE_STATIC_RANGE) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001467 bool success = DoInvoke<kStatic, true, do_access_check>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001468 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001469 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1470 }
1471 HANDLE_INSTRUCTION_END();
1472
1473 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_QUICK) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001474 bool success = DoInvokeVirtualQuick<false>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001475 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001476 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1477 }
1478 HANDLE_INSTRUCTION_END();
1479
1480 HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE_QUICK) {
Sebastien Hertzc61124b2013-09-10 11:44:19 +02001481 bool success = DoInvokeVirtualQuick<true>(self, shadow_frame, inst, inst_data, &result_register);
Sebastien Hertzcdf2d4c2013-09-13 14:57:51 +02001482 UPDATE_HANDLER_TABLE();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001483 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3);
1484 }
1485 HANDLE_INSTRUCTION_END();
1486
1487 HANDLE_INSTRUCTION_START(NEG_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001488 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), -shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001489 ADVANCE(1);
1490 HANDLE_INSTRUCTION_END();
1491
1492 HANDLE_INSTRUCTION_START(NOT_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001493 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), ~shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001494 ADVANCE(1);
1495 HANDLE_INSTRUCTION_END();
1496
1497 HANDLE_INSTRUCTION_START(NEG_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001498 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), -shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001499 ADVANCE(1);
1500 HANDLE_INSTRUCTION_END();
1501
1502 HANDLE_INSTRUCTION_START(NOT_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001503 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), ~shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001504 ADVANCE(1);
1505 HANDLE_INSTRUCTION_END();
1506
1507 HANDLE_INSTRUCTION_START(NEG_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001508 shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), -shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001509 ADVANCE(1);
1510 HANDLE_INSTRUCTION_END();
1511
1512 HANDLE_INSTRUCTION_START(NEG_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001513 shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), -shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001514 ADVANCE(1);
1515 HANDLE_INSTRUCTION_END();
1516
1517 HANDLE_INSTRUCTION_START(INT_TO_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001518 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001519 ADVANCE(1);
1520 HANDLE_INSTRUCTION_END();
1521
1522 HANDLE_INSTRUCTION_START(INT_TO_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001523 shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001524 ADVANCE(1);
1525 HANDLE_INSTRUCTION_END();
1526
1527 HANDLE_INSTRUCTION_START(INT_TO_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001528 shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001529 ADVANCE(1);
1530 HANDLE_INSTRUCTION_END();
1531
1532 HANDLE_INSTRUCTION_START(LONG_TO_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001533 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001534 ADVANCE(1);
1535 HANDLE_INSTRUCTION_END();
1536
1537 HANDLE_INSTRUCTION_START(LONG_TO_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001538 shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001539 ADVANCE(1);
1540 HANDLE_INSTRUCTION_END();
1541
1542 HANDLE_INSTRUCTION_START(LONG_TO_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001543 shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001544 ADVANCE(1);
1545 HANDLE_INSTRUCTION_END();
1546
1547 HANDLE_INSTRUCTION_START(FLOAT_TO_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001548 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001549 int32_t result = art_float_to_integral<int32_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001550 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001551 ADVANCE(1);
1552 }
1553 HANDLE_INSTRUCTION_END();
1554
1555 HANDLE_INSTRUCTION_START(FLOAT_TO_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001556 float val = shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001557 int64_t result = art_float_to_integral<int64_t, float>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001558 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001559 ADVANCE(1);
1560 }
1561 HANDLE_INSTRUCTION_END();
1562
1563 HANDLE_INSTRUCTION_START(FLOAT_TO_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001564 shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001565 ADVANCE(1);
1566 HANDLE_INSTRUCTION_END();
1567
1568 HANDLE_INSTRUCTION_START(DOUBLE_TO_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001569 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001570 int32_t result = art_float_to_integral<int32_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001571 shadow_frame.SetVReg(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001572 ADVANCE(1);
1573 }
1574 HANDLE_INSTRUCTION_END();
1575
1576 HANDLE_INSTRUCTION_START(DOUBLE_TO_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001577 double val = shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data));
Ian Rogers450dcb52013-09-20 17:36:02 -07001578 int64_t result = art_float_to_integral<int64_t, double>(val);
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001579 shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), result);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001580 ADVANCE(1);
1581 }
1582 HANDLE_INSTRUCTION_END();
1583
1584 HANDLE_INSTRUCTION_START(DOUBLE_TO_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001585 shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001586 ADVANCE(1);
1587 HANDLE_INSTRUCTION_END();
1588
1589 HANDLE_INSTRUCTION_START(INT_TO_BYTE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001590 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1591 static_cast<int8_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001592 ADVANCE(1);
1593 HANDLE_INSTRUCTION_END();
1594
1595 HANDLE_INSTRUCTION_START(INT_TO_CHAR)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001596 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1597 static_cast<uint16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001598 ADVANCE(1);
1599 HANDLE_INSTRUCTION_END();
1600
1601 HANDLE_INSTRUCTION_START(INT_TO_SHORT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001602 shadow_frame.SetVReg(inst->VRegA_12x(inst_data),
1603 static_cast<int16_t>(shadow_frame.GetVReg(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001604 ADVANCE(1);
1605 HANDLE_INSTRUCTION_END();
1606
1607 HANDLE_INSTRUCTION_START(ADD_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001608 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001609 shadow_frame.GetVReg(inst->VRegB_23x()) +
1610 shadow_frame.GetVReg(inst->VRegC_23x()));
1611 ADVANCE(2);
1612 HANDLE_INSTRUCTION_END();
1613
1614 HANDLE_INSTRUCTION_START(SUB_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001615 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001616 shadow_frame.GetVReg(inst->VRegB_23x()) -
1617 shadow_frame.GetVReg(inst->VRegC_23x()));
1618 ADVANCE(2);
1619 HANDLE_INSTRUCTION_END();
1620
1621 HANDLE_INSTRUCTION_START(MUL_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001622 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001623 shadow_frame.GetVReg(inst->VRegB_23x()) *
1624 shadow_frame.GetVReg(inst->VRegC_23x()));
1625 ADVANCE(2);
1626 HANDLE_INSTRUCTION_END();
1627
1628 HANDLE_INSTRUCTION_START(DIV_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001629 bool success = DoIntDivide(shadow_frame, inst->VRegA_23x(inst_data),
1630 shadow_frame.GetVReg(inst->VRegB_23x()),
1631 shadow_frame.GetVReg(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001632 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1633 }
1634 HANDLE_INSTRUCTION_END();
1635
1636 HANDLE_INSTRUCTION_START(REM_INT) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001637 bool success = DoIntRemainder(shadow_frame, inst->VRegA_23x(inst_data),
1638 shadow_frame.GetVReg(inst->VRegB_23x()),
1639 shadow_frame.GetVReg(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001640 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1641 }
1642 HANDLE_INSTRUCTION_END();
1643
1644 HANDLE_INSTRUCTION_START(SHL_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001645 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001646 shadow_frame.GetVReg(inst->VRegB_23x()) <<
1647 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1648 ADVANCE(2);
1649 HANDLE_INSTRUCTION_END();
1650
1651 HANDLE_INSTRUCTION_START(SHR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001652 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001653 shadow_frame.GetVReg(inst->VRegB_23x()) >>
1654 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1655 ADVANCE(2);
1656 HANDLE_INSTRUCTION_END();
1657
1658 HANDLE_INSTRUCTION_START(USHR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001659 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001660 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_23x())) >>
1661 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x1f));
1662 ADVANCE(2);
1663 HANDLE_INSTRUCTION_END();
1664
1665 HANDLE_INSTRUCTION_START(AND_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001666 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001667 shadow_frame.GetVReg(inst->VRegB_23x()) &
1668 shadow_frame.GetVReg(inst->VRegC_23x()));
1669 ADVANCE(2);
1670 HANDLE_INSTRUCTION_END();
1671
1672 HANDLE_INSTRUCTION_START(OR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001673 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001674 shadow_frame.GetVReg(inst->VRegB_23x()) |
1675 shadow_frame.GetVReg(inst->VRegC_23x()));
1676 ADVANCE(2);
1677 HANDLE_INSTRUCTION_END();
1678
1679 HANDLE_INSTRUCTION_START(XOR_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001680 shadow_frame.SetVReg(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001681 shadow_frame.GetVReg(inst->VRegB_23x()) ^
1682 shadow_frame.GetVReg(inst->VRegC_23x()));
1683 ADVANCE(2);
1684 HANDLE_INSTRUCTION_END();
1685
1686 HANDLE_INSTRUCTION_START(ADD_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001687 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001688 shadow_frame.GetVRegLong(inst->VRegB_23x()) +
1689 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1690 ADVANCE(2);
1691 HANDLE_INSTRUCTION_END();
1692
1693 HANDLE_INSTRUCTION_START(SUB_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001694 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001695 shadow_frame.GetVRegLong(inst->VRegB_23x()) -
1696 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1697 ADVANCE(2);
1698 HANDLE_INSTRUCTION_END();
1699
1700 HANDLE_INSTRUCTION_START(MUL_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001701 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001702 shadow_frame.GetVRegLong(inst->VRegB_23x()) *
1703 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1704 ADVANCE(2);
1705 HANDLE_INSTRUCTION_END();
1706
1707 HANDLE_INSTRUCTION_START(DIV_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001708 bool success = DoLongDivide(shadow_frame, inst->VRegA_23x(inst_data),
1709 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1710 shadow_frame.GetVRegLong(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001711 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1712 }
1713 HANDLE_INSTRUCTION_END();
1714
1715 HANDLE_INSTRUCTION_START(REM_LONG) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001716 bool success = DoLongRemainder(shadow_frame, inst->VRegA_23x(inst_data),
1717 shadow_frame.GetVRegLong(inst->VRegB_23x()),
1718 shadow_frame.GetVRegLong(inst->VRegC_23x()));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001719 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
1720 }
1721 HANDLE_INSTRUCTION_END();
1722
1723 HANDLE_INSTRUCTION_START(AND_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001724 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001725 shadow_frame.GetVRegLong(inst->VRegB_23x()) &
1726 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1727 ADVANCE(2);
1728 HANDLE_INSTRUCTION_END();
1729
1730 HANDLE_INSTRUCTION_START(OR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001731 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001732 shadow_frame.GetVRegLong(inst->VRegB_23x()) |
1733 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1734 ADVANCE(2);
1735 HANDLE_INSTRUCTION_END();
1736
1737 HANDLE_INSTRUCTION_START(XOR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001738 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001739 shadow_frame.GetVRegLong(inst->VRegB_23x()) ^
1740 shadow_frame.GetVRegLong(inst->VRegC_23x()));
1741 ADVANCE(2);
1742 HANDLE_INSTRUCTION_END();
1743
1744 HANDLE_INSTRUCTION_START(SHL_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001745 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001746 shadow_frame.GetVRegLong(inst->VRegB_23x()) <<
1747 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1748 ADVANCE(2);
1749 HANDLE_INSTRUCTION_END();
1750
1751 HANDLE_INSTRUCTION_START(SHR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001752 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001753 shadow_frame.GetVRegLong(inst->VRegB_23x()) >>
1754 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1755 ADVANCE(2);
1756 HANDLE_INSTRUCTION_END();
1757
1758 HANDLE_INSTRUCTION_START(USHR_LONG)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001759 shadow_frame.SetVRegLong(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001760 static_cast<uint64_t>(shadow_frame.GetVRegLong(inst->VRegB_23x())) >>
1761 (shadow_frame.GetVReg(inst->VRegC_23x()) & 0x3f));
1762 ADVANCE(2);
1763 HANDLE_INSTRUCTION_END();
1764
1765 HANDLE_INSTRUCTION_START(ADD_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001766 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001767 shadow_frame.GetVRegFloat(inst->VRegB_23x()) +
1768 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1769 ADVANCE(2);
1770 HANDLE_INSTRUCTION_END();
1771
1772 HANDLE_INSTRUCTION_START(SUB_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001773 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001774 shadow_frame.GetVRegFloat(inst->VRegB_23x()) -
1775 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1776 ADVANCE(2);
1777 HANDLE_INSTRUCTION_END();
1778
1779 HANDLE_INSTRUCTION_START(MUL_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001780 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001781 shadow_frame.GetVRegFloat(inst->VRegB_23x()) *
1782 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1783 ADVANCE(2);
1784 HANDLE_INSTRUCTION_END();
1785
1786 HANDLE_INSTRUCTION_START(DIV_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001787 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001788 shadow_frame.GetVRegFloat(inst->VRegB_23x()) /
1789 shadow_frame.GetVRegFloat(inst->VRegC_23x()));
1790 ADVANCE(2);
1791 HANDLE_INSTRUCTION_END();
1792
1793 HANDLE_INSTRUCTION_START(REM_FLOAT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001794 shadow_frame.SetVRegFloat(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001795 fmodf(shadow_frame.GetVRegFloat(inst->VRegB_23x()),
1796 shadow_frame.GetVRegFloat(inst->VRegC_23x())));
1797 ADVANCE(2);
1798 HANDLE_INSTRUCTION_END();
1799
1800 HANDLE_INSTRUCTION_START(ADD_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001801 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001802 shadow_frame.GetVRegDouble(inst->VRegB_23x()) +
1803 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1804 ADVANCE(2);
1805 HANDLE_INSTRUCTION_END();
1806
1807 HANDLE_INSTRUCTION_START(SUB_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001808 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001809 shadow_frame.GetVRegDouble(inst->VRegB_23x()) -
1810 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1811 ADVANCE(2);
1812 HANDLE_INSTRUCTION_END();
1813
1814 HANDLE_INSTRUCTION_START(MUL_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001815 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001816 shadow_frame.GetVRegDouble(inst->VRegB_23x()) *
1817 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1818 ADVANCE(2);
1819 HANDLE_INSTRUCTION_END();
1820
1821 HANDLE_INSTRUCTION_START(DIV_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001822 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001823 shadow_frame.GetVRegDouble(inst->VRegB_23x()) /
1824 shadow_frame.GetVRegDouble(inst->VRegC_23x()));
1825 ADVANCE(2);
1826 HANDLE_INSTRUCTION_END();
1827
1828 HANDLE_INSTRUCTION_START(REM_DOUBLE)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001829 shadow_frame.SetVRegDouble(inst->VRegA_23x(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001830 fmod(shadow_frame.GetVRegDouble(inst->VRegB_23x()),
1831 shadow_frame.GetVRegDouble(inst->VRegC_23x())));
1832 ADVANCE(2);
1833 HANDLE_INSTRUCTION_END();
1834
1835 HANDLE_INSTRUCTION_START(ADD_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001836 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001837 shadow_frame.SetVReg(vregA,
1838 shadow_frame.GetVReg(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001839 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001840 ADVANCE(1);
1841 }
1842 HANDLE_INSTRUCTION_END();
1843
1844 HANDLE_INSTRUCTION_START(SUB_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001845 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001846 shadow_frame.SetVReg(vregA,
1847 shadow_frame.GetVReg(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001848 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001849 ADVANCE(1);
1850 }
1851 HANDLE_INSTRUCTION_END();
1852
1853 HANDLE_INSTRUCTION_START(MUL_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001854 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001855 shadow_frame.SetVReg(vregA,
1856 shadow_frame.GetVReg(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001857 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001858 ADVANCE(1);
1859 }
1860 HANDLE_INSTRUCTION_END();
1861
1862 HANDLE_INSTRUCTION_START(DIV_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001863 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001864 bool success = DoIntDivide(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001865 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001866 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
1867 }
1868 HANDLE_INSTRUCTION_END();
1869
1870 HANDLE_INSTRUCTION_START(REM_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001871 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001872 bool success = DoIntRemainder(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001873 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001874 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
1875 }
1876 HANDLE_INSTRUCTION_END();
1877
1878 HANDLE_INSTRUCTION_START(SHL_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001879 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001880 shadow_frame.SetVReg(vregA,
1881 shadow_frame.GetVReg(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001882 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001883 ADVANCE(1);
1884 }
1885 HANDLE_INSTRUCTION_END();
1886
1887 HANDLE_INSTRUCTION_START(SHR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001888 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001889 shadow_frame.SetVReg(vregA,
1890 shadow_frame.GetVReg(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001891 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001892 ADVANCE(1);
1893 }
1894 HANDLE_INSTRUCTION_END();
1895
1896 HANDLE_INSTRUCTION_START(USHR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001897 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001898 shadow_frame.SetVReg(vregA,
1899 static_cast<uint32_t>(shadow_frame.GetVReg(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001900 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x1f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001901 ADVANCE(1);
1902 }
1903 HANDLE_INSTRUCTION_END();
1904
1905 HANDLE_INSTRUCTION_START(AND_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001906 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001907 shadow_frame.SetVReg(vregA,
1908 shadow_frame.GetVReg(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001909 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001910 ADVANCE(1);
1911 }
1912 HANDLE_INSTRUCTION_END();
1913
1914 HANDLE_INSTRUCTION_START(OR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001915 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001916 shadow_frame.SetVReg(vregA,
1917 shadow_frame.GetVReg(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001918 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001919 ADVANCE(1);
1920 }
1921 HANDLE_INSTRUCTION_END();
1922
1923 HANDLE_INSTRUCTION_START(XOR_INT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001924 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001925 shadow_frame.SetVReg(vregA,
1926 shadow_frame.GetVReg(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001927 shadow_frame.GetVReg(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001928 ADVANCE(1);
1929 }
1930 HANDLE_INSTRUCTION_END();
1931
1932 HANDLE_INSTRUCTION_START(ADD_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001933 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001934 shadow_frame.SetVRegLong(vregA,
1935 shadow_frame.GetVRegLong(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001936 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001937 ADVANCE(1);
1938 }
1939 HANDLE_INSTRUCTION_END();
1940
1941 HANDLE_INSTRUCTION_START(SUB_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001942 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001943 shadow_frame.SetVRegLong(vregA,
1944 shadow_frame.GetVRegLong(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001945 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001946 ADVANCE(1);
1947 }
1948 HANDLE_INSTRUCTION_END();
1949
1950 HANDLE_INSTRUCTION_START(MUL_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001951 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001952 shadow_frame.SetVRegLong(vregA,
1953 shadow_frame.GetVRegLong(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001954 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001955 ADVANCE(1);
1956 }
1957 HANDLE_INSTRUCTION_END();
1958
1959 HANDLE_INSTRUCTION_START(DIV_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001960 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001961 bool success = DoLongDivide(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001962 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001963 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
1964 }
1965 HANDLE_INSTRUCTION_END();
1966
1967 HANDLE_INSTRUCTION_START(REM_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001968 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001969 bool success = DoLongRemainder(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001970 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001971 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 1);
1972 }
1973 HANDLE_INSTRUCTION_END();
1974
1975 HANDLE_INSTRUCTION_START(AND_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001976 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001977 shadow_frame.SetVRegLong(vregA,
1978 shadow_frame.GetVRegLong(vregA) &
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001979 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001980 ADVANCE(1);
1981 }
1982 HANDLE_INSTRUCTION_END();
1983
1984 HANDLE_INSTRUCTION_START(OR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001985 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001986 shadow_frame.SetVRegLong(vregA,
1987 shadow_frame.GetVRegLong(vregA) |
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001988 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001989 ADVANCE(1);
1990 }
1991 HANDLE_INSTRUCTION_END();
1992
1993 HANDLE_INSTRUCTION_START(XOR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001994 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001995 shadow_frame.SetVRegLong(vregA,
1996 shadow_frame.GetVRegLong(vregA) ^
Sebastien Hertz3b588e02013-09-11 14:33:18 +02001997 shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02001998 ADVANCE(1);
1999 }
2000 HANDLE_INSTRUCTION_END();
2001
2002 HANDLE_INSTRUCTION_START(SHL_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002003 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002004 shadow_frame.SetVRegLong(vregA,
2005 shadow_frame.GetVRegLong(vregA) <<
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002006 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002007 ADVANCE(1);
2008 }
2009 HANDLE_INSTRUCTION_END();
2010
2011 HANDLE_INSTRUCTION_START(SHR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002012 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002013 shadow_frame.SetVRegLong(vregA,
2014 shadow_frame.GetVRegLong(vregA) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002015 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002016 ADVANCE(1);
2017 }
2018 HANDLE_INSTRUCTION_END();
2019
2020 HANDLE_INSTRUCTION_START(USHR_LONG_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002021 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002022 shadow_frame.SetVRegLong(vregA,
2023 static_cast<uint64_t>(shadow_frame.GetVRegLong(vregA)) >>
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002024 (shadow_frame.GetVReg(inst->VRegB_12x(inst_data)) & 0x3f));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002025 ADVANCE(1);
2026 }
2027 HANDLE_INSTRUCTION_END();
2028
2029 HANDLE_INSTRUCTION_START(ADD_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002030 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002031 shadow_frame.SetVRegFloat(vregA,
2032 shadow_frame.GetVRegFloat(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002033 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002034 ADVANCE(1);
2035 }
2036 HANDLE_INSTRUCTION_END();
2037
2038 HANDLE_INSTRUCTION_START(SUB_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002039 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002040 shadow_frame.SetVRegFloat(vregA,
2041 shadow_frame.GetVRegFloat(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002042 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002043 ADVANCE(1);
2044 }
2045 HANDLE_INSTRUCTION_END();
2046
2047 HANDLE_INSTRUCTION_START(MUL_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002048 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002049 shadow_frame.SetVRegFloat(vregA,
2050 shadow_frame.GetVRegFloat(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002051 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002052 ADVANCE(1);
2053 }
2054 HANDLE_INSTRUCTION_END();
2055
2056 HANDLE_INSTRUCTION_START(DIV_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002057 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002058 shadow_frame.SetVRegFloat(vregA,
2059 shadow_frame.GetVRegFloat(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002060 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002061 ADVANCE(1);
2062 }
2063 HANDLE_INSTRUCTION_END();
2064
2065 HANDLE_INSTRUCTION_START(REM_FLOAT_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002066 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002067 shadow_frame.SetVRegFloat(vregA,
2068 fmodf(shadow_frame.GetVRegFloat(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002069 shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002070 ADVANCE(1);
2071 }
2072 HANDLE_INSTRUCTION_END();
2073
2074 HANDLE_INSTRUCTION_START(ADD_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002075 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002076 shadow_frame.SetVRegDouble(vregA,
2077 shadow_frame.GetVRegDouble(vregA) +
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002078 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002079 ADVANCE(1);
2080 }
2081 HANDLE_INSTRUCTION_END();
2082
2083 HANDLE_INSTRUCTION_START(SUB_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002084 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002085 shadow_frame.SetVRegDouble(vregA,
2086 shadow_frame.GetVRegDouble(vregA) -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002087 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002088 ADVANCE(1);
2089 }
2090 HANDLE_INSTRUCTION_END();
2091
2092 HANDLE_INSTRUCTION_START(MUL_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002093 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002094 shadow_frame.SetVRegDouble(vregA,
2095 shadow_frame.GetVRegDouble(vregA) *
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002096 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002097 ADVANCE(1);
2098 }
2099 HANDLE_INSTRUCTION_END();
2100
2101 HANDLE_INSTRUCTION_START(DIV_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002102 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002103 shadow_frame.SetVRegDouble(vregA,
2104 shadow_frame.GetVRegDouble(vregA) /
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002105 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002106 ADVANCE(1);
2107 }
2108 HANDLE_INSTRUCTION_END();
2109
2110 HANDLE_INSTRUCTION_START(REM_DOUBLE_2ADDR) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002111 uint32_t vregA = inst->VRegA_12x(inst_data);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002112 shadow_frame.SetVRegDouble(vregA,
2113 fmod(shadow_frame.GetVRegDouble(vregA),
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002114 shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002115 ADVANCE(1);
2116 }
2117 HANDLE_INSTRUCTION_END();
2118
2119 HANDLE_INSTRUCTION_START(ADD_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002120 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2121 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) +
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002122 inst->VRegC_22s());
2123 ADVANCE(2);
2124 HANDLE_INSTRUCTION_END();
2125
2126 HANDLE_INSTRUCTION_START(RSUB_INT)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002127 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002128 inst->VRegC_22s() -
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002129 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)));
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002130 ADVANCE(2);
2131 HANDLE_INSTRUCTION_END();
2132
2133 HANDLE_INSTRUCTION_START(MUL_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002134 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2135 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) *
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002136 inst->VRegC_22s());
2137 ADVANCE(2);
2138 HANDLE_INSTRUCTION_END();
2139
2140 HANDLE_INSTRUCTION_START(DIV_INT_LIT16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002141 bool success = DoIntDivide(shadow_frame, inst->VRegA_22s(inst_data),
2142 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002143 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2144 }
2145 HANDLE_INSTRUCTION_END();
2146
2147 HANDLE_INSTRUCTION_START(REM_INT_LIT16) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002148 bool success = DoIntRemainder(shadow_frame, inst->VRegA_22s(inst_data),
2149 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), inst->VRegC_22s());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002150 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2151 }
2152 HANDLE_INSTRUCTION_END();
2153
2154 HANDLE_INSTRUCTION_START(AND_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002155 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2156 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) &
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002157 inst->VRegC_22s());
2158 ADVANCE(2);
2159 HANDLE_INSTRUCTION_END();
2160
2161 HANDLE_INSTRUCTION_START(OR_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002162 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2163 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) |
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002164 inst->VRegC_22s());
2165 ADVANCE(2);
2166 HANDLE_INSTRUCTION_END();
2167
2168 HANDLE_INSTRUCTION_START(XOR_INT_LIT16)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002169 shadow_frame.SetVReg(inst->VRegA_22s(inst_data),
2170 shadow_frame.GetVReg(inst->VRegB_22s(inst_data)) ^
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002171 inst->VRegC_22s());
2172 ADVANCE(2);
2173 HANDLE_INSTRUCTION_END();
2174
2175 HANDLE_INSTRUCTION_START(ADD_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002176 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002177 shadow_frame.GetVReg(inst->VRegB_22b()) +
2178 inst->VRegC_22b());
2179 ADVANCE(2);
2180 HANDLE_INSTRUCTION_END();
2181
2182 HANDLE_INSTRUCTION_START(RSUB_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002183 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002184 inst->VRegC_22b() -
2185 shadow_frame.GetVReg(inst->VRegB_22b()));
2186 ADVANCE(2);
2187 HANDLE_INSTRUCTION_END();
2188
2189 HANDLE_INSTRUCTION_START(MUL_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002190 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002191 shadow_frame.GetVReg(inst->VRegB_22b()) *
2192 inst->VRegC_22b());
2193 ADVANCE(2);
2194 HANDLE_INSTRUCTION_END();
2195
2196 HANDLE_INSTRUCTION_START(DIV_INT_LIT8) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002197 bool success = DoIntDivide(shadow_frame, inst->VRegA_22b(inst_data),
2198 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002199 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2200 }
2201 HANDLE_INSTRUCTION_END();
2202
2203 HANDLE_INSTRUCTION_START(REM_INT_LIT8) {
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002204 bool success = DoIntRemainder(shadow_frame, inst->VRegA_22b(inst_data),
2205 shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002206 POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2);
2207 }
2208 HANDLE_INSTRUCTION_END();
2209
2210 HANDLE_INSTRUCTION_START(AND_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002211 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002212 shadow_frame.GetVReg(inst->VRegB_22b()) &
2213 inst->VRegC_22b());
2214 ADVANCE(2);
2215 HANDLE_INSTRUCTION_END();
2216
2217 HANDLE_INSTRUCTION_START(OR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002218 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002219 shadow_frame.GetVReg(inst->VRegB_22b()) |
2220 inst->VRegC_22b());
2221 ADVANCE(2);
2222 HANDLE_INSTRUCTION_END();
2223
2224 HANDLE_INSTRUCTION_START(XOR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002225 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002226 shadow_frame.GetVReg(inst->VRegB_22b()) ^
2227 inst->VRegC_22b());
2228 ADVANCE(2);
2229 HANDLE_INSTRUCTION_END();
2230
2231 HANDLE_INSTRUCTION_START(SHL_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002232 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002233 shadow_frame.GetVReg(inst->VRegB_22b()) <<
2234 (inst->VRegC_22b() & 0x1f));
2235 ADVANCE(2);
2236 HANDLE_INSTRUCTION_END();
2237
2238 HANDLE_INSTRUCTION_START(SHR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002239 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002240 shadow_frame.GetVReg(inst->VRegB_22b()) >>
2241 (inst->VRegC_22b() & 0x1f));
2242 ADVANCE(2);
2243 HANDLE_INSTRUCTION_END();
2244
2245 HANDLE_INSTRUCTION_START(USHR_INT_LIT8)
Sebastien Hertz3b588e02013-09-11 14:33:18 +02002246 shadow_frame.SetVReg(inst->VRegA_22b(inst_data),
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002247 static_cast<uint32_t>(shadow_frame.GetVReg(inst->VRegB_22b())) >>
2248 (inst->VRegC_22b() & 0x1f));
2249 ADVANCE(2);
2250 HANDLE_INSTRUCTION_END();
2251
2252 HANDLE_INSTRUCTION_START(UNUSED_3E)
2253 UnexpectedOpcode(inst, mh);
2254 HANDLE_INSTRUCTION_END();
2255
2256 HANDLE_INSTRUCTION_START(UNUSED_3F)
2257 UnexpectedOpcode(inst, mh);
2258 HANDLE_INSTRUCTION_END();
2259
2260 HANDLE_INSTRUCTION_START(UNUSED_40)
2261 UnexpectedOpcode(inst, mh);
2262 HANDLE_INSTRUCTION_END();
2263
2264 HANDLE_INSTRUCTION_START(UNUSED_41)
2265 UnexpectedOpcode(inst, mh);
2266 HANDLE_INSTRUCTION_END();
2267
2268 HANDLE_INSTRUCTION_START(UNUSED_42)
2269 UnexpectedOpcode(inst, mh);
2270 HANDLE_INSTRUCTION_END();
2271
2272 HANDLE_INSTRUCTION_START(UNUSED_43)
2273 UnexpectedOpcode(inst, mh);
2274 HANDLE_INSTRUCTION_END();
2275
2276 HANDLE_INSTRUCTION_START(UNUSED_79)
2277 UnexpectedOpcode(inst, mh);
2278 HANDLE_INSTRUCTION_END();
2279
2280 HANDLE_INSTRUCTION_START(UNUSED_7A)
2281 UnexpectedOpcode(inst, mh);
2282 HANDLE_INSTRUCTION_END();
2283
2284 HANDLE_INSTRUCTION_START(UNUSED_EB)
2285 UnexpectedOpcode(inst, mh);
2286 HANDLE_INSTRUCTION_END();
2287
2288 HANDLE_INSTRUCTION_START(UNUSED_EC)
2289 UnexpectedOpcode(inst, mh);
2290 HANDLE_INSTRUCTION_END();
2291
2292 HANDLE_INSTRUCTION_START(UNUSED_ED)
2293 UnexpectedOpcode(inst, mh);
2294 HANDLE_INSTRUCTION_END();
2295
2296 HANDLE_INSTRUCTION_START(UNUSED_EE)
2297 UnexpectedOpcode(inst, mh);
2298 HANDLE_INSTRUCTION_END();
2299
2300 HANDLE_INSTRUCTION_START(UNUSED_EF)
2301 UnexpectedOpcode(inst, mh);
2302 HANDLE_INSTRUCTION_END();
2303
2304 HANDLE_INSTRUCTION_START(UNUSED_F0)
2305 UnexpectedOpcode(inst, mh);
2306 HANDLE_INSTRUCTION_END();
2307
2308 HANDLE_INSTRUCTION_START(UNUSED_F1)
2309 UnexpectedOpcode(inst, mh);
2310 HANDLE_INSTRUCTION_END();
2311
2312 HANDLE_INSTRUCTION_START(UNUSED_F2)
2313 UnexpectedOpcode(inst, mh);
2314 HANDLE_INSTRUCTION_END();
2315
2316 HANDLE_INSTRUCTION_START(UNUSED_F3)
2317 UnexpectedOpcode(inst, mh);
2318 HANDLE_INSTRUCTION_END();
2319
2320 HANDLE_INSTRUCTION_START(UNUSED_F4)
2321 UnexpectedOpcode(inst, mh);
2322 HANDLE_INSTRUCTION_END();
2323
2324 HANDLE_INSTRUCTION_START(UNUSED_F5)
2325 UnexpectedOpcode(inst, mh);
2326 HANDLE_INSTRUCTION_END();
2327
2328 HANDLE_INSTRUCTION_START(UNUSED_F6)
2329 UnexpectedOpcode(inst, mh);
2330 HANDLE_INSTRUCTION_END();
2331
2332 HANDLE_INSTRUCTION_START(UNUSED_F7)
2333 UnexpectedOpcode(inst, mh);
2334 HANDLE_INSTRUCTION_END();
2335
2336 HANDLE_INSTRUCTION_START(UNUSED_F8)
2337 UnexpectedOpcode(inst, mh);
2338 HANDLE_INSTRUCTION_END();
2339
2340 HANDLE_INSTRUCTION_START(UNUSED_F9)
2341 UnexpectedOpcode(inst, mh);
2342 HANDLE_INSTRUCTION_END();
2343
2344 HANDLE_INSTRUCTION_START(UNUSED_FA)
2345 UnexpectedOpcode(inst, mh);
2346 HANDLE_INSTRUCTION_END();
2347
2348 HANDLE_INSTRUCTION_START(UNUSED_FB)
2349 UnexpectedOpcode(inst, mh);
2350 HANDLE_INSTRUCTION_END();
2351
2352 HANDLE_INSTRUCTION_START(UNUSED_FC)
2353 UnexpectedOpcode(inst, mh);
2354 HANDLE_INSTRUCTION_END();
2355
2356 HANDLE_INSTRUCTION_START(UNUSED_FD)
2357 UnexpectedOpcode(inst, mh);
2358 HANDLE_INSTRUCTION_END();
2359
2360 HANDLE_INSTRUCTION_START(UNUSED_FE)
2361 UnexpectedOpcode(inst, mh);
2362 HANDLE_INSTRUCTION_END();
2363
2364 HANDLE_INSTRUCTION_START(UNUSED_FF)
2365 UnexpectedOpcode(inst, mh);
2366 HANDLE_INSTRUCTION_END();
2367
2368 exception_pending_label: {
2369 CHECK(self->IsExceptionPending());
Sebastien Hertz1eda2262013-09-09 16:53:14 +02002370 if (UNLIKELY(self->TestAllFlags())) {
2371 CheckSuspend(self);
Sebastien Hertzee1997a2013-09-19 14:47:09 +02002372 UPDATE_HANDLER_TABLE();
Sebastien Hertz1eda2262013-09-09 16:53:14 +02002373 }
Sebastien Hertz947ff082013-09-17 14:10:13 +02002374 Object* this_object = shadow_frame.GetThisObject(code_item->ins_size_);
Sebastien Hertzee1997a2013-09-19 14:47:09 +02002375 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002376 uint32_t found_dex_pc = FindNextInstructionFollowingException(self, shadow_frame, dex_pc,
Sebastien Hertz947ff082013-09-17 14:10:13 +02002377 this_object,
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002378 instrumentation);
2379 if (found_dex_pc == DexFile::kDexNoIndex) {
2380 return JValue(); /* Handled in caller. */
2381 } else {
2382 int32_t displacement = static_cast<int32_t>(found_dex_pc) - static_cast<int32_t>(dex_pc);
2383 ADVANCE(displacement);
2384 }
2385 }
2386
2387 // Create alternative instruction handlers dedicated to instrumentation.
Sebastien Hertzee1997a2013-09-19 14:47:09 +02002388#define INSTRUMENTATION_INSTRUCTION_HANDLER(o, code, n, f, r, i, a, v) \
2389 alt_op_##code: { \
2390 instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation(); \
2391 if (UNLIKELY(instrumentation->HasDexPcListeners())) { \
2392 instrumentation->DexPcMovedEvent(self, shadow_frame.GetThisObject(code_item->ins_size_), \
2393 shadow_frame.GetMethod(), dex_pc); \
2394 } \
2395 UPDATE_HANDLER_TABLE(); \
2396 goto *handlersTable[instrumentation::kMainHandlerTable][Instruction::code]; \
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002397 }
2398#include "dex_instruction_list.h"
2399 DEX_INSTRUCTION_LIST(INSTRUMENTATION_INSTRUCTION_HANDLER)
2400#undef DEX_INSTRUCTION_LIST
2401#undef INSTRUMENTATION_INSTRUCTION_HANDLER
2402} // NOLINT(readability/fn_size)
2403
2404// Explicit definitions of ExecuteGotoImpl.
Sebastien Hertzc6714852013-09-30 16:42:32 +02002405template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) HOT_ATTR
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002406JValue ExecuteGotoImpl<true, false>(Thread* self, MethodHelper& mh,
2407 const DexFile::CodeItem* code_item,
2408 ShadowFrame& shadow_frame, JValue result_register);
Sebastien Hertzc6714852013-09-30 16:42:32 +02002409template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) HOT_ATTR
Sebastien Hertzd2fe10a2014-01-15 10:20:56 +01002410JValue ExecuteGotoImpl<false, false>(Thread* self, MethodHelper& mh,
2411 const DexFile::CodeItem* code_item,
2412 ShadowFrame& shadow_frame, JValue result_register);
2413template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
2414JValue ExecuteGotoImpl<true, true>(Thread* self, MethodHelper& mh,
2415 const DexFile::CodeItem* code_item,
2416 ShadowFrame& shadow_frame, JValue result_register);
2417template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
2418JValue ExecuteGotoImpl<false, true>(Thread* self, MethodHelper& mh,
2419 const DexFile::CodeItem* code_item,
2420 ShadowFrame& shadow_frame, JValue result_register);
Sebastien Hertz8ece0502013-08-07 11:26:41 +02002421
2422} // namespace interpreter
2423} // namespace art