From 5befcb64d815614a855199e19a0236ec3a01091c Mon Sep 17 00:00:00 2001 From: Dan Bornstein Date: Wed, 1 Dec 2010 16:34:22 -0800 Subject: Rename OpCodeNames.c -> DexOpcodes.c. Change-Id: I9e22543740129f4a8fd50ff246a165d6358ed9b5 --- libdex/Android.mk | 2 +- libdex/DexOpcodes.c | 299 +++++++++++++++++++++++++++++++++++++++++++++++++++ libdex/OpCodeNames.c | 299 --------------------------------------------------- opcode-gen/regen-all | 2 +- 4 files changed, 301 insertions(+), 301 deletions(-) create mode 100644 libdex/DexOpcodes.c delete mode 100644 libdex/OpCodeNames.c diff --git a/libdex/Android.mk b/libdex/Android.mk index 2ef8371c8..281801ed9 100644 --- a/libdex/Android.mk +++ b/libdex/Android.mk @@ -22,11 +22,11 @@ dex_src_files := \ DexFile.c \ DexInlines.c \ DexOptData.c \ + DexOpcodes.c \ DexProto.c \ DexSwapVerify.c \ InstrUtils.c \ Leb128.c \ - OpCodeNames.c \ OptInvocation.c \ sha1.c \ SysUtil.c \ diff --git a/libdex/DexOpcodes.c b/libdex/DexOpcodes.c new file mode 100644 index 000000000..696b3f72c --- /dev/null +++ b/libdex/DexOpcodes.c @@ -0,0 +1,299 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Table of Dalvik opcode names. + * + * IMPORTANT NOTE: The contents of this file are mostly generated + * automatically by the opcode-gen tool. Any edits to the generated + * sections will get wiped out the next time the tool is run. + */ + +#include "DexOpcodes.h" +#include + +/* + * Dalvik opcode names. + */ +static const char* gOpNames[kNumDalvikInstructions] = { + // BEGIN(libdex-opcode-names); GENERATED AUTOMATICALLY BY opcode-gen + "nop", + "move", + "move/from16", + "move/16", + "move-wide", + "move-wide/from16", + "move-wide/16", + "move-object", + "move-object/from16", + "move-object/16", + "move-result", + "move-result-wide", + "move-result-object", + "move-exception", + "return-void", + "return", + "return-wide", + "return-object", + "const/4", + "const/16", + "const", + "const/high16", + "const-wide/16", + "const-wide/32", + "const-wide", + "const-wide/high16", + "const-string", + "const-string/jumbo", + "const-class", + "monitor-enter", + "monitor-exit", + "check-cast", + "instance-of", + "array-length", + "new-instance", + "new-array", + "filled-new-array", + "filled-new-array/range", + "fill-array-data", + "throw", + "goto", + "goto/16", + "goto/32", + "packed-switch", + "sparse-switch", + "cmpl-float", + "cmpg-float", + "cmpl-double", + "cmpg-double", + "cmp-long", + "if-eq", + "if-ne", + "if-lt", + "if-ge", + "if-gt", + "if-le", + "if-eqz", + "if-nez", + "if-ltz", + "if-gez", + "if-gtz", + "if-lez", + "unused-3e", + "unused-3f", + "unused-40", + "unused-41", + "unused-42", + "unused-43", + "aget", + "aget-wide", + "aget-object", + "aget-boolean", + "aget-byte", + "aget-char", + "aget-short", + "aput", + "aput-wide", + "aput-object", + "aput-boolean", + "aput-byte", + "aput-char", + "aput-short", + "iget", + "iget-wide", + "iget-object", + "iget-boolean", + "iget-byte", + "iget-char", + "iget-short", + "iput", + "iput-wide", + "iput-object", + "iput-boolean", + "iput-byte", + "iput-char", + "iput-short", + "sget", + "sget-wide", + "sget-object", + "sget-boolean", + "sget-byte", + "sget-char", + "sget-short", + "sput", + "sput-wide", + "sput-object", + "sput-boolean", + "sput-byte", + "sput-char", + "sput-short", + "invoke-virtual", + "invoke-super", + "invoke-direct", + "invoke-static", + "invoke-interface", + "unused-73", + "invoke-virtual/range", + "invoke-super/range", + "invoke-direct/range", + "invoke-static/range", + "invoke-interface/range", + "unused-79", + "unused-7a", + "neg-int", + "not-int", + "neg-long", + "not-long", + "neg-float", + "neg-double", + "int-to-long", + "int-to-float", + "int-to-double", + "long-to-int", + "long-to-float", + "long-to-double", + "float-to-int", + "float-to-long", + "float-to-double", + "double-to-int", + "double-to-long", + "double-to-float", + "int-to-byte", + "int-to-char", + "int-to-short", + "add-int", + "sub-int", + "mul-int", + "div-int", + "rem-int", + "and-int", + "or-int", + "xor-int", + "shl-int", + "shr-int", + "ushr-int", + "add-long", + "sub-long", + "mul-long", + "div-long", + "rem-long", + "and-long", + "or-long", + "xor-long", + "shl-long", + "shr-long", + "ushr-long", + "add-float", + "sub-float", + "mul-float", + "div-float", + "rem-float", + "add-double", + "sub-double", + "mul-double", + "div-double", + "rem-double", + "add-int/2addr", + "sub-int/2addr", + "mul-int/2addr", + "div-int/2addr", + "rem-int/2addr", + "and-int/2addr", + "or-int/2addr", + "xor-int/2addr", + "shl-int/2addr", + "shr-int/2addr", + "ushr-int/2addr", + "add-long/2addr", + "sub-long/2addr", + "mul-long/2addr", + "div-long/2addr", + "rem-long/2addr", + "and-long/2addr", + "or-long/2addr", + "xor-long/2addr", + "shl-long/2addr", + "shr-long/2addr", + "ushr-long/2addr", + "add-float/2addr", + "sub-float/2addr", + "mul-float/2addr", + "div-float/2addr", + "rem-float/2addr", + "add-double/2addr", + "sub-double/2addr", + "mul-double/2addr", + "div-double/2addr", + "rem-double/2addr", + "add-int/lit16", + "rsub-int", + "mul-int/lit16", + "div-int/lit16", + "rem-int/lit16", + "and-int/lit16", + "or-int/lit16", + "xor-int/lit16", + "add-int/lit8", + "rsub-int/lit8", + "mul-int/lit8", + "div-int/lit8", + "rem-int/lit8", + "and-int/lit8", + "or-int/lit8", + "xor-int/lit8", + "shl-int/lit8", + "shr-int/lit8", + "ushr-int/lit8", + "+iget-volatile", + "+iput-volatile", + "+sget-volatile", + "+sput-volatile", + "+iget-object-volatile", + "+iget-wide-volatile", + "+iput-wide-volatile", + "+sget-wide-volatile", + "+sput-wide-volatile", + "^breakpoint", + "^throw-verification-error", + "+execute-inline", + "+execute-inline/range", + "+invoke-direct-empty", + "+return-void-barrier", + "+iget-quick", + "+iget-wide-quick", + "+iget-object-quick", + "+iput-quick", + "+iput-wide-quick", + "+iput-object-quick", + "+invoke-virtual-quick", + "+invoke-virtual-quick/range", + "+invoke-super-quick", + "+invoke-super-quick/range", + "+iput-object-volatile", + "+sget-object-volatile", + "+sput-object-volatile", + "unused-ff", + // END(libdex-opcode-names) +}; + +/* + * Return the name of an opcode. + */ +const char* dexGetOpcodeName(OpCode op) +{ + assert(op >= 0 && op < kNumDalvikInstructions); + return gOpNames[op]; +} diff --git a/libdex/OpCodeNames.c b/libdex/OpCodeNames.c deleted file mode 100644 index 696b3f72c..000000000 --- a/libdex/OpCodeNames.c +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Table of Dalvik opcode names. - * - * IMPORTANT NOTE: The contents of this file are mostly generated - * automatically by the opcode-gen tool. Any edits to the generated - * sections will get wiped out the next time the tool is run. - */ - -#include "DexOpcodes.h" -#include - -/* - * Dalvik opcode names. - */ -static const char* gOpNames[kNumDalvikInstructions] = { - // BEGIN(libdex-opcode-names); GENERATED AUTOMATICALLY BY opcode-gen - "nop", - "move", - "move/from16", - "move/16", - "move-wide", - "move-wide/from16", - "move-wide/16", - "move-object", - "move-object/from16", - "move-object/16", - "move-result", - "move-result-wide", - "move-result-object", - "move-exception", - "return-void", - "return", - "return-wide", - "return-object", - "const/4", - "const/16", - "const", - "const/high16", - "const-wide/16", - "const-wide/32", - "const-wide", - "const-wide/high16", - "const-string", - "const-string/jumbo", - "const-class", - "monitor-enter", - "monitor-exit", - "check-cast", - "instance-of", - "array-length", - "new-instance", - "new-array", - "filled-new-array", - "filled-new-array/range", - "fill-array-data", - "throw", - "goto", - "goto/16", - "goto/32", - "packed-switch", - "sparse-switch", - "cmpl-float", - "cmpg-float", - "cmpl-double", - "cmpg-double", - "cmp-long", - "if-eq", - "if-ne", - "if-lt", - "if-ge", - "if-gt", - "if-le", - "if-eqz", - "if-nez", - "if-ltz", - "if-gez", - "if-gtz", - "if-lez", - "unused-3e", - "unused-3f", - "unused-40", - "unused-41", - "unused-42", - "unused-43", - "aget", - "aget-wide", - "aget-object", - "aget-boolean", - "aget-byte", - "aget-char", - "aget-short", - "aput", - "aput-wide", - "aput-object", - "aput-boolean", - "aput-byte", - "aput-char", - "aput-short", - "iget", - "iget-wide", - "iget-object", - "iget-boolean", - "iget-byte", - "iget-char", - "iget-short", - "iput", - "iput-wide", - "iput-object", - "iput-boolean", - "iput-byte", - "iput-char", - "iput-short", - "sget", - "sget-wide", - "sget-object", - "sget-boolean", - "sget-byte", - "sget-char", - "sget-short", - "sput", - "sput-wide", - "sput-object", - "sput-boolean", - "sput-byte", - "sput-char", - "sput-short", - "invoke-virtual", - "invoke-super", - "invoke-direct", - "invoke-static", - "invoke-interface", - "unused-73", - "invoke-virtual/range", - "invoke-super/range", - "invoke-direct/range", - "invoke-static/range", - "invoke-interface/range", - "unused-79", - "unused-7a", - "neg-int", - "not-int", - "neg-long", - "not-long", - "neg-float", - "neg-double", - "int-to-long", - "int-to-float", - "int-to-double", - "long-to-int", - "long-to-float", - "long-to-double", - "float-to-int", - "float-to-long", - "float-to-double", - "double-to-int", - "double-to-long", - "double-to-float", - "int-to-byte", - "int-to-char", - "int-to-short", - "add-int", - "sub-int", - "mul-int", - "div-int", - "rem-int", - "and-int", - "or-int", - "xor-int", - "shl-int", - "shr-int", - "ushr-int", - "add-long", - "sub-long", - "mul-long", - "div-long", - "rem-long", - "and-long", - "or-long", - "xor-long", - "shl-long", - "shr-long", - "ushr-long", - "add-float", - "sub-float", - "mul-float", - "div-float", - "rem-float", - "add-double", - "sub-double", - "mul-double", - "div-double", - "rem-double", - "add-int/2addr", - "sub-int/2addr", - "mul-int/2addr", - "div-int/2addr", - "rem-int/2addr", - "and-int/2addr", - "or-int/2addr", - "xor-int/2addr", - "shl-int/2addr", - "shr-int/2addr", - "ushr-int/2addr", - "add-long/2addr", - "sub-long/2addr", - "mul-long/2addr", - "div-long/2addr", - "rem-long/2addr", - "and-long/2addr", - "or-long/2addr", - "xor-long/2addr", - "shl-long/2addr", - "shr-long/2addr", - "ushr-long/2addr", - "add-float/2addr", - "sub-float/2addr", - "mul-float/2addr", - "div-float/2addr", - "rem-float/2addr", - "add-double/2addr", - "sub-double/2addr", - "mul-double/2addr", - "div-double/2addr", - "rem-double/2addr", - "add-int/lit16", - "rsub-int", - "mul-int/lit16", - "div-int/lit16", - "rem-int/lit16", - "and-int/lit16", - "or-int/lit16", - "xor-int/lit16", - "add-int/lit8", - "rsub-int/lit8", - "mul-int/lit8", - "div-int/lit8", - "rem-int/lit8", - "and-int/lit8", - "or-int/lit8", - "xor-int/lit8", - "shl-int/lit8", - "shr-int/lit8", - "ushr-int/lit8", - "+iget-volatile", - "+iput-volatile", - "+sget-volatile", - "+sput-volatile", - "+iget-object-volatile", - "+iget-wide-volatile", - "+iput-wide-volatile", - "+sget-wide-volatile", - "+sput-wide-volatile", - "^breakpoint", - "^throw-verification-error", - "+execute-inline", - "+execute-inline/range", - "+invoke-direct-empty", - "+return-void-barrier", - "+iget-quick", - "+iget-wide-quick", - "+iget-object-quick", - "+iput-quick", - "+iput-wide-quick", - "+iput-object-quick", - "+invoke-virtual-quick", - "+invoke-virtual-quick/range", - "+invoke-super-quick", - "+invoke-super-quick/range", - "+iput-object-volatile", - "+sget-object-volatile", - "+sput-object-volatile", - "unused-ff", - // END(libdex-opcode-names) -}; - -/* - * Return the name of an opcode. - */ -const char* dexGetOpcodeName(OpCode op) -{ - assert(op >= 0 && op < kNumDalvikInstructions); - return gOpNames[op]; -} diff --git a/opcode-gen/regen-all b/opcode-gen/regen-all index 1e77b5d5f..68a76c37d 100755 --- a/opcode-gen/regen-all +++ b/opcode-gen/regen-all @@ -37,9 +37,9 @@ cd ".." ${progdir}/opcode-gen dx/src/com/android/dx/dex/code/DalvOps.java ${progdir}/opcode-gen dx/src/com/android/dx/dex/code/Dops.java ${progdir}/opcode-gen dx/src/com/android/dx/dex/code/RopToDop.java +${progdir}/opcode-gen libdex/DexOpcodes.c ${progdir}/opcode-gen libdex/DexOpcodes.h ${progdir}/opcode-gen libdex/InstrUtils.c -${progdir}/opcode-gen libdex/OpCodeNames.c # It's a minor shame that these files live in a different top-level project. # So it goes. -- cgit v1.2.3