diff options
| author | Dan Bornstein <danfuzz@android.com> | 2010-11-12 17:47:43 -0800 |
|---|---|---|
| committer | Dan Bornstein <danfuzz@android.com> | 2010-11-12 17:47:43 -0800 |
| commit | a1d6b0ea1a367188fceb7df60bf7f7cd41548898 (patch) | |
| tree | 3b6c84fa4d09e827c787e0c77bddd668d41108d5 | |
| parent | c2b486fe6e49555c3a5df0702d04c20b6d6a33c4 (diff) | |
| download | android_dalvik-a1d6b0ea1a367188fceb7df60bf7f7cd41548898.tar.gz android_dalvik-a1d6b0ea1a367188fceb7df60bf7f7cd41548898.tar.bz2 android_dalvik-a1d6b0ea1a367188fceb7df60bf7f7cd41548898.zip | |
Add all the optimized / runtime-only opcodes.
With this patch, the opcodes all have lines in bytecode.txt, but
it's still the case that nothing is being done to use the info in the
vm.
Change-Id: Icf25e0b3b5328bc4c034602fb1ec21741f86c6d5
| -rw-r--r-- | dx/etc/bytecode.txt | 561 | ||||
| -rwxr-xr-x | dx/etc/opcode-gen | 13 | ||||
| -rwxr-xr-x | dx/etc/run-opcode-gen | 5 |
3 files changed, 314 insertions, 265 deletions
diff --git a/dx/etc/bytecode.txt b/dx/etc/bytecode.txt index ce68f588d..1dfd9f16f 100644 --- a/dx/etc/bytecode.txt +++ b/dx/etc/bytecode.txt @@ -27,6 +27,7 @@ # opcodes effectively take three, with a destination and two sources # where the destination and one of the sources have to be the same. +# Regular formats format 10t 20t 30t format 10x format 11n 21s 21h 31i 51l @@ -39,6 +40,15 @@ format 22c 52c format 22t format 35c 3rc 5rc +# Optimized formats +format 00x # not in spec; used for breakpoint +format 20bc # not in spec; used for throw-verification-error +format 22cs +format 35mi +format 35ms +format 3rmi +format 3rms + # One line per opcode. Columns are: # hex for opcode # opcode name @@ -65,265 +75,300 @@ format 35c 3rc 5rc # return -- is a return from method # invoke -- is a method invoke -op 00 nop 10x n none continue -op 01 move 12x y none continue -op 02 move/from16 22x y none continue -op 03 move/16 32x y none continue -op 04 move-wide 12x y none continue -op 05 move-wide/from16 22x y none continue -op 06 move-wide/16 32x y none continue -op 07 move-object 12x y none continue -op 08 move-object/from16 22x y none continue -op 09 move-object/16 32x y none continue -op 0a move-result 11x y none continue -op 0b move-result-wide 11x y none continue -op 0c move-result-object 11x y none continue -op 0d move-exception 11x y none continue -op 0e return-void 10x n none return -op 0f return 11x n none return -op 10 return-wide 11x n none return -op 11 return-object 11x n none return -op 12 const/4 11n y none continue -op 13 const/16 21s y none continue -op 14 const 31i y none continue -op 15 const/high16 21h y none continue -op 16 const-wide/16 21s y none continue -op 17 const-wide/32 31i y none continue -op 18 const-wide 51l y none continue -op 19 const-wide/high16 21h y none continue -op 1a const-string 21c y string-ref continue|throw -op 1b const-string/jumbo 31c y string-ref continue|throw -op 1c const-class 21c y type-ref continue|throw -op 1d monitor-enter 11x n none continue|throw -op 1e monitor-exit 11x n none continue|throw -op 1f check-cast 21c y type-ref continue|throw -op 20 instance-of 22c y type-ref continue|throw -op 21 array-length 12x y none continue|throw -op 22 new-instance 21c y type-ref continue|throw -op 23 new-array 22c y type-ref continue|throw -op 24 filled-new-array 35c n type-ref continue|throw -op 25 filled-new-array/range 3rc n type-ref continue|throw -op 26 fill-array-data 31t n none continue -op 27 throw 11x n none throw -op 28 goto 10t n none branch -op 29 goto/16 20t n none branch -op 2a goto/32 30t n none branch -op 2b packed-switch 31t n none continue|switch -op 2c sparse-switch 31t n none continue|switch -op 2d cmpl-float 23x y none continue -op 2e cmpg-float 23x y none continue -op 2f cmpl-double 23x y none continue -op 30 cmpg-double 23x y none continue -op 31 cmp-long 23x y none continue -op 32 if-eq 22t n none continue|branch -op 33 if-ne 22t n none continue|branch -op 34 if-lt 22t n none continue|branch -op 35 if-ge 22t n none continue|branch -op 36 if-gt 22t n none continue|branch -op 37 if-le 22t n none continue|branch -op 38 if-eqz 21t n none continue|branch -op 39 if-nez 21t n none continue|branch -op 3a if-ltz 21t n none continue|branch -op 3b if-gez 21t n none continue|branch -op 3c if-gtz 21t n none continue|branch -op 3d if-lez 21t n none continue|branch +# Regular opcodes (with a couple holes) +op 00 nop 10x n none continue +op 01 move 12x y none continue +op 02 move/from16 22x y none continue +op 03 move/16 32x y none continue +op 04 move-wide 12x y none continue +op 05 move-wide/from16 22x y none continue +op 06 move-wide/16 32x y none continue +op 07 move-object 12x y none continue +op 08 move-object/from16 22x y none continue +op 09 move-object/16 32x y none continue +op 0a move-result 11x y none continue +op 0b move-result-wide 11x y none continue +op 0c move-result-object 11x y none continue +op 0d move-exception 11x y none continue +op 0e return-void 10x n none return +op 0f return 11x n none return +op 10 return-wide 11x n none return +op 11 return-object 11x n none return +op 12 const/4 11n y none continue +op 13 const/16 21s y none continue +op 14 const 31i y none continue +op 15 const/high16 21h y none continue +op 16 const-wide/16 21s y none continue +op 17 const-wide/32 31i y none continue +op 18 const-wide 51l y none continue +op 19 const-wide/high16 21h y none continue +op 1a const-string 21c y string-ref continue|throw +op 1b const-string/jumbo 31c y string-ref continue|throw +op 1c const-class 21c y type-ref continue|throw +op 1d monitor-enter 11x n none continue|throw +op 1e monitor-exit 11x n none continue|throw +op 1f check-cast 21c y type-ref continue|throw +op 20 instance-of 22c y type-ref continue|throw +op 21 array-length 12x y none continue|throw +op 22 new-instance 21c y type-ref continue|throw +op 23 new-array 22c y type-ref continue|throw +op 24 filled-new-array 35c n type-ref continue|throw +op 25 filled-new-array/range 3rc n type-ref continue|throw +op 26 fill-array-data 31t n none continue +op 27 throw 11x n none throw +op 28 goto 10t n none branch +op 29 goto/16 20t n none branch +op 2a goto/32 30t n none branch +op 2b packed-switch 31t n none continue|switch +op 2c sparse-switch 31t n none continue|switch +op 2d cmpl-float 23x y none continue +op 2e cmpg-float 23x y none continue +op 2f cmpl-double 23x y none continue +op 30 cmpg-double 23x y none continue +op 31 cmp-long 23x y none continue +op 32 if-eq 22t n none continue|branch +op 33 if-ne 22t n none continue|branch +op 34 if-lt 22t n none continue|branch +op 35 if-ge 22t n none continue|branch +op 36 if-gt 22t n none continue|branch +op 37 if-le 22t n none continue|branch +op 38 if-eqz 21t n none continue|branch +op 39 if-nez 21t n none continue|branch +op 3a if-ltz 21t n none continue|branch +op 3b if-gez 21t n none continue|branch +op 3c if-gtz 21t n none continue|branch +op 3d if-lez 21t n none continue|branch # unused: op 3e..43 -op 44 aget 23x y none continue|throw -op 45 aget-wide 23x y none continue|throw -op 46 aget-object 23x y none continue|throw -op 47 aget-boolean 23x y none continue|throw -op 48 aget-byte 23x y none continue|throw -op 49 aget-char 23x y none continue|throw -op 4a aget-short 23x y none continue|throw -op 4b aput 23x n none continue|throw -op 4c aput-wide 23x n none continue|throw -op 4d aput-object 23x n none continue|throw -op 4e aput-boolean 23x n none continue|throw -op 4f aput-byte 23x n none continue|throw -op 50 aput-char 23x n none continue|throw -op 51 aput-short 23x n none continue|throw -op 52 iget 22c y field-ref continue|throw -op 53 iget-wide 22c y field-ref continue|throw -op 54 iget-object 22c y field-ref continue|throw -op 55 iget-boolean 22c y field-ref continue|throw -op 56 iget-byte 22c y field-ref continue|throw -op 57 iget-char 22c y field-ref continue|throw -op 58 iget-short 22c y field-ref continue|throw -op 59 iput 22c n field-ref continue|throw -op 5a iput-wide 22c n field-ref continue|throw -op 5b iput-object 22c n field-ref continue|throw -op 5c iput-boolean 22c n field-ref continue|throw -op 5d iput-byte 22c n field-ref continue|throw -op 5e iput-char 22c n field-ref continue|throw -op 5f iput-short 22c n field-ref continue|throw -op 60 sget 21c y field-ref continue|throw -op 61 sget-wide 21c y field-ref continue|throw -op 62 sget-object 21c y field-ref continue|throw -op 63 sget-boolean 21c y field-ref continue|throw -op 64 sget-byte 21c y field-ref continue|throw -op 65 sget-char 21c y field-ref continue|throw -op 66 sget-short 21c y field-ref continue|throw -op 67 sput 21c n field-ref continue|throw -op 68 sput-wide 21c n field-ref continue|throw -op 69 sput-object 21c n field-ref continue|throw -op 6a sput-boolean 21c n field-ref continue|throw -op 6b sput-byte 21c n field-ref continue|throw -op 6c sput-char 21c n field-ref continue|throw -op 6d sput-short 21c n field-ref continue|throw -op 6e invoke-virtual 35c n method-ref continue|throw|invoke -op 6f invoke-super 35c n method-ref continue|throw|invoke -op 70 invoke-direct 35c n method-ref continue|throw|invoke -op 71 invoke-static 35c n method-ref continue|throw|invoke -op 72 invoke-interface 35c n method-ref continue|throw|invoke +op 44 aget 23x y none continue|throw +op 45 aget-wide 23x y none continue|throw +op 46 aget-object 23x y none continue|throw +op 47 aget-boolean 23x y none continue|throw +op 48 aget-byte 23x y none continue|throw +op 49 aget-char 23x y none continue|throw +op 4a aget-short 23x y none continue|throw +op 4b aput 23x n none continue|throw +op 4c aput-wide 23x n none continue|throw +op 4d aput-object 23x n none continue|throw +op 4e aput-boolean 23x n none continue|throw +op 4f aput-byte 23x n none continue|throw +op 50 aput-char 23x n none continue|throw +op 51 aput-short 23x n none continue|throw +op 52 iget 22c y field-ref continue|throw +op 53 iget-wide 22c y field-ref continue|throw +op 54 iget-object 22c y field-ref continue|throw +op 55 iget-boolean 22c y field-ref continue|throw +op 56 iget-byte 22c y field-ref continue|throw +op 57 iget-char 22c y field-ref continue|throw +op 58 iget-short 22c y field-ref continue|throw +op 59 iput 22c n field-ref continue|throw +op 5a iput-wide 22c n field-ref continue|throw +op 5b iput-object 22c n field-ref continue|throw +op 5c iput-boolean 22c n field-ref continue|throw +op 5d iput-byte 22c n field-ref continue|throw +op 5e iput-char 22c n field-ref continue|throw +op 5f iput-short 22c n field-ref continue|throw +op 60 sget 21c y field-ref continue|throw +op 61 sget-wide 21c y field-ref continue|throw +op 62 sget-object 21c y field-ref continue|throw +op 63 sget-boolean 21c y field-ref continue|throw +op 64 sget-byte 21c y field-ref continue|throw +op 65 sget-char 21c y field-ref continue|throw +op 66 sget-short 21c y field-ref continue|throw +op 67 sput 21c n field-ref continue|throw +op 68 sput-wide 21c n field-ref continue|throw +op 69 sput-object 21c n field-ref continue|throw +op 6a sput-boolean 21c n field-ref continue|throw +op 6b sput-byte 21c n field-ref continue|throw +op 6c sput-char 21c n field-ref continue|throw +op 6d sput-short 21c n field-ref continue|throw +op 6e invoke-virtual 35c n method-ref continue|throw|invoke +op 6f invoke-super 35c n method-ref continue|throw|invoke +op 70 invoke-direct 35c n method-ref continue|throw|invoke +op 71 invoke-static 35c n method-ref continue|throw|invoke +op 72 invoke-interface 35c n method-ref continue|throw|invoke # unused: op 73 -op 74 invoke-virtual/range 3rc n method-ref continue|throw|invoke -op 75 invoke-super/range 3rc n method-ref continue|throw|invoke -op 76 invoke-direct/range 3rc n method-ref continue|throw|invoke -op 77 invoke-static/range 3rc n method-ref continue|throw|invoke -op 78 invoke-interface/range 3rc n method-ref continue|throw|invoke +op 74 invoke-virtual/range 3rc n method-ref continue|throw|invoke +op 75 invoke-super/range 3rc n method-ref continue|throw|invoke +op 76 invoke-direct/range 3rc n method-ref continue|throw|invoke +op 77 invoke-static/range 3rc n method-ref continue|throw|invoke +op 78 invoke-interface/range 3rc n method-ref continue|throw|invoke # unused: op 79..7a -op 7b neg-int 12x y none continue -op 7c not-int 12x y none continue -op 7d neg-long 12x y none continue -op 7e not-long 12x y none continue -op 7f neg-float 12x y none continue -op 80 neg-double 12x y none continue -op 81 int-to-long 12x y none continue -op 82 int-to-float 12x y none continue -op 83 int-to-double 12x y none continue -op 84 long-to-int 12x y none continue -op 85 long-to-float 12x y none continue -op 86 long-to-double 12x y none continue -op 87 float-to-int 12x y none continue -op 88 float-to-long 12x y none continue -op 89 float-to-double 12x y none continue -op 8a double-to-int 12x y none continue -op 8b double-to-long 12x y none continue -op 8c double-to-float 12x y none continue -op 8d int-to-byte 12x y none continue -op 8e int-to-char 12x y none continue -op 8f int-to-short 12x y none continue -op 90 add-int 23x y none continue -op 91 sub-int 23x y none continue -op 92 mul-int 23x y none continue -op 93 div-int 23x y none continue|throw -op 94 rem-int 23x y none continue|throw -op 95 and-int 23x y none continue -op 96 or-int 23x y none continue -op 97 xor-int 23x y none continue -op 98 shl-int 23x y none continue -op 99 shr-int 23x y none continue -op 9a ushr-int 23x y none continue -op 9b add-long 23x y none continue -op 9c sub-long 23x y none continue -op 9d mul-long 23x y none continue -op 9e div-long 23x y none continue|throw -op 9f rem-long 23x y none continue|throw -op a0 and-long 23x y none continue -op a1 or-long 23x y none continue -op a2 xor-long 23x y none continue -op a3 shl-long 23x y none continue -op a4 shr-long 23x y none continue -op a5 ushr-long 23x y none continue -op a6 add-float 23x y none continue -op a7 sub-float 23x y none continue -op a8 mul-float 23x y none continue -op a9 div-float 23x y none continue -op aa rem-float 23x y none continue -op ab add-double 23x y none continue -op ac sub-double 23x y none continue -op ad mul-double 23x y none continue -op ae div-double 23x y none continue -op af rem-double 23x y none continue -op b0 add-int/2addr 12x y none continue -op b1 sub-int/2addr 12x y none continue -op b2 mul-int/2addr 12x y none continue -op b3 div-int/2addr 12x y none continue|throw -op b4 rem-int/2addr 12x y none continue|throw -op b5 and-int/2addr 12x y none continue -op b6 or-int/2addr 12x y none continue -op b7 xor-int/2addr 12x y none continue -op b8 shl-int/2addr 12x y none continue -op b9 shr-int/2addr 12x y none continue -op ba ushr-int/2addr 12x y none continue -op bb add-long/2addr 12x y none continue -op bc sub-long/2addr 12x y none continue -op bd mul-long/2addr 12x y none continue -op be div-long/2addr 12x y none continue|throw -op bf rem-long/2addr 12x y none continue|throw -op c0 and-long/2addr 12x y none continue -op c1 or-long/2addr 12x y none continue -op c2 xor-long/2addr 12x y none continue -op c3 shl-long/2addr 12x y none continue -op c4 shr-long/2addr 12x y none continue -op c5 ushr-long/2addr 12x y none continue -op c6 add-float/2addr 12x y none continue -op c7 sub-float/2addr 12x y none continue -op c8 mul-float/2addr 12x y none continue -op c9 div-float/2addr 12x y none continue -op ca rem-float/2addr 12x y none continue -op cb add-double/2addr 12x y none continue -op cc sub-double/2addr 12x y none continue -op cd mul-double/2addr 12x y none continue -op ce div-double/2addr 12x y none continue -op cf rem-double/2addr 12x y none continue -op d0 add-int/lit16 22s y none continue -op d1 rsub-int 22s y none continue -op d2 mul-int/lit16 22s y none continue -op d3 div-int/lit16 22s y none continue|throw -op d4 rem-int/lit16 22s y none continue|throw -op d5 and-int/lit16 22s y none continue -op d6 or-int/lit16 22s y none continue -op d7 xor-int/lit16 22s y none continue -op d8 add-int/lit8 22b y none continue -op d9 rsub-int/lit8 22b y none continue -op da mul-int/lit8 22b y none continue -op db div-int/lit8 22b y none continue|throw -op dc rem-int/lit8 22b y none continue|throw -op dd and-int/lit8 22b y none continue -op de or-int/lit8 22b y none continue -op df xor-int/lit8 22b y none continue -op e0 shl-int/lit8 22b y none continue -op e1 shr-int/lit8 22b y none continue -op e2 ushr-int/lit8 22b y none continue -# unused: op e3..fe -op 00ff const-class/jumbo 41c y type-ref continue|throw -op 01ff check-cast/jumbo 41c n type-ref continue|throw -op 02ff instance-of/jumbo 52c y type-ref continue|throw -op 03ff new-instance/jumbo 41c y type-ref continue|throw -op 04ff new-array/jumbo 52c y type-ref continue|throw -op 05ff filled-new-array/jumbo 5rc n type-ref continue|throw -op 06ff iget/jumbo 52c y field-ref continue|throw -op 07ff iget-wide/jumbo 52c y field-ref continue|throw -op 08ff iget-object/jumbo 52c y field-ref continue|throw -op 09ff iget-boolean/jumbo 52c y field-ref continue|throw -op 0aff iget-byte/jumbo 52c y field-ref continue|throw -op 0bff iget-char/jumbo 52c y field-ref continue|throw -op 0cff iget-short/jumbo 52c y field-ref continue|throw -op 0dff iput/jumbo 52c n field-ref continue|throw -op 0eff iput-wide/jumbo 52c n field-ref continue|throw -op 0fff iput-object/jumbo 52c n field-ref continue|throw -op 10ff iput-boolean/jumbo 52c n field-ref continue|throw -op 11ff iput-byte/jumbo 52c n field-ref continue|throw -op 12ff iput-char/jumbo 52c n field-ref continue|throw -op 13ff iput-short/jumbo 52c n field-ref continue|throw -op 14ff sget/jumbo 41c y field-ref continue|throw -op 15ff sget-wide/jumbo 41c y field-ref continue|throw -op 16ff sget-object/jumbo 41c y field-ref continue|throw -op 17ff sget-boolean/jumbo 41c y field-ref continue|throw -op 18ff sget-byte/jumbo 41c y field-ref continue|throw -op 19ff sget-char/jumbo 41c y field-ref continue|throw -op 1aff sget-short/jumbo 41c y field-ref continue|throw -op 1bff sput/jumbo 41c n field-ref continue|throw -op 1cff sput-wide/jumbo 41c n field-ref continue|throw -op 1dff sput-object/jumbo 41c n field-ref continue|throw -op 1eff sput-boolean/jumbo 41c n field-ref continue|throw -op 1fff sput-byte/jumbo 41c n field-ref continue|throw -op 20ff sput-char/jumbo 41c n field-ref continue|throw -op 21ff sput-short/jumbo 41c n field-ref continue|throw -op 22ff invoke-virtual/jumbo 5rc n method-ref continue|throw|invoke -op 23ff invoke-super/jumbo 5rc n method-ref continue|throw|invoke -op 24ff invoke-direct/jumbo 5rc n method-ref continue|throw|invoke -op 25ff invoke-static/jumbo 5rc n method-ref continue|throw|invoke -op 26ff invoke-interface/jumbo 5rc n method-ref continue|throw|invoke +op 7b neg-int 12x y none continue +op 7c not-int 12x y none continue +op 7d neg-long 12x y none continue +op 7e not-long 12x y none continue +op 7f neg-float 12x y none continue +op 80 neg-double 12x y none continue +op 81 int-to-long 12x y none continue +op 82 int-to-float 12x y none continue +op 83 int-to-double 12x y none continue +op 84 long-to-int 12x y none continue +op 85 long-to-float 12x y none continue +op 86 long-to-double 12x y none continue +op 87 float-to-int 12x y none continue +op 88 float-to-long 12x y none continue +op 89 float-to-double 12x y none continue +op 8a double-to-int 12x y none continue +op 8b double-to-long 12x y none continue +op 8c double-to-float 12x y none continue +op 8d int-to-byte 12x y none continue +op 8e int-to-char 12x y none continue +op 8f int-to-short 12x y none continue +op 90 add-int 23x y none continue +op 91 sub-int 23x y none continue +op 92 mul-int 23x y none continue +op 93 div-int 23x y none continue|throw +op 94 rem-int 23x y none continue|throw +op 95 and-int 23x y none continue +op 96 or-int 23x y none continue +op 97 xor-int 23x y none continue +op 98 shl-int 23x y none continue +op 99 shr-int 23x y none continue +op 9a ushr-int 23x y none continue +op 9b add-long 23x y none continue +op 9c sub-long 23x y none continue +op 9d mul-long 23x y none continue +op 9e div-long 23x y none continue|throw +op 9f rem-long 23x y none continue|throw +op a0 and-long 23x y none continue +op a1 or-long 23x y none continue +op a2 xor-long 23x y none continue +op a3 shl-long 23x y none continue +op a4 shr-long 23x y none continue +op a5 ushr-long 23x y none continue +op a6 add-float 23x y none continue +op a7 sub-float 23x y none continue +op a8 mul-float 23x y none continue +op a9 div-float 23x y none continue +op aa rem-float 23x y none continue +op ab add-double 23x y none continue +op ac sub-double 23x y none continue +op ad mul-double 23x y none continue +op ae div-double 23x y none continue +op af rem-double 23x y none continue +op b0 add-int/2addr 12x y none continue +op b1 sub-int/2addr 12x y none continue +op b2 mul-int/2addr 12x y none continue +op b3 div-int/2addr 12x y none continue|throw +op b4 rem-int/2addr 12x y none continue|throw +op b5 and-int/2addr 12x y none continue +op b6 or-int/2addr 12x y none continue +op b7 xor-int/2addr 12x y none continue +op b8 shl-int/2addr 12x y none continue +op b9 shr-int/2addr 12x y none continue +op ba ushr-int/2addr 12x y none continue +op bb add-long/2addr 12x y none continue +op bc sub-long/2addr 12x y none continue +op bd mul-long/2addr 12x y none continue +op be div-long/2addr 12x y none continue|throw +op bf rem-long/2addr 12x y none continue|throw +op c0 and-long/2addr 12x y none continue +op c1 or-long/2addr 12x y none continue +op c2 xor-long/2addr 12x y none continue +op c3 shl-long/2addr 12x y none continue +op c4 shr-long/2addr 12x y none continue +op c5 ushr-long/2addr 12x y none continue +op c6 add-float/2addr 12x y none continue +op c7 sub-float/2addr 12x y none continue +op c8 mul-float/2addr 12x y none continue +op c9 div-float/2addr 12x y none continue +op ca rem-float/2addr 12x y none continue +op cb add-double/2addr 12x y none continue +op cc sub-double/2addr 12x y none continue +op cd mul-double/2addr 12x y none continue +op ce div-double/2addr 12x y none continue +op cf rem-double/2addr 12x y none continue +op d0 add-int/lit16 22s y none continue +op d1 rsub-int 22s y none continue +op d2 mul-int/lit16 22s y none continue +op d3 div-int/lit16 22s y none continue|throw +op d4 rem-int/lit16 22s y none continue|throw +op d5 and-int/lit16 22s y none continue +op d6 or-int/lit16 22s y none continue +op d7 xor-int/lit16 22s y none continue +op d8 add-int/lit8 22b y none continue +op d9 rsub-int/lit8 22b y none continue +op da mul-int/lit8 22b y none continue +op db div-int/lit8 22b y none continue|throw +op dc rem-int/lit8 22b y none continue|throw +op dd and-int/lit8 22b y none continue +op de or-int/lit8 22b y none continue +op df xor-int/lit8 22b y none continue +op e0 shl-int/lit8 22b y none continue +op e1 shr-int/lit8 22b y none continue +op e2 ushr-int/lit8 22b y none continue + +# Optimized opcodes (not valid in an unoptimized dex file) +# +# Note: Technically "breakpoint" isn't really an optimized opcode, but +# it fits the label in terms of not being valid in dex files. +op e3 iget-volatile 22c y field-ref optimized|continue|throw +op e4 iput-volatile 22c n field-ref optimized|continue|throw +op e5 sget-volatile 21c y field-ref optimized|continue|throw +op e6 sput-volatile 21c n field-ref optimized|continue|throw +op e7 iget-object-volatile 22c y field-ref optimized|continue|throw +op e8 iget-wide-volatile 22c y field-ref optimized|continue|throw +op e9 iput-wide-volatile 22c n field-ref optimized|continue|throw +op ea sget-wide-volatile 21c y field-ref optimized|continue|throw +op eb sput-wide-volatile 21c n field-ref optimized|continue|throw +op ec breakpoint 00x n none optimized|continue|throw +op ed throw-verification-error 20bc n varies optimized|throw +op ee execute-inline 35mi n inline-method optimized|continue|throw +op ef execute-inline/range 3rmi n inline-method optimized|continue|throw +op f0 invoke-direct-empty 35c n method-ref optimized|continue|throw|invoke +op f1 return-void-barrier 10x n none optimized|return +op f2 iget-quick 22cs y field-offset optimized|continue|throw +op f3 iget-wide-quick 22cs y field-offset optimized|continue|throw +op f4 iget-object-quick 22cs y field-offset optimized|continue|throw +op f5 iput-quick 22cs n field-offset optimized|continue|throw +op f6 iput-wide-quick 22cs n field-offset optimized|continue|throw +op f7 iput-object-quick 22cs n field-offset optimized|continue|throw +op f8 invoke-virtual-quick 35ms n vtable-offset optimized|continue|throw|invoke +op f9 invoke-virtual-quick/range 3rms n vtable-offset optimized|continue|throw|invoke +op fa invoke-super-quick 35ms n vtable-offset optimized|continue|throw|invoke +op fb invoke-super-quick/range 3rms n vtable-offset optimized|continue|throw|invoke +op fc iput-object-volatile 22c n field-ref optimized|continue|throw +op fd sget-object-volatile 21c y field-ref optimized|continue|throw +op fe sput-object-volatile 21c n field-ref optimized|continue|throw + +# Extended-width opcodes +op 00ff const-class/jumbo 41c y type-ref continue|throw +op 01ff check-cast/jumbo 41c n type-ref continue|throw +op 02ff instance-of/jumbo 52c y type-ref continue|throw +op 03ff new-instance/jumbo 41c y type-ref continue|throw +op 04ff new-array/jumbo 52c y type-ref continue|throw +op 05ff filled-new-array/jumbo 5rc n type-ref continue|throw +op 06ff iget/jumbo 52c y field-ref continue|throw +op 07ff iget-wide/jumbo 52c y field-ref continue|throw +op 08ff iget-object/jumbo 52c y field-ref continue|throw +op 09ff iget-boolean/jumbo 52c y field-ref continue|throw +op 0aff iget-byte/jumbo 52c y field-ref continue|throw +op 0bff iget-char/jumbo 52c y field-ref continue|throw +op 0cff iget-short/jumbo 52c y field-ref continue|throw +op 0dff iput/jumbo 52c n field-ref continue|throw +op 0eff iput-wide/jumbo 52c n field-ref continue|throw +op 0fff iput-object/jumbo 52c n field-ref continue|throw +op 10ff iput-boolean/jumbo 52c n field-ref continue|throw +op 11ff iput-byte/jumbo 52c n field-ref continue|throw +op 12ff iput-char/jumbo 52c n field-ref continue|throw +op 13ff iput-short/jumbo 52c n field-ref continue|throw +op 14ff sget/jumbo 41c y field-ref continue|throw +op 15ff sget-wide/jumbo 41c y field-ref continue|throw +op 16ff sget-object/jumbo 41c y field-ref continue|throw +op 17ff sget-boolean/jumbo 41c y field-ref continue|throw +op 18ff sget-byte/jumbo 41c y field-ref continue|throw +op 19ff sget-char/jumbo 41c y field-ref continue|throw +op 1aff sget-short/jumbo 41c y field-ref continue|throw +op 1bff sput/jumbo 41c n field-ref continue|throw +op 1cff sput-wide/jumbo 41c n field-ref continue|throw +op 1dff sput-object/jumbo 41c n field-ref continue|throw +op 1eff sput-boolean/jumbo 41c n field-ref continue|throw +op 1fff sput-byte/jumbo 41c n field-ref continue|throw +op 20ff sput-char/jumbo 41c n field-ref continue|throw +op 21ff sput-short/jumbo 41c n field-ref continue|throw +op 22ff invoke-virtual/jumbo 5rc n method-ref continue|throw|invoke +op 23ff invoke-super/jumbo 5rc n method-ref continue|throw|invoke +op 24ff invoke-direct/jumbo 5rc n method-ref continue|throw|invoke +op 25ff invoke-static/jumbo 5rc n method-ref continue|throw|invoke +op 26ff invoke-interface/jumbo 5rc n method-ref continue|throw|invoke # unused: op 27ff..ffff diff --git a/dx/etc/opcode-gen b/dx/etc/opcode-gen index 24e6d8a1c..b10a3991d 100755 --- a/dx/etc/opcode-gen +++ b/dx/etc/opcode-gen @@ -62,7 +62,7 @@ BEGIN { MAX_OPCODE = 65535; initIndexTypes(); initFlags(); - readBytecodes(); + if (readBytecodes()) exit 1; deriveOpcodeChains(); consumeUntil = ""; } @@ -169,8 +169,11 @@ function readBytecodes(i, parts, line, cmd, status, count) { if (status != 0) { printf("syntax error on line: %s\n", line); + return 1; } } + + return 0; } # Define an opcode. @@ -242,16 +245,12 @@ function deriveOpcodeChains(i, op) { # locals: i, op for (i = 0; i <= MAX_OPCODE; i++) { - if ((hex[i] == "") || (index(name[i], "unused") != 0)) { - continue; - } + if (isUnused(i)) continue; isFirst[i] = "true"; } for (i = 0; i <= MAX_OPCODE; i++) { - if ((hex[i] == "") || (index(name[i], "unused") != 0)) { - continue; - } + if (isUnused(i)) continue; op = findNextOpcode(i); nextOpcode[i] = op; if (op != -1) { diff --git a/dx/etc/run-opcode-gen b/dx/etc/run-opcode-gen index 0b930643c..c4d1ae416 100755 --- a/dx/etc/run-opcode-gen +++ b/dx/etc/run-opcode-gen @@ -34,6 +34,11 @@ progdir=`pwd` # Be in the parent of the progdir when running the rest of the script. cd ".." +echo "processing DalvOps.java" ${progdir}/opcode-gen src/com/android/dx/dex/code/DalvOps.java + +echo "processing Dops.java" ${progdir}/opcode-gen src/com/android/dx/dex/code/Dops.java + +echo "processing RopToDop.java" ${progdir}/opcode-gen src/com/android/dx/dex/code/RopToDop.java |
