The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 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 | */ |
Andy McFadden | c6b25c7 | 2010-06-22 11:01:20 -0700 | [diff] [blame] | 16 | |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 17 | /* |
| 18 | * Table of Dalvik opcode names. |
Dan Bornstein | d03baaf | 2010-11-16 15:54:10 -0800 | [diff] [blame] | 19 | * |
| 20 | * IMPORTANT NOTE: The contents of this file are mostly generated |
| 21 | * automatically by the opcode-gen tool. Any edits to the generated |
| 22 | * sections will get wiped out the next time the tool is run. |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 23 | */ |
Dan Bornstein | d03baaf | 2010-11-16 15:54:10 -0800 | [diff] [blame] | 24 | |
Dan Bornstein | df4daaf | 2010-12-01 14:23:44 -0800 | [diff] [blame] | 25 | #include "DexOpcodes.h" |
Andy McFadden | c6b25c7 | 2010-06-22 11:01:20 -0700 | [diff] [blame] | 26 | #include <assert.h> |
| 27 | |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 28 | /* |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 29 | * Dalvik opcode names. |
| 30 | */ |
Dan Bornstein | ccaab18 | 2010-12-03 15:32:40 -0800 | [diff] [blame] | 31 | static const char* gOpNames[kNumPackedOpcodes] = { |
Dan Bornstein | d03baaf | 2010-11-16 15:54:10 -0800 | [diff] [blame] | 32 | // BEGIN(libdex-opcode-names); GENERATED AUTOMATICALLY BY opcode-gen |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 33 | "nop", |
| 34 | "move", |
| 35 | "move/from16", |
| 36 | "move/16", |
| 37 | "move-wide", |
| 38 | "move-wide/from16", |
| 39 | "move-wide/16", |
| 40 | "move-object", |
| 41 | "move-object/from16", |
| 42 | "move-object/16", |
| 43 | "move-result", |
| 44 | "move-result-wide", |
| 45 | "move-result-object", |
| 46 | "move-exception", |
| 47 | "return-void", |
| 48 | "return", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 49 | "return-wide", |
| 50 | "return-object", |
| 51 | "const/4", |
| 52 | "const/16", |
| 53 | "const", |
| 54 | "const/high16", |
| 55 | "const-wide/16", |
| 56 | "const-wide/32", |
| 57 | "const-wide", |
| 58 | "const-wide/high16", |
| 59 | "const-string", |
| 60 | "const-string/jumbo", |
| 61 | "const-class", |
| 62 | "monitor-enter", |
| 63 | "monitor-exit", |
| 64 | "check-cast", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 65 | "instance-of", |
| 66 | "array-length", |
| 67 | "new-instance", |
| 68 | "new-array", |
| 69 | "filled-new-array", |
| 70 | "filled-new-array/range", |
| 71 | "fill-array-data", |
| 72 | "throw", |
| 73 | "goto", |
| 74 | "goto/16", |
| 75 | "goto/32", |
| 76 | "packed-switch", |
| 77 | "sparse-switch", |
| 78 | "cmpl-float", |
| 79 | "cmpg-float", |
| 80 | "cmpl-double", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 81 | "cmpg-double", |
| 82 | "cmp-long", |
| 83 | "if-eq", |
| 84 | "if-ne", |
| 85 | "if-lt", |
| 86 | "if-ge", |
| 87 | "if-gt", |
| 88 | "if-le", |
| 89 | "if-eqz", |
| 90 | "if-nez", |
| 91 | "if-ltz", |
| 92 | "if-gez", |
| 93 | "if-gtz", |
| 94 | "if-lez", |
Dan Bornstein | d03baaf | 2010-11-16 15:54:10 -0800 | [diff] [blame] | 95 | "unused-3e", |
| 96 | "unused-3f", |
| 97 | "unused-40", |
| 98 | "unused-41", |
| 99 | "unused-42", |
| 100 | "unused-43", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 101 | "aget", |
| 102 | "aget-wide", |
| 103 | "aget-object", |
| 104 | "aget-boolean", |
| 105 | "aget-byte", |
| 106 | "aget-char", |
| 107 | "aget-short", |
| 108 | "aput", |
| 109 | "aput-wide", |
| 110 | "aput-object", |
| 111 | "aput-boolean", |
| 112 | "aput-byte", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 113 | "aput-char", |
| 114 | "aput-short", |
| 115 | "iget", |
| 116 | "iget-wide", |
| 117 | "iget-object", |
| 118 | "iget-boolean", |
| 119 | "iget-byte", |
| 120 | "iget-char", |
| 121 | "iget-short", |
| 122 | "iput", |
| 123 | "iput-wide", |
| 124 | "iput-object", |
| 125 | "iput-boolean", |
| 126 | "iput-byte", |
| 127 | "iput-char", |
| 128 | "iput-short", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 129 | "sget", |
| 130 | "sget-wide", |
| 131 | "sget-object", |
| 132 | "sget-boolean", |
| 133 | "sget-byte", |
| 134 | "sget-char", |
| 135 | "sget-short", |
| 136 | "sput", |
| 137 | "sput-wide", |
| 138 | "sput-object", |
| 139 | "sput-boolean", |
| 140 | "sput-byte", |
| 141 | "sput-char", |
| 142 | "sput-short", |
| 143 | "invoke-virtual", |
| 144 | "invoke-super", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 145 | "invoke-direct", |
| 146 | "invoke-static", |
| 147 | "invoke-interface", |
Dan Bornstein | d03baaf | 2010-11-16 15:54:10 -0800 | [diff] [blame] | 148 | "unused-73", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 149 | "invoke-virtual/range", |
| 150 | "invoke-super/range", |
| 151 | "invoke-direct/range", |
| 152 | "invoke-static/range", |
| 153 | "invoke-interface/range", |
Dan Bornstein | d03baaf | 2010-11-16 15:54:10 -0800 | [diff] [blame] | 154 | "unused-79", |
| 155 | "unused-7a", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 156 | "neg-int", |
| 157 | "not-int", |
| 158 | "neg-long", |
| 159 | "not-long", |
| 160 | "neg-float", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 161 | "neg-double", |
| 162 | "int-to-long", |
| 163 | "int-to-float", |
| 164 | "int-to-double", |
| 165 | "long-to-int", |
| 166 | "long-to-float", |
| 167 | "long-to-double", |
| 168 | "float-to-int", |
| 169 | "float-to-long", |
| 170 | "float-to-double", |
| 171 | "double-to-int", |
| 172 | "double-to-long", |
| 173 | "double-to-float", |
| 174 | "int-to-byte", |
| 175 | "int-to-char", |
| 176 | "int-to-short", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 177 | "add-int", |
| 178 | "sub-int", |
| 179 | "mul-int", |
| 180 | "div-int", |
| 181 | "rem-int", |
| 182 | "and-int", |
| 183 | "or-int", |
| 184 | "xor-int", |
| 185 | "shl-int", |
| 186 | "shr-int", |
| 187 | "ushr-int", |
| 188 | "add-long", |
| 189 | "sub-long", |
| 190 | "mul-long", |
| 191 | "div-long", |
| 192 | "rem-long", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 193 | "and-long", |
| 194 | "or-long", |
| 195 | "xor-long", |
| 196 | "shl-long", |
| 197 | "shr-long", |
| 198 | "ushr-long", |
| 199 | "add-float", |
| 200 | "sub-float", |
| 201 | "mul-float", |
| 202 | "div-float", |
| 203 | "rem-float", |
| 204 | "add-double", |
| 205 | "sub-double", |
| 206 | "mul-double", |
| 207 | "div-double", |
| 208 | "rem-double", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 209 | "add-int/2addr", |
| 210 | "sub-int/2addr", |
| 211 | "mul-int/2addr", |
| 212 | "div-int/2addr", |
| 213 | "rem-int/2addr", |
| 214 | "and-int/2addr", |
| 215 | "or-int/2addr", |
| 216 | "xor-int/2addr", |
| 217 | "shl-int/2addr", |
| 218 | "shr-int/2addr", |
| 219 | "ushr-int/2addr", |
| 220 | "add-long/2addr", |
| 221 | "sub-long/2addr", |
| 222 | "mul-long/2addr", |
| 223 | "div-long/2addr", |
| 224 | "rem-long/2addr", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 225 | "and-long/2addr", |
| 226 | "or-long/2addr", |
| 227 | "xor-long/2addr", |
| 228 | "shl-long/2addr", |
| 229 | "shr-long/2addr", |
| 230 | "ushr-long/2addr", |
| 231 | "add-float/2addr", |
| 232 | "sub-float/2addr", |
| 233 | "mul-float/2addr", |
| 234 | "div-float/2addr", |
| 235 | "rem-float/2addr", |
| 236 | "add-double/2addr", |
| 237 | "sub-double/2addr", |
| 238 | "mul-double/2addr", |
| 239 | "div-double/2addr", |
| 240 | "rem-double/2addr", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 241 | "add-int/lit16", |
| 242 | "rsub-int", |
| 243 | "mul-int/lit16", |
| 244 | "div-int/lit16", |
| 245 | "rem-int/lit16", |
| 246 | "and-int/lit16", |
| 247 | "or-int/lit16", |
| 248 | "xor-int/lit16", |
| 249 | "add-int/lit8", |
| 250 | "rsub-int/lit8", |
| 251 | "mul-int/lit8", |
| 252 | "div-int/lit8", |
| 253 | "rem-int/lit8", |
| 254 | "and-int/lit8", |
| 255 | "or-int/lit8", |
| 256 | "xor-int/lit8", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 257 | "shl-int/lit8", |
| 258 | "shr-int/lit8", |
| 259 | "ushr-int/lit8", |
Andy McFadden | c35a2ef | 2010-06-17 12:36:00 -0700 | [diff] [blame] | 260 | "+iget-volatile", |
| 261 | "+iput-volatile", |
| 262 | "+sget-volatile", |
| 263 | "+sput-volatile", |
| 264 | "+iget-object-volatile", |
Andy McFadden | 5387824 | 2010-03-05 07:24:27 -0800 | [diff] [blame] | 265 | "+iget-wide-volatile", |
| 266 | "+iput-wide-volatile", |
| 267 | "+sget-wide-volatile", |
| 268 | "+sput-wide-volatile", |
Dan Bornstein | d03baaf | 2010-11-16 15:54:10 -0800 | [diff] [blame] | 269 | "^breakpoint", |
| 270 | "^throw-verification-error", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 271 | "+execute-inline", |
Andy McFadden | b0a0541 | 2009-11-19 10:23:41 -0800 | [diff] [blame] | 272 | "+execute-inline/range", |
Andy McFadden | 0346e9d | 2011-03-01 15:47:46 -0800 | [diff] [blame] | 273 | "+invoke-object-init/range", |
Andy McFadden | 291758c | 2010-09-10 08:04:52 -0700 | [diff] [blame] | 274 | "+return-void-barrier", |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 275 | "+iget-quick", |
| 276 | "+iget-wide-quick", |
| 277 | "+iget-object-quick", |
| 278 | "+iput-quick", |
| 279 | "+iput-wide-quick", |
| 280 | "+iput-object-quick", |
| 281 | "+invoke-virtual-quick", |
| 282 | "+invoke-virtual-quick/range", |
| 283 | "+invoke-super-quick", |
| 284 | "+invoke-super-quick/range", |
Andy McFadden | c35a2ef | 2010-06-17 12:36:00 -0700 | [diff] [blame] | 285 | "+iput-object-volatile", |
| 286 | "+sget-object-volatile", |
| 287 | "+sput-object-volatile", |
Elliott Hughes | ab35b50 | 2012-01-04 15:38:58 -0800 | [diff] [blame] | 288 | "unused-ff", |
Dan Bornstein | d03baaf | 2010-11-16 15:54:10 -0800 | [diff] [blame] | 289 | // END(libdex-opcode-names) |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 290 | }; |
| 291 | |
| 292 | /* |
| 293 | * Return the name of an opcode. |
| 294 | */ |
Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 295 | const char* dexGetOpcodeName(Opcode op) |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 296 | { |
Dan Bornstein | ccaab18 | 2010-12-03 15:32:40 -0800 | [diff] [blame] | 297 | assert(op >= 0 && op < kNumPackedOpcodes); |
The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 298 | return gOpNames[op]; |
| 299 | } |