blob: 55f6eca3264e8dc87cc23b0c355598e3c82aab4a [file] [log] [blame]
Elliott Hughes2faa5f12012-01-30 14:42:07 -08001/*
2 * Copyright (C) 2011 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 */
Carl Shapiro12eb78e2011-06-24 14:51:06 -070016
Brian Carlstrom578bbdc2011-07-21 14:07:47 -070017#include "dex_instruction.h"
Carl Shapiro12eb78e2011-06-24 14:51:06 -070018
Ian Rogersd81871c2011-10-03 13:57:23 -070019#include "dex_file.h"
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080020#include "utils.h"
Ian Rogersd81871c2011-10-03 13:57:23 -070021#include <iomanip>
22
Carl Shapiro12eb78e2011-06-24 14:51:06 -070023namespace art {
24
Carl Shapiroe4c1ce42011-07-09 02:31:57 -070025const char* const Instruction::kInstructionNames[] = {
jeffhaoba5ebb92011-08-25 17:24:37 -070026#define INSTRUCTION_NAME(o, c, pname, f, r, i, a, v) pname,
Brian Carlstrom578bbdc2011-07-21 14:07:47 -070027#include "dex_instruction_list.h"
Carl Shapiroe4c1ce42011-07-09 02:31:57 -070028 DEX_INSTRUCTION_LIST(INSTRUCTION_NAME)
29#undef DEX_INSTRUCTION_LIST
30#undef INSTRUCTION_NAME
31};
32
Elliott Hughesadb8c672012-03-06 16:49:32 -080033Instruction::Format const Instruction::kInstructionFormats[] = {
jeffhaoba5ebb92011-08-25 17:24:37 -070034#define INSTRUCTION_FORMAT(o, c, p, format, r, i, a, v) format,
Brian Carlstrom578bbdc2011-07-21 14:07:47 -070035#include "dex_instruction_list.h"
Carl Shapiroe4c1ce42011-07-09 02:31:57 -070036 DEX_INSTRUCTION_LIST(INSTRUCTION_FORMAT)
37#undef DEX_INSTRUCTION_LIST
38#undef INSTRUCTION_FORMAT
39};
40
41int const Instruction::kInstructionFlags[] = {
jeffhaoba5ebb92011-08-25 17:24:37 -070042#define INSTRUCTION_FLAGS(o, c, p, f, r, i, flags, v) flags,
Brian Carlstrom578bbdc2011-07-21 14:07:47 -070043#include "dex_instruction_list.h"
Carl Shapiroe4c1ce42011-07-09 02:31:57 -070044 DEX_INSTRUCTION_LIST(INSTRUCTION_FLAGS)
45#undef DEX_INSTRUCTION_LIST
46#undef INSTRUCTION_FLAGS
47};
48
jeffhaoba5ebb92011-08-25 17:24:37 -070049int const Instruction::kInstructionVerifyFlags[] = {
50#define INSTRUCTION_VERIFY_FLAGS(o, c, p, f, r, i, a, vflags) vflags,
51#include "dex_instruction_list.h"
52 DEX_INSTRUCTION_LIST(INSTRUCTION_VERIFY_FLAGS)
53#undef DEX_INSTRUCTION_LIST
54#undef INSTRUCTION_VERIFY_FLAGS
55};
56
Ian Rogersa75a0132012-09-28 11:41:42 -070057int const Instruction::kInstructionSizeInCodeUnits[] = {
58#define INSTRUCTION_SIZE(opcode, c, p, format, r, i, a, v) \
59 (( opcode == NOP ) ? -1 : \
60 ((format >= k10x) && (format <= k10t)) ? 1 : \
61 ((format >= k20t) && (format <= k22c)) ? 2 : \
62 ((format >= k32x) && (format <= k3rc)) ? 3 : \
63 ( format == k51l ) ? 5 : -1 \
64 ),
65#include "dex_instruction_list.h"
66 DEX_INSTRUCTION_LIST(INSTRUCTION_SIZE)
67#undef DEX_INSTRUCTION_LIST
68#undef INSTRUCTION_SIZE
69};
70
jeffhaoba5ebb92011-08-25 17:24:37 -070071/*
72 * Handy macros for helping decode instructions.
73 */
74#define FETCH(_offset) (insns[(_offset)])
75#define FETCH_u4(_offset) (fetch_u4_impl((_offset), insns))
76#define INST_A(_insn) (((uint16_t)(_insn) >> 8) & 0x0f)
77#define INST_B(_insn) ((uint16_t)(_insn) >> 12)
78#define INST_AA(_insn) ((_insn) >> 8)
79
80/* Helper for FETCH_u4, above. */
81static inline uint32_t fetch_u4_impl(uint32_t offset, const uint16_t* insns) {
82 return insns[offset] | ((uint32_t) insns[offset+1] << 16);
83}
84
85void Instruction::Decode(uint32_t &vA, uint32_t &vB, uint64_t &vB_wide, uint32_t &vC, uint32_t arg[]) const {
86 const uint16_t* insns = reinterpret_cast<const uint16_t*>(this);
87 uint16_t insn = *insns;
Ian Rogersa75a0132012-09-28 11:41:42 -070088 Code opcode = static_cast<Code>(insn & 0xFF);
jeffhaoba5ebb92011-08-25 17:24:37 -070089
Ian Rogersa75a0132012-09-28 11:41:42 -070090 switch (FormatOf(opcode)) {
jeffhaoba5ebb92011-08-25 17:24:37 -070091 case k10x: // op
92 /* nothing to do; copy the AA bits out for the verifier */
93 vA = INST_AA(insn);
94 break;
95 case k12x: // op vA, vB
96 vA = INST_A(insn);
97 vB = INST_B(insn);
98 break;
99 case k11n: // op vA, #+B
100 vA = INST_A(insn);
101 vB = (int32_t) (INST_B(insn) << 28) >> 28; // sign extend 4-bit value
102 break;
103 case k11x: // op vAA
104 vA = INST_AA(insn);
105 break;
106 case k10t: // op +AA
107 vA = (int8_t) INST_AA(insn); // sign-extend 8-bit value
108 break;
109 case k20t: // op +AAAA
110 vA = (int16_t) FETCH(1); // sign-extend 16-bit value
111 break;
112 case k21c: // op vAA, thing@BBBB
113 case k22x: // op vAA, vBBBB
114 vA = INST_AA(insn);
115 vB = FETCH(1);
116 break;
117 case k21s: // op vAA, #+BBBB
118 case k21t: // op vAA, +BBBB
119 vA = INST_AA(insn);
120 vB = (int16_t) FETCH(1); // sign-extend 16-bit value
121 break;
122 case k21h: // op vAA, #+BBBB0000[00000000]
123 vA = INST_AA(insn);
124 /*
125 * The value should be treated as right-zero-extended, but we don't
126 * actually do that here. Among other things, we don't know if it's
127 * the top bits of a 32- or 64-bit value.
128 */
129 vB = FETCH(1);
130 break;
131 case k23x: // op vAA, vBB, vCC
132 vA = INST_AA(insn);
133 vB = FETCH(1) & 0xff;
134 vC = FETCH(1) >> 8;
135 break;
136 case k22b: // op vAA, vBB, #+CC
137 vA = INST_AA(insn);
138 vB = FETCH(1) & 0xff;
139 vC = (int8_t) (FETCH(1) >> 8); // sign-extend 8-bit value
140 break;
141 case k22s: // op vA, vB, #+CCCC
142 case k22t: // op vA, vB, +CCCC
143 vA = INST_A(insn);
144 vB = INST_B(insn);
145 vC = (int16_t) FETCH(1); // sign-extend 16-bit value
146 break;
147 case k22c: // op vA, vB, thing@CCCC
148 vA = INST_A(insn);
149 vB = INST_B(insn);
150 vC = FETCH(1);
151 break;
152 case k30t: // op +AAAAAAAA
153 vA = FETCH_u4(1); // signed 32-bit value
154 break;
155 case k31t: // op vAA, +BBBBBBBB
156 case k31c: // op vAA, string@BBBBBBBB
157 vA = INST_AA(insn);
158 vB = FETCH_u4(1); // 32-bit value
159 break;
160 case k32x: // op vAAAA, vBBBB
161 vA = FETCH(1);
162 vB = FETCH(2);
163 break;
164 case k31i: // op vAA, #+BBBBBBBB
165 vA = INST_AA(insn);
166 vB = FETCH_u4(1); // signed 32-bit value
167 break;
168 case k35c: // op {vC, vD, vE, vF, vG}, thing@BBBB
169 {
170 /*
171 * Note that the fields mentioned in the spec don't appear in
172 * their "usual" positions here compared to most formats. This
173 * was done so that the field names for the argument count and
174 * reference index match between this format and the corresponding
175 * range formats (3rc and friends).
176 *
177 * Bottom line: The argument count is always in vA, and the
178 * method constant (or equivalent) is always in vB.
179 */
180 uint16_t regList;
181 int count;
182
183 vA = INST_B(insn); // This is labeled A in the spec.
184 vB = FETCH(1);
185 regList = FETCH(2);
186
187 count = vA;
188
189 /*
190 * Copy the argument registers into the arg[] array, and
191 * also copy the first argument (if any) into vC. (The
192 * DecodedInstruction structure doesn't have separate
193 * fields for {vD, vE, vF, vG}, so there's no need to make
194 * copies of those.) Note that cases 5..2 fall through.
195 */
196 switch (count) {
197 case 5: arg[4] = INST_A(insn);
198 case 4: arg[3] = (regList >> 12) & 0x0f;
199 case 3: arg[2] = (regList >> 8) & 0x0f;
200 case 2: arg[1] = (regList >> 4) & 0x0f;
201 case 1: vC = arg[0] = regList & 0x0f; break;
202 case 0: break; // Valid, but no need to do anything.
203 default:
204 LOG(ERROR) << "Invalid arg count in 35c (" << count << ")";
205 return;
206 }
207 }
208 break;
209 case k3rc: // op {vCCCC .. v(CCCC+AA-1)}, meth@BBBB
210 vA = INST_AA(insn);
211 vB = FETCH(1);
212 vC = FETCH(2);
213 break;
214 case k51l: // op vAA, #+BBBBBBBBBBBBBBBB
215 vA = INST_AA(insn);
216 vB_wide = FETCH_u4(1) | ((uint64_t) FETCH_u4(3) << 32);
217 break;
218 default:
Ian Rogersa75a0132012-09-28 11:41:42 -0700219 LOG(ERROR) << "Can't decode unexpected format " << FormatOf(opcode) << " (op=" << opcode << ")";
jeffhaoba5ebb92011-08-25 17:24:37 -0700220 return;
221 }
222}
223
Ian Rogersa75a0132012-09-28 11:41:42 -0700224size_t Instruction::SizeInCodeUnitsComplexOpcode() const {
Carl Shapiro12eb78e2011-06-24 14:51:06 -0700225 const uint16_t* insns = reinterpret_cast<const uint16_t*>(this);
Ian Rogersa75a0132012-09-28 11:41:42 -0700226 // Handle special NOP encoded variable length sequences.
227 switch (*insns) {
228 case kPackedSwitchSignature:
229 return (4 + insns[1] * 2);
230 case kSparseSwitchSignature:
231 return (2 + insns[1] * 4);
232 case kArrayDataSignature: {
233 uint16_t element_size = insns[1];
234 uint32_t length = insns[2] | (((uint32_t)insns[3]) << 16);
235 // The plus 1 is to round up for odd size and width.
236 return (4 + (element_size * length + 1) / 2);
Carl Shapiroe4c1ce42011-07-09 02:31:57 -0700237 }
Ian Rogersa75a0132012-09-28 11:41:42 -0700238 default:
239 if ((*insns & 0xFF) == 0) {
240 return 1; // NOP.
241 } else {
242 LOG(FATAL) << "Unreachable: " << DumpString(NULL);
243 return 0;
244 }
Carl Shapiroe4c1ce42011-07-09 02:31:57 -0700245 }
Ian Rogersd81871c2011-10-03 13:57:23 -0700246}
247
Ian Rogers2c8a8572011-10-24 17:11:36 -0700248std::string Instruction::DumpHex(size_t code_units) const {
Ian Rogersd81871c2011-10-03 13:57:23 -0700249 size_t inst_length = SizeInCodeUnits();
250 if (inst_length > code_units) {
251 inst_length = code_units;
252 }
Ian Rogers2c8a8572011-10-24 17:11:36 -0700253 std::ostringstream os;
Ian Rogersd81871c2011-10-03 13:57:23 -0700254 const uint16_t* insn = reinterpret_cast<const uint16_t*>(this);
255 for (size_t i = 0; i < inst_length; i++) {
Ian Rogers2c8a8572011-10-24 17:11:36 -0700256 os << StringPrintf("0x%04x", insn[i]) << " ";
Ian Rogersd81871c2011-10-03 13:57:23 -0700257 }
258 for (size_t i = inst_length; i < code_units; i++) {
259 os << " ";
260 }
Ian Rogers2c8a8572011-10-24 17:11:36 -0700261 return os.str();
Ian Rogersd81871c2011-10-03 13:57:23 -0700262}
263
Ian Rogers2c8a8572011-10-24 17:11:36 -0700264std::string Instruction::DumpString(const DexFile* file) const {
Ian Rogersd81871c2011-10-03 13:57:23 -0700265 DecodedInstruction insn(this);
Ian Rogers2c8a8572011-10-24 17:11:36 -0700266 std::ostringstream os;
Elliott Hughesadb8c672012-03-06 16:49:32 -0800267 const char* opcode = kInstructionNames[insn.opcode];
268 switch (FormatOf(Opcode())) {
Elliott Hughese3c845c2012-02-28 17:23:01 -0800269 case k10x: os << opcode; break;
Elliott Hughesadb8c672012-03-06 16:49:32 -0800270 case k12x: os << StringPrintf("%s v%d, v%d", opcode, insn.vA, insn.vB); break;
271 case k11n: os << StringPrintf("%s v%d, #%+d", opcode, insn.vA, insn.vB); break;
272 case k11x: os << StringPrintf("%s v%d", opcode, insn.vA); break;
273 case k10t: os << StringPrintf("%s %+d", opcode, insn.vA); break;
Elliott Hughesadb8c672012-03-06 16:49:32 -0800274 case k20t: os << StringPrintf("%s %+d", opcode, insn.vA); break;
275 case k22x: os << StringPrintf("%s v%d, v%d", opcode, insn.vA, insn.vB); break;
276 case k21t: os << StringPrintf("%s v%d, %+d", opcode, insn.vA, insn.vB); break;
277 case k21s: os << StringPrintf("%s v%d, #%+d", opcode, insn.vA, insn.vB); break;
Elliott Hughes1b3d6ca2012-04-25 13:00:14 -0700278 case k21h: {
279 // op vAA, #+BBBB0000[00000000]
280 if (insn.opcode == CONST_HIGH16) {
281 uint32_t value = insn.vB << 16;
282 os << StringPrintf("%s v%d, #int %+d // 0x%x", opcode, insn.vA, value, value);
283 } else {
284 uint64_t value = static_cast<uint64_t>(insn.vB) << 48;
285 os << StringPrintf("%s v%d, #long %+lld // 0x%llx", opcode, insn.vA, value, value);
286 }
287 }
288 break;
Ian Rogers90334e52012-06-06 20:22:20 -0700289 case k21c: {
290 switch (insn.opcode) {
Ian Rogers90334e52012-06-06 20:22:20 -0700291 case CONST_STRING:
292 if (file != NULL) {
Ian Rogers2bcb4a42012-11-08 10:39:18 -0800293 os << StringPrintf("const-string v%d, %s // string@%d", insn.vA,
294 PrintableString(file->StringDataByIdx(insn.vB)).c_str(), insn.vB);
Ian Rogers90334e52012-06-06 20:22:20 -0700295 break;
296 } // else fall-through
Mathieu Chartier18c24b62012-09-10 08:54:25 -0700297 case CHECK_CAST:
298 case CONST_CLASS:
Ian Rogers90334e52012-06-06 20:22:20 -0700299 case NEW_INSTANCE:
300 if (file != NULL) {
Ian Rogers5a723352012-10-12 00:07:22 -0700301 os << opcode << " v" << insn.vA << ", " << PrettyType(insn.vB, *file)
302 << " // type@" << insn.vB;
Ian Rogers90334e52012-06-06 20:22:20 -0700303 break;
304 } // else fall-through
305 case SGET:
306 case SGET_WIDE:
307 case SGET_OBJECT:
308 case SGET_BOOLEAN:
309 case SGET_BYTE:
310 case SGET_CHAR:
311 case SGET_SHORT:
312 if (file != NULL) {
Ian Rogers5a723352012-10-12 00:07:22 -0700313 os << opcode << " v" << insn.vA << ", " << PrettyField(insn.vB, *file, true)
314 << " // field@" << insn.vB;
Ian Rogers90334e52012-06-06 20:22:20 -0700315 break;
316 } // else fall-through
317 case SPUT:
318 case SPUT_WIDE:
319 case SPUT_OBJECT:
320 case SPUT_BOOLEAN:
321 case SPUT_BYTE:
322 case SPUT_CHAR:
323 case SPUT_SHORT:
324 if (file != NULL) {
Ian Rogers5a723352012-10-12 00:07:22 -0700325 os << opcode << " v" << insn.vA << ", " << PrettyField(insn.vB, *file, true)
326 << " // field@" << insn.vB;
Ian Rogers90334e52012-06-06 20:22:20 -0700327 break;
328 } // else fall-through
329 default:
330 os << StringPrintf("%s v%d, thing@%d", opcode, insn.vA, insn.vB);
331 break;
332 }
333 break;
334 }
Elliott Hughesadb8c672012-03-06 16:49:32 -0800335 case k23x: os << StringPrintf("%s v%d, v%d, v%d", opcode, insn.vA, insn.vB, insn.vC); break;
336 case k22b: os << StringPrintf("%s v%d, v%d, #%+d", opcode, insn.vA, insn.vB, insn.vC); break;
337 case k22t: os << StringPrintf("%s v%d, v%d, %+d", opcode, insn.vA, insn.vB, insn.vC); break;
338 case k22s: os << StringPrintf("%s v%d, v%d, #%+d", opcode, insn.vA, insn.vB, insn.vC); break;
Ian Rogers90334e52012-06-06 20:22:20 -0700339 case k22c: {
340 switch (insn.opcode) {
341 case IGET:
342 case IGET_WIDE:
343 case IGET_OBJECT:
344 case IGET_BOOLEAN:
345 case IGET_BYTE:
346 case IGET_CHAR:
347 case IGET_SHORT:
348 if (file != NULL) {
Ian Rogers5a723352012-10-12 00:07:22 -0700349 os << opcode << " v" << insn.vA << ", v" << insn.vB << ", "
350 << PrettyField(insn.vC, *file, true) << " // field@" << insn.vC;
Ian Rogers90334e52012-06-06 20:22:20 -0700351 break;
352 } // else fall-through
353 case IPUT:
354 case IPUT_WIDE:
355 case IPUT_OBJECT:
356 case IPUT_BOOLEAN:
357 case IPUT_BYTE:
358 case IPUT_CHAR:
359 case IPUT_SHORT:
360 if (file != NULL) {
Ian Rogers5a723352012-10-12 00:07:22 -0700361 os << opcode << " v" << insn.vA << ", v" << insn.vB << ", "
362 << PrettyField(insn.vC, *file, true) << " // field@" << insn.vC;
Ian Rogers90334e52012-06-06 20:22:20 -0700363 break;
364 } // else fall-through
365 case INSTANCE_OF:
366 if (file != NULL) {
Ian Rogers5a723352012-10-12 00:07:22 -0700367 os << opcode << " v" << insn.vA << ", v" << insn.vB << ", "
368 << PrettyType(insn.vC, *file) << " // type@" << insn.vC;
Mathieu Chartier18c24b62012-09-10 08:54:25 -0700369 break;
370 }
371 case NEW_ARRAY:
372 if (file != NULL) {
Ian Rogers5a723352012-10-12 00:07:22 -0700373 os << opcode << " v" << insn.vA << ", v" << insn.vB << ", "
374 << PrettyType(insn.vC, *file) << " // type@" << insn.vC;
Ian Rogers90334e52012-06-06 20:22:20 -0700375 break;
376 } // else fall-through
377 default:
378 os << StringPrintf("%s v%d, v%d, thing@%d", opcode, insn.vA, insn.vB, insn.vC);
379 break;
380 }
381 break;
382 }
Elliott Hughesadb8c672012-03-06 16:49:32 -0800383 case k32x: os << StringPrintf("%s v%d, v%d", opcode, insn.vA, insn.vB); break;
384 case k30t: os << StringPrintf("%s %+d", opcode, insn.vA); break;
385 case k31t: os << StringPrintf("%s v%d, %+d", opcode, insn.vA, insn.vB); break;
386 case k31i: os << StringPrintf("%s v%d, #%+d", opcode, insn.vA, insn.vB); break;
387 case k31c: os << StringPrintf("%s v%d, thing@%d", opcode, insn.vA, insn.vB); break;
Ian Rogersd81871c2011-10-03 13:57:23 -0700388 case k35c: {
Elliott Hughesadb8c672012-03-06 16:49:32 -0800389 switch (insn.opcode) {
Ian Rogersd81871c2011-10-03 13:57:23 -0700390 case INVOKE_VIRTUAL:
391 case INVOKE_SUPER:
392 case INVOKE_DIRECT:
393 case INVOKE_STATIC:
394 case INVOKE_INTERFACE:
395 if (file != NULL) {
Elliott Hughese3c845c2012-02-28 17:23:01 -0800396 os << opcode << " {";
Elliott Hughesadb8c672012-03-06 16:49:32 -0800397 for (size_t i = 0; i < insn.vA; ++i) {
Elliott Hughese3c845c2012-02-28 17:23:01 -0800398 if (i != 0) {
399 os << ", ";
400 }
Elliott Hughesadb8c672012-03-06 16:49:32 -0800401 os << "v" << insn.arg[i];
Elliott Hughese3c845c2012-02-28 17:23:01 -0800402 }
Ian Rogers4c5dd5a2012-09-07 11:27:28 -0700403 os << "}, " << PrettyMethod(insn.vB, *file) << " // method@" << insn.vB;
Ian Rogersd81871c2011-10-03 13:57:23 -0700404 break;
405 } // else fall-through
406 default:
Elliott Hughesadb8c672012-03-06 16:49:32 -0800407 os << opcode << " {v" << insn.arg[0] << ", v" << insn.arg[1] << ", v" << insn.arg[2]
408 << ", v" << insn.arg[3] << ", v" << insn.arg[4] << "}, thing@" << insn.vB;
Ian Rogersd81871c2011-10-03 13:57:23 -0700409 break;
410 }
411 break;
412 }
Ian Rogers4c5dd5a2012-09-07 11:27:28 -0700413 case k3rc: {
414 switch (insn.opcode) {
415 case INVOKE_VIRTUAL_RANGE:
416 case INVOKE_SUPER_RANGE:
417 case INVOKE_DIRECT_RANGE:
418 case INVOKE_STATIC_RANGE:
419 case INVOKE_INTERFACE_RANGE:
420 if (file != NULL) {
421 os << StringPrintf("%s, {v%d .. v%d}, ", opcode, insn.vC, (insn.vC + insn.vA - 1))
422 << PrettyMethod(insn.vB, *file) << " // method@" << insn.vB;
423 break;
424 } // else fall-through
425 default:
426 os << StringPrintf("%s, {v%d .. v%d}, thing@%d", opcode, insn.vC, (insn.vC + insn.vA - 1),
427 insn.vB);
428 break;
429 }
430 break;
431 }
Elliott Hughesadb8c672012-03-06 16:49:32 -0800432 case k51l: os << StringPrintf("%s v%d, #%+d", opcode, insn.vA, insn.vB); break;
Ian Rogers2c8a8572011-10-24 17:11:36 -0700433 default: os << " unknown format (" << DumpHex(5) << ")"; break;
Ian Rogersd81871c2011-10-03 13:57:23 -0700434 }
Ian Rogers2c8a8572011-10-24 17:11:36 -0700435 return os.str();
Carl Shapiro12eb78e2011-06-24 14:51:06 -0700436}
437
Ian Rogersa75a0132012-09-28 11:41:42 -0700438std::ostream& operator<<(std::ostream& os, const Instruction::Code& code) {
439 return os << Instruction::Name(code);
Elliott Hughesadb8c672012-03-06 16:49:32 -0800440}
441
Carl Shapiro12eb78e2011-06-24 14:51:06 -0700442} // namespace art