PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/src/main/java/com/alibaba/fastjson/asm/Opcodes.java

https://bitbucket.org/xiejuntao/xdesktop
Java | 292 lines | 104 code | 13 blank | 175 comment | 0 complexity | ebdfd8b59a37cc2da582c048315f5b32 MD5 | raw file
  1. /***
  2. * ASM: a very small and fast Java bytecode manipulation framework
  3. * Copyright (c) 2000-2007 INRIA, France Telecom
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. Neither the name of the copyright holders nor the names of its
  15. * contributors may be used to endorse or promote products derived from
  16. * this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  19. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  22. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  23. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  24. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  25. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  26. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  27. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  28. * THE POSSIBILITY OF SUCH DAMAGE.
  29. */
  30. package com.alibaba.fastjson.asm;
  31. /**
  32. * Defines the JVM opcodes, access flags and array type codes. This interface does not define all the JVM opcodes
  33. * because some opcodes are automatically handled. For example, the xLOAD and xSTORE opcodes are automatically replaced
  34. * by xLOAD_n and xSTORE_n opcodes when possible. The xLOAD_n and xSTORE_n opcodes are therefore not defined in this
  35. * interface. Likewise for LDC, automatically replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and JSR_W.
  36. *
  37. * @author Eric Bruneton
  38. * @author Eugene Kuleshov
  39. */
  40. public interface Opcodes {
  41. // versions
  42. // int V1_1 = 3 << 16 | 45;
  43. // int V1_2 = 0 << 16 | 46;
  44. // int V1_3 = 0 << 16 | 47;
  45. // int V1_4 = 0 << 16 | 48;
  46. int V1_5 = 0 << 16 | 49;
  47. // int V1_6 = 0 << 16 | 50;
  48. // int V1_7 = 0 << 16 | 51;
  49. // access flags
  50. int ACC_PUBLIC = 0x0001; // class, field, method
  51. int ACC_PRIVATE = 0x0002; // class, field, method
  52. int ACC_SUPER = 0x0020; // class
  53. int ACC_SYNTHETIC = 0x1000; // class, field, method
  54. // ASM specific pseudo access flags
  55. int ACC_DEPRECATED = 0x20000; // class, field, method
  56. // types for NEWARRAY
  57. int T_BOOLEAN = 4;
  58. int T_CHAR = 5;
  59. int T_FLOAT = 6;
  60. int T_DOUBLE = 7;
  61. int T_BYTE = 8;
  62. int T_SHORT = 9;
  63. int T_INT = 10;
  64. int T_LONG = 11;
  65. // Integer TOP = new Integer(0);
  66. // Integer INTEGER = new Integer(1);
  67. // Integer FLOAT = new Integer(2);
  68. // Integer DOUBLE = new Integer(3);
  69. // Integer LONG = new Integer(4);
  70. // Integer NULL = new Integer(5);
  71. // Integer UNINITIALIZED_THIS = new Integer(6);
  72. /**
  73. * Represents a owner of an invokedynamic call.
  74. */
  75. String INVOKEDYNAMIC_OWNER = "java/lang/dyn/Dynamic";
  76. // opcodes // visit method (- = idem)
  77. int NOP = 0; // visitInsn
  78. int ACONST_NULL = 1; // -
  79. int ICONST_M1 = 2; // -
  80. int ICONST_0 = 3; // -
  81. int ICONST_1 = 4; // -
  82. int ICONST_2 = 5; // -
  83. int ICONST_3 = 6; // -
  84. int ICONST_4 = 7; // -
  85. int ICONST_5 = 8; // -
  86. int LCONST_0 = 9; // -
  87. int LCONST_1 = 10; // -
  88. int FCONST_0 = 11; // -
  89. int FCONST_1 = 12; // -
  90. int FCONST_2 = 13; // -
  91. int DCONST_0 = 14; // -
  92. int DCONST_1 = 15; // -
  93. int BIPUSH = 16; // visitIntInsn
  94. // int SIPUSH = 17; // -
  95. int LDC = 18; // visitLdcInsn
  96. // int LDC_W = 19; // -
  97. // int LDC2_W = 20; // -
  98. int ILOAD = 21; // visitVarInsn
  99. int LLOAD = 22; // -
  100. int FLOAD = 23; // -
  101. int DLOAD = 24; // -
  102. int ALOAD = 25; // -
  103. // int ILOAD_0 = 26; // -
  104. // int ILOAD_1 = 27; // -
  105. // int ILOAD_2 = 28; // -
  106. // int ILOAD_3 = 29; // -
  107. // int LLOAD_0 = 30; // -
  108. // int LLOAD_1 = 31; // -
  109. // int LLOAD_2 = 32; // -
  110. // int LLOAD_3 = 33; // -
  111. // int FLOAD_0 = 34; // -
  112. // int FLOAD_1 = 35; // -
  113. // int FLOAD_2 = 36; // -
  114. // int FLOAD_3 = 37; // -
  115. // int DLOAD_0 = 38; // -
  116. // int DLOAD_1 = 39; // -
  117. // int DLOAD_2 = 40; // -
  118. // int DLOAD_3 = 41; // -
  119. // int ALOAD_0 = 42; // -
  120. // int ALOAD_1 = 43; // -
  121. // int ALOAD_2 = 44; // -
  122. // int ALOAD_3 = 45; // -
  123. int IALOAD = 46; // visitInsn
  124. int LALOAD = 47; // -
  125. int FALOAD = 48; // -
  126. int DALOAD = 49; // -
  127. int AALOAD = 50; // -
  128. int BALOAD = 51; // -
  129. int CALOAD = 52; // -
  130. int SALOAD = 53; // -
  131. int ISTORE = 54; // visitVarInsn
  132. int LSTORE = 55; // -
  133. int FSTORE = 56; // -
  134. int DSTORE = 57; // -
  135. int ASTORE = 58; // -
  136. // int ISTORE_0 = 59; // -
  137. // int ISTORE_1 = 60; // -
  138. // int ISTORE_2 = 61; // -
  139. // int ISTORE_3 = 62; // -
  140. // int LSTORE_0 = 63; // -
  141. // int LSTORE_1 = 64; // -
  142. // int LSTORE_2 = 65; // -
  143. // int LSTORE_3 = 66; // -
  144. // int FSTORE_0 = 67; // -
  145. // int FSTORE_1 = 68; // -
  146. // int FSTORE_2 = 69; // -
  147. // int FSTORE_3 = 70; // -
  148. // int DSTORE_0 = 71; // -
  149. // int DSTORE_1 = 72; // -
  150. // int DSTORE_2 = 73; // -
  151. // int DSTORE_3 = 74; // -
  152. // int ASTORE_0 = 75; // -
  153. // int ASTORE_1 = 76; // -
  154. // int ASTORE_2 = 77; // -
  155. // int ASTORE_3 = 78; // -
  156. // int IASTORE = 79; // visitInsn
  157. // int LASTORE = 80; // -
  158. // int FASTORE = 81; // -
  159. // int DASTORE = 82; // -
  160. // int AASTORE = 83; // -
  161. // int BASTORE = 84; // -
  162. // int CASTORE = 85; // -
  163. // int SASTORE = 86; // -
  164. int POP = 87; // -
  165. int POP2 = 88; // -
  166. int DUP = 89; // -
  167. // int DUP_X1 = 90; // -
  168. // int DUP_X2 = 91; // -
  169. // int DUP2 = 92; // -
  170. // int DUP2_X1 = 93; // -
  171. // int DUP2_X2 = 94; // -
  172. // int SWAP = 95; // -
  173. int IADD = 96; // -
  174. int LADD = 97; // -
  175. // int FADD = 98; // -
  176. // int DADD = 99; // -
  177. int ISUB = 100; // -
  178. // int LSUB = 101; // -
  179. // int FSUB = 102; // -
  180. // int DSUB = 103; // -
  181. // int IMUL = 104; // -
  182. // int LMUL = 105; // -
  183. // int FMUL = 106; // -
  184. // int DMUL = 107; // -
  185. // int IDIV = 108; // -
  186. // int LDIV = 109; // -
  187. // int FDIV = 110; // -
  188. // int DDIV = 111; // -
  189. // int IREM = 112; // -
  190. // int LREM = 113; // -
  191. // int FREM = 114; // -
  192. // int DREM = 115; // -
  193. // int INEG = 116; // -
  194. // int LNEG = 117; // -
  195. // int FNEG = 118; // -
  196. // int DNEG = 119; // -
  197. // int ISHL = 120; // -
  198. // int LSHL = 121; // -
  199. // int ISHR = 122; // -
  200. // int LSHR = 123; // -
  201. // int IUSHR = 124; // -
  202. // int LUSHR = 125; // -
  203. int IAND = 126; // -
  204. // int LAND = 127; // -
  205. int IOR = 128; // -
  206. // int LOR = 129; // -
  207. // int IXOR = 130; // -
  208. // int LXOR = 131; // -
  209. int IINC = 132; // visitIincInsn
  210. // int I2L = 133; // visitInsn
  211. // int I2F = 134; // -
  212. // int I2D = 135; // -
  213. // int L2I = 136; // -
  214. // int L2F = 137; // -
  215. // int L2D = 138; // -
  216. // int F2I = 139; // -
  217. // int F2L = 140; // -
  218. // int F2D = 141; // -
  219. // int D2I = 142; // -
  220. // int D2L = 143; // -
  221. // int D2F = 144; // -
  222. int I2B = 145; // -
  223. int I2C = 146; // -
  224. int I2S = 147; // -
  225. int LCMP = 148; // -
  226. int FCMPL = 149; // -
  227. int FCMPG = 150; // -
  228. int DCMPL = 151; // -
  229. int DCMPG = 152; // -
  230. int IFEQ = 153; // visitJumpInsn
  231. int IFNE = 154; // -
  232. int IFLT = 155; // -
  233. int IFGE = 156; // -
  234. int IFGT = 157; // -
  235. int IFLE = 158; // -
  236. int IF_ICMPEQ = 159; // -
  237. int IF_ICMPNE = 160; // -
  238. int IF_ICMPLT = 161; // -
  239. int IF_ICMPGE = 162; // -
  240. int IF_ICMPGT = 163; // -
  241. int IF_ICMPLE = 164; // -
  242. int IF_ACMPEQ = 165; // -
  243. int IF_ACMPNE = 166; // -
  244. int GOTO = 167; // -
  245. int JSR = 168; // -
  246. int RET = 169; // visitVarInsn
  247. // int TABLESWITCH = 170; // visiTableSwitchInsn
  248. // int LOOKUPSWITCH = 171; // visitLookupSwitch
  249. int IRETURN = 172; // visitInsn
  250. // int LRETURN = 173; // -
  251. // int FRETURN = 174; // -
  252. // int DRETURN = 175; // -
  253. int ARETURN = 176; // -
  254. int RETURN = 177; // -
  255. int GETSTATIC = 178; // visitFieldInsn
  256. int PUTSTATIC = 179; // -
  257. int GETFIELD = 180; // -
  258. int PUTFIELD = 181; // -
  259. int INVOKEVIRTUAL = 182; // visitMethodInsn
  260. int INVOKESPECIAL = 183; // -
  261. int INVOKESTATIC = 184; // -
  262. int INVOKEINTERFACE = 185; // -
  263. // int INVOKEDYNAMIC = 186; // -
  264. int NEW = 187; // visitTypeInsn
  265. // int NEWARRAY = 188; // visitIntInsn
  266. // int ANEWARRAY = 189; // visitTypeInsn
  267. // int ARRAYLENGTH = 190; // visitInsn
  268. // int ATHROW = 191; // -
  269. int CHECKCAST = 192; // visitTypeInsn
  270. int INSTANCEOF = 193; // -
  271. // int MONITORENTER = 194; // visitInsn
  272. // int MONITOREXIT = 195; // -
  273. // int WIDE = 196; // NOT VISITED
  274. // int MULTIANEWARRAY = 197; // visitMultiANewArrayInsn
  275. int IFNULL = 198; // visitJumpInsn
  276. int IFNONNULL = 199; // -
  277. // int GOTO_W = 200; // -
  278. // int JSR_W = 201; // -
  279. }