JVMcodes.cp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. (* ============================================================ *)
  2. (* JVMcodes is the module which defines jasmin name ordinals. *)
  3. (* Name spelling is defined by the lexical rules of Jasmin. *)
  4. (* Copyright (c) John Gough 1999, 2000. *)
  5. (* ============================================================ *)
  6. MODULE JVMcodes;
  7. IMPORT GPCPcopyright;
  8. (* ============================================================ *)
  9. CONST
  10. dot_error* = 0;
  11. dot_catch* = 1;
  12. dot_class* = 2;
  13. dot_end* = 3;
  14. dot_field* = 4;
  15. dot_implements*= 5;
  16. dot_interface* = 6;
  17. dot_limit* = 7;
  18. dot_line* = 8;
  19. dot_method* = 9;
  20. dot_source* = 10;
  21. dot_super* = 11;
  22. dot_throws* = 12;
  23. dot_var* = 13;
  24. CONST
  25. att_empty* = {};
  26. att_public* = {0};
  27. att_private* = {1};
  28. att_protected* = {2};
  29. att_static* = {3};
  30. att_final* = {4};
  31. att_synchronized*= {5};
  32. att_native* = {6};
  33. att_volatile* = {7};
  34. att_abstract* = {8};
  35. att_transient* = {9};
  36. att_interface* = {10};
  37. (* Constants for java class files *)
  38. CONST
  39. (* access flags *)
  40. acc_package* = 0000H;
  41. acc_public* = 0001H;
  42. acc_private* = 0002H;
  43. acc_protected* = 0004H;
  44. acc_static* = 0008H;
  45. acc_final* = 0010H;
  46. acc_synchronized* = 0020H;
  47. acc_volatile* = 0040H;
  48. acc_transient* = 0080H;
  49. acc_super* = 0020H;
  50. acc_native* = 0100H;
  51. acc_interface* = 0200H;
  52. acc_abstract* = 0400H;
  53. (* constant pool tags *)
  54. const_utf8* = 1;
  55. const_integer* = 3;
  56. const_float* = 4;
  57. const_long* = 5;
  58. const_double* = 6;
  59. const_class* = 7;
  60. const_string* = 8;
  61. const_fieldref* = 9;
  62. const_methodref* = 10;
  63. const_interfacemethodref* = 11;
  64. const_nameandtype* = 12;
  65. (* ============================================================ *)
  66. CONST
  67. opc_nop* = 0;
  68. opc_aconst_null*= 1;
  69. opc_iconst_m1* = 2;
  70. opc_iconst_0* = 3;
  71. opc_iconst_1* = 4;
  72. opc_iconst_2* = 5;
  73. opc_iconst_3* = 6;
  74. opc_iconst_4* = 7;
  75. opc_iconst_5* = 8;
  76. opc_lconst_0* = 9;
  77. opc_lconst_1* = 10;
  78. opc_fconst_0* = 11;
  79. opc_fconst_1* = 12;
  80. opc_fconst_2* = 13;
  81. opc_dconst_0* = 14;
  82. opc_dconst_1* = 15;
  83. opc_bipush* = 16;
  84. opc_sipush* = 17;
  85. opc_ldc* = 18;
  86. opc_ldc_w* = 19;
  87. opc_ldc2_w* = 20;
  88. opc_iload* = 21;
  89. opc_lload* = 22;
  90. opc_fload* = 23;
  91. opc_dload* = 24;
  92. opc_aload* = 25;
  93. opc_iload_0* = 26;
  94. opc_iload_1* = 27;
  95. opc_iload_2* = 28;
  96. opc_iload_3* = 29;
  97. opc_lload_0* = 30;
  98. opc_lload_1* = 31;
  99. opc_lload_2* = 32;
  100. opc_lload_3* = 33;
  101. opc_fload_0* = 34;
  102. opc_fload_1* = 35;
  103. opc_fload_2* = 36;
  104. opc_fload_3* = 37;
  105. opc_dload_0* = 38;
  106. opc_dload_1* = 39;
  107. opc_dload_2* = 40;
  108. opc_dload_3* = 41;
  109. opc_aload_0* = 42;
  110. opc_aload_1* = 43;
  111. opc_aload_2* = 44;
  112. opc_aload_3* = 45;
  113. opc_iaload* = 46;
  114. opc_laload* = 47;
  115. opc_faload* = 48;
  116. opc_daload* = 49;
  117. opc_aaload* = 50;
  118. opc_baload* = 51;
  119. opc_caload* = 52;
  120. opc_saload* = 53;
  121. opc_istore* = 54;
  122. opc_lstore* = 55;
  123. opc_fstore* = 56;
  124. opc_dstore* = 57;
  125. opc_astore* = 58;
  126. opc_istore_0* = 59;
  127. opc_istore_1* = 60;
  128. opc_istore_2* = 61;
  129. opc_istore_3* = 62;
  130. opc_lstore_0* = 63;
  131. opc_lstore_1* = 64;
  132. opc_lstore_2* = 65;
  133. opc_lstore_3* = 66;
  134. opc_fstore_0* = 67;
  135. opc_fstore_1* = 68;
  136. opc_fstore_2* = 69;
  137. opc_fstore_3* = 70;
  138. opc_dstore_0* = 71;
  139. opc_dstore_1* = 72;
  140. opc_dstore_2* = 73;
  141. opc_dstore_3* = 74;
  142. opc_astore_0* = 75;
  143. opc_astore_1* = 76;
  144. opc_astore_2* = 77;
  145. opc_astore_3* = 78;
  146. opc_iastore* = 79;
  147. opc_lastore* = 80;
  148. opc_fastore* = 81;
  149. opc_dastore* = 82;
  150. opc_aastore* = 83;
  151. opc_bastore* = 84;
  152. opc_castore* = 85;
  153. opc_sastore* = 86;
  154. opc_pop* = 87;
  155. opc_pop2* = 88;
  156. opc_dup* = 89;
  157. opc_dup_x1* = 90;
  158. opc_dup_x2* = 91;
  159. opc_dup2* = 92;
  160. opc_dup2_x1* = 93;
  161. opc_dup2_x2* = 94;
  162. opc_swap* = 95;
  163. opc_iadd* = 96;
  164. opc_ladd* = 97;
  165. opc_fadd* = 98;
  166. opc_dadd* = 99;
  167. opc_isub* = 100;
  168. opc_lsub* = 101;
  169. opc_fsub* = 102;
  170. opc_dsub* = 103;
  171. opc_imul* = 104;
  172. opc_lmul* = 105;
  173. opc_fmul* = 106;
  174. opc_dmul* = 107;
  175. opc_idiv* = 108;
  176. opc_ldiv* = 109;
  177. opc_fdiv* = 110;
  178. opc_ddiv* = 111;
  179. opc_irem* = 112;
  180. opc_lrem* = 113;
  181. opc_frem* = 114;
  182. opc_drem* = 115;
  183. opc_ineg* = 116;
  184. opc_lneg* = 117;
  185. opc_fneg* = 118;
  186. opc_dneg* = 119;
  187. opc_ishl* = 120;
  188. opc_lshl* = 121;
  189. opc_ishr* = 122;
  190. opc_lshr* = 123;
  191. opc_iushr* = 124;
  192. opc_lushr* = 125;
  193. opc_iand* = 126;
  194. opc_land* = 127;
  195. opc_ior* = 128;
  196. opc_lor* = 129;
  197. opc_ixor* = 130;
  198. opc_lxor* = 131;
  199. opc_iinc* = 132;
  200. opc_i2l* = 133;
  201. opc_i2f* = 134;
  202. opc_i2d* = 135;
  203. opc_l2i* = 136;
  204. opc_l2f* = 137;
  205. opc_l2d* = 138;
  206. opc_f2i* = 139;
  207. opc_f2l* = 140;
  208. opc_f2d* = 141;
  209. opc_d2i* = 142;
  210. opc_d2l* = 143;
  211. opc_d2f* = 144;
  212. opc_i2b* = 145;
  213. opc_i2c* = 146;
  214. opc_i2s* = 147;
  215. opc_lcmp* = 148;
  216. opc_fcmpl* = 149;
  217. opc_fcmpg* = 150;
  218. opc_dcmpl* = 151;
  219. opc_dcmpg* = 152;
  220. opc_ifeq* = 153;
  221. opc_ifne* = 154;
  222. opc_iflt* = 155;
  223. opc_ifge* = 156;
  224. opc_ifgt* = 157;
  225. opc_ifle* = 158;
  226. opc_if_icmpeq* = 159;
  227. opc_if_icmpne* = 160;
  228. opc_if_icmplt* = 161;
  229. opc_if_icmpge* = 162;
  230. opc_if_icmpgt* = 163;
  231. opc_if_icmple* = 164;
  232. opc_if_acmpeq* = 165;
  233. opc_if_acmpne* = 166;
  234. opc_goto* = 167;
  235. opc_jsr* = 168;
  236. opc_ret* = 169;
  237. opc_tableswitch* = 170;
  238. opc_lookupswitch* = 171;
  239. opc_ireturn* = 172;
  240. opc_lreturn* = 173;
  241. opc_freturn* = 174;
  242. opc_dreturn* = 175;
  243. opc_areturn* = 176;
  244. opc_return* = 177;
  245. opc_getstatic* = 178;
  246. opc_putstatic* = 179;
  247. opc_getfield* = 180;
  248. opc_putfield* = 181;
  249. opc_invokevirtual* = 182;
  250. opc_invokespecial* = 183;
  251. opc_invokestatic* = 184;
  252. opc_invokeinterface* = 185;
  253. opc_xxxunusedxxx = 186;
  254. opc_new* = 187;
  255. opc_newarray* = 188;
  256. opc_anewarray* = 189;
  257. opc_arraylength* = 190;
  258. opc_athrow* = 191;
  259. opc_checkcast* = 192;
  260. opc_instanceof* = 193;
  261. opc_monitorenter* = 194;
  262. opc_monitorexit* = 195;
  263. opc_wide* = 196;
  264. opc_multianewarray* = 197;
  265. opc_ifnull* = 198;
  266. opc_ifnonnull* = 199;
  267. opc_goto_w* = 200;
  268. opc_jsr_w* = 201;
  269. opc_breakpoint* = 202;
  270. (* ============================================================ *)
  271. TYPE
  272. OpName* = ARRAY 24 OF CHAR;
  273. (* ============================================================ *)
  274. VAR op* : ARRAY 203 OF OpName;
  275. dl* : ARRAY 203 OF INTEGER;
  276. VAR dirStr* : ARRAY 14 OF OpName;
  277. access* : ARRAY 12 OF OpName;
  278. (* ============================================================ *)
  279. BEGIN
  280. dirStr[dot_error] := ".ERROR";
  281. dirStr[dot_catch] := ".catch";
  282. dirStr[dot_class] := ".class";
  283. dirStr[dot_end] := ".end method";
  284. dirStr[dot_field] := ".field";
  285. dirStr[dot_implements] := ".implements";
  286. dirStr[dot_interface] := ".interface";
  287. dirStr[dot_limit] := ".limit";
  288. dirStr[dot_line] := ".line";
  289. dirStr[dot_method] := ".method";
  290. dirStr[dot_source] := ".source";
  291. dirStr[dot_super] := ".super";
  292. dirStr[dot_throws] := ".throws";
  293. dirStr[dot_var] := ".var";
  294. access[ 0] := "public";
  295. access[ 1] := "private";
  296. access[ 2] := "protected";
  297. access[ 3] := "static";
  298. access[ 4] := "final";
  299. access[ 5] := "synchronized";
  300. access[ 6] := "native";
  301. access[ 7] := "volatile";
  302. access[ 8] := "abstract";
  303. access[ 9] := "transient";
  304. access[10] := "interface";
  305. op[opc_nop] := "nop";
  306. op[opc_aconst_null] := "aconst_null";
  307. op[opc_iconst_m1] := "iconst_m1";
  308. op[opc_iconst_0] := "iconst_0";
  309. op[opc_iconst_1] := "iconst_1";
  310. op[opc_iconst_2] := "iconst_2";
  311. op[opc_iconst_3] := "iconst_3";
  312. op[opc_iconst_4] := "iconst_4";
  313. op[opc_iconst_5] := "iconst_5";
  314. op[opc_lconst_0] := "lconst_0";
  315. op[opc_lconst_1] := "lconst_1";
  316. op[opc_fconst_0] := "fconst_0";
  317. op[opc_fconst_1] := "fconst_1";
  318. op[opc_fconst_2] := "fconst_2";
  319. op[opc_dconst_0] := "dconst_0";
  320. op[opc_dconst_1] := "dconst_1";
  321. op[opc_bipush] := "bipush";
  322. op[opc_sipush] := "sipush";
  323. op[opc_ldc] := "ldc";
  324. op[opc_ldc_w] := "ldc_w";
  325. op[opc_ldc2_w] := "ldc2_w";
  326. op[opc_iload] := "iload";
  327. op[opc_lload] := "lload";
  328. op[opc_fload] := "fload";
  329. op[opc_dload] := "dload";
  330. op[opc_aload] := "aload";
  331. op[opc_iload_0] := "iload_0";
  332. op[opc_iload_1] := "iload_1";
  333. op[opc_iload_2] := "iload_2";
  334. op[opc_iload_3] := "iload_3";
  335. op[opc_lload_0] := "lload_0";
  336. op[opc_lload_1] := "lload_1";
  337. op[opc_lload_2] := "lload_2";
  338. op[opc_lload_3] := "lload_3";
  339. op[opc_fload_0] := "fload_0";
  340. op[opc_fload_1] := "fload_1";
  341. op[opc_fload_2] := "fload_2";
  342. op[opc_fload_3] := "fload_3";
  343. op[opc_dload_0] := "dload_0";
  344. op[opc_dload_1] := "dload_1";
  345. op[opc_dload_2] := "dload_2";
  346. op[opc_dload_3] := "dload_3";
  347. op[opc_aload_0] := "aload_0";
  348. op[opc_aload_1] := "aload_1";
  349. op[opc_aload_2] := "aload_2";
  350. op[opc_aload_3] := "aload_3";
  351. op[opc_iaload] := "iaload";
  352. op[opc_laload] := "laload";
  353. op[opc_faload] := "faload";
  354. op[opc_daload] := "daload";
  355. op[opc_aaload] := "aaload";
  356. op[opc_baload] := "baload";
  357. op[opc_caload] := "caload";
  358. op[opc_saload] := "saload";
  359. op[opc_istore] := "istore";
  360. op[opc_lstore] := "lstore";
  361. op[opc_fstore] := "fstore";
  362. op[opc_dstore] := "dstore";
  363. op[opc_astore] := "astore";
  364. op[opc_istore_0] := "istore_0";
  365. op[opc_istore_1] := "istore_1";
  366. op[opc_istore_2] := "istore_2";
  367. op[opc_istore_3] := "istore_3";
  368. op[opc_lstore_0] := "lstore_0";
  369. op[opc_lstore_1] := "lstore_1";
  370. op[opc_lstore_2] := "lstore_2";
  371. op[opc_lstore_3] := "lstore_3";
  372. op[opc_fstore_0] := "fstore_0";
  373. op[opc_fstore_1] := "fstore_1";
  374. op[opc_fstore_2] := "fstore_2";
  375. op[opc_fstore_3] := "fstore_3";
  376. op[opc_dstore_0] := "dstore_0";
  377. op[opc_dstore_1] := "dstore_1";
  378. op[opc_dstore_2] := "dstore_2";
  379. op[opc_dstore_3] := "dstore_3";
  380. op[opc_astore_0] := "astore_0";
  381. op[opc_astore_1] := "astore_1";
  382. op[opc_astore_2] := "astore_2";
  383. op[opc_astore_3] := "astore_3";
  384. op[opc_iastore] := "iastore";
  385. op[opc_lastore] := "lastore";
  386. op[opc_fastore] := "fastore";
  387. op[opc_dastore] := "dastore";
  388. op[opc_aastore] := "aastore";
  389. op[opc_bastore] := "bastore";
  390. op[opc_castore] := "castore";
  391. op[opc_sastore] := "sastore";
  392. op[opc_pop] := "pop";
  393. op[opc_pop2] := "pop2";
  394. op[opc_dup] := "dup";
  395. op[opc_dup_x1] := "dup_x1";
  396. op[opc_dup_x2] := "dup_x2";
  397. op[opc_dup2] := "dup2";
  398. op[opc_dup2_x1] := "dup2_x1";
  399. op[opc_dup2_x2] := "dup2_x2";
  400. op[opc_swap] := "swap";
  401. op[opc_iadd] := "iadd";
  402. op[opc_ladd] := "ladd";
  403. op[opc_fadd] := "fadd";
  404. op[opc_dadd] := "dadd";
  405. op[opc_isub] := "isub";
  406. op[opc_lsub] := "lsub";
  407. op[opc_fsub] := "fsub";
  408. op[opc_dsub] := "dsub";
  409. op[opc_imul] := "imul";
  410. op[opc_lmul] := "lmul";
  411. op[opc_fmul] := "fmul";
  412. op[opc_dmul] := "dmul";
  413. op[opc_idiv] := "idiv";
  414. op[opc_ldiv] := "ldiv";
  415. op[opc_fdiv] := "fdiv";
  416. op[opc_ddiv] := "ddiv";
  417. op[opc_irem] := "irem";
  418. op[opc_lrem] := "lrem";
  419. op[opc_frem] := "frem";
  420. op[opc_drem] := "drem";
  421. op[opc_ineg] := "ineg";
  422. op[opc_lneg] := "lneg";
  423. op[opc_fneg] := "fneg";
  424. op[opc_dneg] := "dneg";
  425. op[opc_ishl] := "ishl";
  426. op[opc_lshl] := "lshl";
  427. op[opc_ishr] := "ishr";
  428. op[opc_lshr] := "lshr";
  429. op[opc_iushr] := "iushr";
  430. op[opc_lushr] := "lushr";
  431. op[opc_iand] := "iand";
  432. op[opc_land] := "land";
  433. op[opc_ior] := "ior";
  434. op[opc_lor] := "lor";
  435. op[opc_ixor] := "ixor";
  436. op[opc_lxor] := "lxor";
  437. op[opc_iinc] := "iinc";
  438. op[opc_i2l] := "i2l";
  439. op[opc_i2f] := "i2f";
  440. op[opc_i2d] := "i2d";
  441. op[opc_l2i] := "l2i";
  442. op[opc_l2f] := "l2f";
  443. op[opc_l2d] := "l2d";
  444. op[opc_f2i] := "f2i";
  445. op[opc_f2l] := "f2l";
  446. op[opc_f2d] := "f2d";
  447. op[opc_d2i] := "d2i";
  448. op[opc_d2l] := "d2l";
  449. op[opc_d2f] := "d2f";
  450. op[opc_i2b] := "i2b";
  451. op[opc_i2c] := "i2c";
  452. op[opc_i2s] := "i2s";
  453. op[opc_lcmp] := "lcmp";
  454. op[opc_fcmpl] := "fcmpl";
  455. op[opc_fcmpg] := "fcmpg";
  456. op[opc_dcmpl] := "dcmpl";
  457. op[opc_dcmpg] := "dcmpg";
  458. op[opc_ifeq] := "ifeq";
  459. op[opc_ifne] := "ifne";
  460. op[opc_iflt] := "iflt";
  461. op[opc_ifge] := "ifge";
  462. op[opc_ifgt] := "ifgt";
  463. op[opc_ifle] := "ifle";
  464. op[opc_if_icmpeq] := "if_icmpeq";
  465. op[opc_if_icmpne] := "if_icmpne";
  466. op[opc_if_icmplt] := "if_icmplt";
  467. op[opc_if_icmpge] := "if_icmpge";
  468. op[opc_if_icmpgt] := "if_icmpgt";
  469. op[opc_if_icmple] := "if_icmple";
  470. op[opc_if_acmpeq] := "if_acmpeq";
  471. op[opc_if_acmpne] := "if_acmpne";
  472. op[opc_goto] := "goto";
  473. op[opc_jsr] := "jsr";
  474. op[opc_ret] := "ret";
  475. op[opc_tableswitch] := "tableswitch";
  476. op[opc_lookupswitch] := "lookupswitch";
  477. op[opc_ireturn] := "ireturn";
  478. op[opc_lreturn] := "lreturn";
  479. op[opc_freturn] := "freturn";
  480. op[opc_dreturn] := "dreturn";
  481. op[opc_areturn] := "areturn";
  482. op[opc_return] := "return";
  483. op[opc_getstatic] := "getstatic";
  484. op[opc_putstatic] := "putstatic";
  485. op[opc_getfield] := "getfield";
  486. op[opc_putfield] := "putfield";
  487. op[opc_invokevirtual] := "invokevirtual";
  488. op[opc_invokespecial] := "invokespecial";
  489. op[opc_invokestatic] := "invokestatic";
  490. op[opc_invokeinterface] := "invokeinterface";
  491. op[opc_xxxunusedxxx] := "xxxunusedxxx";
  492. op[opc_new] := "new";
  493. op[opc_newarray] := "newarray";
  494. op[opc_anewarray] := "anewarray";
  495. op[opc_arraylength] := "arraylength";
  496. op[opc_athrow] := "athrow";
  497. op[opc_checkcast] := "checkcast";
  498. op[opc_instanceof] := "instanceof";
  499. op[opc_monitorenter] := "monitorenter";
  500. op[opc_monitorexit] := "monitorexit";
  501. op[opc_wide] := "wide";
  502. op[opc_multianewarray] := "multianewarray";
  503. op[opc_ifnull] := "ifnull";
  504. op[opc_ifnonnull] := "ifnonnull";
  505. op[opc_goto_w] := "goto_w";
  506. op[opc_jsr_w] := "jsr_w";
  507. op[opc_breakpoint] := "breakpoint";
  508. dl[opc_nop] := 0;
  509. dl[opc_aconst_null] := 1;
  510. dl[opc_iconst_m1] := 1;
  511. dl[opc_iconst_0] := 1;
  512. dl[opc_iconst_1] := 1;
  513. dl[opc_iconst_2] := 1;
  514. dl[opc_iconst_3] := 1;
  515. dl[opc_iconst_4] := 1;
  516. dl[opc_iconst_5] := 1;
  517. dl[opc_lconst_0] := 2;
  518. dl[opc_lconst_1] := 2;
  519. dl[opc_fconst_0] := 1;
  520. dl[opc_fconst_1] := 1;
  521. dl[opc_fconst_2] := 1;
  522. dl[opc_dconst_0] := 2;
  523. dl[opc_dconst_1] := 2;
  524. dl[opc_bipush] := 1;
  525. dl[opc_sipush] := 1;
  526. dl[opc_ldc] := 1;
  527. dl[opc_ldc_w] := 1;
  528. dl[opc_ldc2_w] := 2;
  529. dl[opc_iload] := 1;
  530. dl[opc_lload] := 2;
  531. dl[opc_fload] := 1;
  532. dl[opc_dload] := 2;
  533. dl[opc_aload] := 1;
  534. dl[opc_iload_0] := 1;
  535. dl[opc_iload_1] := 1;
  536. dl[opc_iload_2] := 1;
  537. dl[opc_iload_3] := 1;
  538. dl[opc_lload_0] := 2;
  539. dl[opc_lload_1] := 2;
  540. dl[opc_lload_2] := 2;
  541. dl[opc_lload_3] := 2;
  542. dl[opc_fload_0] := 1;
  543. dl[opc_fload_1] := 1;
  544. dl[opc_fload_2] := 1;
  545. dl[opc_fload_3] := 1;
  546. dl[opc_dload_0] := 2;
  547. dl[opc_dload_1] := 2;
  548. dl[opc_dload_2] := 2;
  549. dl[opc_dload_3] := 2;
  550. dl[opc_aload_0] := 1;
  551. dl[opc_aload_1] := 1;
  552. dl[opc_aload_2] := 1;
  553. dl[opc_aload_3] := 1;
  554. dl[opc_iaload] := -1; (* pop 2, push 1 *)
  555. dl[opc_laload] := 0; (* pop 2, push 2 *)
  556. dl[opc_faload] := -1; (* pop 2, push 1 *)
  557. dl[opc_daload] := 0; (* pop 2, push 2 *)
  558. dl[opc_aaload] := -1; (* pop 2, push 1 *)
  559. dl[opc_baload] := -1; (* pop 2, push 1 *)
  560. dl[opc_caload] := -1; (* pop 2, push 1 *)
  561. dl[opc_saload] := -1; (* pop 2, push 1 *)
  562. dl[opc_istore] := -1;
  563. dl[opc_lstore] := -2;
  564. dl[opc_fstore] := -1;
  565. dl[opc_dstore] := -2;
  566. dl[opc_astore] := -1;
  567. dl[opc_istore_0] := -1;
  568. dl[opc_istore_1] := -1;
  569. dl[opc_istore_2] := -1;
  570. dl[opc_istore_3] := -1;
  571. dl[opc_lstore_0] := -2;
  572. dl[opc_lstore_1] := -2;
  573. dl[opc_lstore_2] := -2;
  574. dl[opc_lstore_3] := -2;
  575. dl[opc_fstore_0] := -1;
  576. dl[opc_fstore_1] := -1;
  577. dl[opc_fstore_2] := -1;
  578. dl[opc_fstore_3] := -1;
  579. dl[opc_dstore_0] := -2;
  580. dl[opc_dstore_1] := -2;
  581. dl[opc_dstore_2] := -2;
  582. dl[opc_dstore_3] := -2;
  583. dl[opc_astore_0] := -1;
  584. dl[opc_astore_1] := -1;
  585. dl[opc_astore_2] := -1;
  586. dl[opc_astore_3] := -1;
  587. dl[opc_iastore] := -3;
  588. dl[opc_lastore] := -4;
  589. dl[opc_fastore] := -3;
  590. dl[opc_dastore] := -4;
  591. dl[opc_aastore] := -3;
  592. dl[opc_bastore] := -3;
  593. dl[opc_castore] := -3;
  594. dl[opc_sastore] := -3;
  595. dl[opc_pop] := -1;
  596. dl[opc_pop2] := -2;
  597. dl[opc_dup] := 1;
  598. dl[opc_dup_x1] := 1;
  599. dl[opc_dup_x2] := 1;
  600. dl[opc_dup2] := 2;
  601. dl[opc_dup2_x1] := 2;
  602. dl[opc_dup2_x2] := 2;
  603. dl[opc_swap] := 0;
  604. dl[opc_iadd] := -1;
  605. dl[opc_ladd] := -2;
  606. dl[opc_fadd] := -1;
  607. dl[opc_dadd] := -2;
  608. dl[opc_isub] := -1;
  609. dl[opc_lsub] := -2;
  610. dl[opc_fsub] := -1;
  611. dl[opc_dsub] := -2;
  612. dl[opc_imul] := -1;
  613. dl[opc_lmul] := -2;
  614. dl[opc_fmul] := -1;
  615. dl[opc_dmul] := -2;
  616. dl[opc_idiv] := -1;
  617. dl[opc_ldiv] := -2;
  618. dl[opc_fdiv] := -1;
  619. dl[opc_ddiv] := -2;
  620. dl[opc_irem] := -1;
  621. dl[opc_lrem] := -2;
  622. dl[opc_frem] := -1;
  623. dl[opc_drem] := -2;
  624. dl[opc_ineg] := 0;
  625. dl[opc_lneg] := 0;
  626. dl[opc_fneg] := 0;
  627. dl[opc_dneg] := 0;
  628. dl[opc_ishl] := -1;
  629. dl[opc_lshl] := -1;
  630. dl[opc_ishr] := -1;
  631. dl[opc_lshr] := -1;
  632. dl[opc_iushr] := -1;
  633. dl[opc_lushr] := -1;
  634. dl[opc_iand] := -1;
  635. dl[opc_land] := -2;
  636. dl[opc_ior] := -1;
  637. dl[opc_lor] := -2;
  638. dl[opc_ixor] := -1;
  639. dl[opc_lxor] := -2;
  640. dl[opc_iinc] := 0;
  641. dl[opc_i2l] := 1;
  642. dl[opc_i2f] := 0;
  643. dl[opc_i2d] := 1;
  644. dl[opc_l2i] := -1;
  645. dl[opc_l2f] := -1;
  646. dl[opc_l2d] := 0;
  647. dl[opc_f2i] := 0;
  648. dl[opc_f2l] := 1;
  649. dl[opc_f2d] := 1;
  650. dl[opc_d2i] := -1;
  651. dl[opc_d2l] := 0;
  652. dl[opc_d2f] := -1;
  653. dl[opc_i2b] := 0;
  654. dl[opc_i2c] := 0;
  655. dl[opc_i2s] := 0;
  656. dl[opc_lcmp] := -3;
  657. dl[opc_fcmpl] := -1;
  658. dl[opc_fcmpg] := -1;
  659. dl[opc_dcmpl] := -3;
  660. dl[opc_dcmpg] := -3;
  661. dl[opc_ifeq] := -1;
  662. dl[opc_ifne] := -1;
  663. dl[opc_iflt] := -1;
  664. dl[opc_ifge] := -1;
  665. dl[opc_ifgt] := -1;
  666. dl[opc_ifle] := -1;
  667. dl[opc_if_icmpeq] := -2;
  668. dl[opc_if_icmpne] := -2;
  669. dl[opc_if_icmplt] := -2;
  670. dl[opc_if_icmpge] := -2;
  671. dl[opc_if_icmpgt] := -2;
  672. dl[opc_if_icmple] := -2;
  673. dl[opc_if_acmpeq] := -2;
  674. dl[opc_if_acmpne] := -2;
  675. dl[opc_goto] := 0;
  676. dl[opc_jsr] := 1;
  677. dl[opc_ret] := 0;
  678. dl[opc_tableswitch] := -1;
  679. dl[opc_lookupswitch] := -1;
  680. dl[opc_ireturn] := -1; (* don't care ? *)
  681. dl[opc_lreturn] := -2; (* don't care ? *)
  682. dl[opc_freturn] := -1; (* don't care ? *)
  683. dl[opc_dreturn] := -2; (* don't care ? *)
  684. dl[opc_areturn] := -1; (* don't care ? *)
  685. dl[opc_return] := 0; (* don't care ? *)
  686. (* Defaults for single word load/store short Vs long *)
  687. dl[opc_getstatic] := 1; (* Special case 1 or 2 *)
  688. dl[opc_putstatic] := -1; (* Special case -1 or -2 *)
  689. dl[opc_getfield] := 0; (* Special case 0 or 1 *)
  690. dl[opc_putfield] := -2; (* Special case -2 or -3 *)
  691. dl[opc_invokevirtual] := 0; (* Special case *)
  692. dl[opc_invokespecial] := -1; (* Special case *)
  693. dl[opc_invokestatic] := 0; (* Special case *)
  694. dl[opc_invokeinterface] := 0; (* Special case *)
  695. dl[opc_xxxunusedxxx] := 0;
  696. dl[opc_new] := 1;
  697. dl[opc_newarray] := 0;
  698. dl[opc_anewarray] := 0;
  699. dl[opc_arraylength] := 0;
  700. dl[opc_athrow] := -1; (* don't care *)
  701. dl[opc_checkcast] := 0;
  702. dl[opc_instanceof] := 0;
  703. dl[opc_monitorenter] := -1;
  704. dl[opc_monitorexit] := -1;
  705. dl[opc_wide] := 0;
  706. dl[opc_multianewarray] := 0; (* Special case (1-dim#) *)
  707. dl[opc_ifnull] := -1;
  708. dl[opc_ifnonnull] := -1;
  709. dl[opc_goto_w] := 0;
  710. dl[opc_jsr_w] := 1;
  711. dl[opc_breakpoint] := 0;
  712. END JVMcodes.
  713. (* ============================================================ *)