-/* jit/jit.c - calls the code generation functions
+/* src/vm/jit/jit.c - calls the code generation functions
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
- R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
- M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
- P. Tomsich, J. Wenninger
+ Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+ R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+ C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+ Institut f. Computersprachen - TU Wien
This file is part of CACAO.
Reinhard Grafl
Changes: Edwin Steiner
+ Christian Thalinger
- $Id: jit.c 1415 2004-10-11 20:12:08Z jowenn $
+ $Id: jit.c 2038 2005-03-20 11:22:40Z twisti $
*/
#include <stdlib.h>
-#include <string.h>
-#include "global.h"
-#include "tables.h"
-#include "loader.h"
-#include "builtin.h"
-#include "native.h"
-#include "asmpart.h"
+
+#include "config.h"
#include "codegen.h"
-#include "types.h"
-#include "options.h"
-#include "statistics.h"
-#include "jit/codegen.inc.h"
-#include "jit/inline.h"
-#include "jit/jit.h"
-#include "jit/parse.h"
-#include "jit/stack.h"
-#include "jit/reg.h"
-#include "jit/typecheck.h"
-#include "threads/thread.h"
#include "disass.h"
-#include "loop/loop.h"
-#include "loop/graph.h"
-#include "loop/analyze.h"
-#include "toolbox/logging.h"
-#include "toolbox/memory.h"
#include "types.h"
-#include <stdio.h>
+#include "mm/memory.h"
+#include "toolbox/logging.h"
+#include "vm/builtin.h"
+#include "vm/global.h"
+#include "vm/loader.h"
+#include "vm/options.h"
+#include "vm/statistics.h"
+#include "vm/tables.h"
+#include "vm/jit/codegen.inc.h"
+#include "vm/jit/jit.h"
+#ifdef LSRA
+#include "vm/jit/lsra.h"
+#endif
+#include "vm/jit/parse.h"
+#include "vm/jit/reg.h"
+#include "vm/jit/stack.h"
+#include "vm/jit/inline/inline.h"
+#include "vm/jit/inline/parseRT.h"
+#include "vm/jit/inline/parseXTA.h"
+#include "vm/jit/loop/analyze.h"
+#include "vm/jit/loop/graph.h"
+#include "vm/jit/loop/loop.h"
+#include "vm/jit/verify/typecheck.h"
+
+#if defined(USE_THREADS)
+# if defined(NATIVE_THREADS)
+# include "threads/native/threads.h"
+# else
+# include "threads/green/threads.h"
+# endif
+#endif
+
+
/* global switches ************************************************************/
int stackreq[256];
-#if defined(__I386__)
-/* these define if a method has ICMDs which use %edx or %ecx */
-bool method_uses_ecx;
-bool method_uses_edx;
-#endif
-
-
int jcommandsize[256] = {
#define JAVA_NOP 0
1,
#define ICMD_SASTORECONST 211
1,
+#define ICMD_PUTSTATICCONST 212
+ 1,
+#define ICMD_PUTFIELDCONST 213
+ 1,
+#define ICMD_IMULPOW2 214
+ 1,
+#define ICMD_LMULPOW2 215
+ 1,
/* unused */
- 1,1,1,1,1,1,1,1,
+ 1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
char *icmd_names[256] = {
- "NOP ", /* 0 */
- "ACONST ", /* 1 */
- "NULLCHECKPOP ", /* ICONST_M1 2 */
- "ICONST ", /* 3 */
- "UNDEF4 ", /* ICONST_1 4 */
- "IDIVPOW2 ", /* ICONST_2 5 */
- "LDIVPOW2 ", /* ICONST_3 6 */
- "UNDEF7 ", /* ICONST_4 7 */
- "UNDEF8 ", /* ICONST_5 8 */
- "LCONST ", /* 9 */
- "LCMPCONST ", /* LCONST_1 10 */
- "FCONST ", /* 11 */
- "UNDEF12 ", /* FCONST_1 12 */
- "ELSE_ICONST ", /* FCONST_2 13 */
- "DCONST ", /* 14 */
- "IFEQ_ICONST ", /* DCONST_1 15 */
- "IFNE_ICONST ", /* BIPUSH 16 */
- "IFLT_ICONST ", /* SIPUSH 17 */
- "IFGE_ICONST ", /* LDC1 18 */
- "IFGT_ICONST ", /* LDC2 19 */
- "IFLE_ICONST ", /* LDC2W 20 */
- "ILOAD ", /* 21 */
- "LLOAD ", /* 22 */
- "FLOAD ", /* 23 */
- "DLOAD ", /* 24 */
- "ALOAD ", /* 25 */
- "IADDCONST ", /* ILOAD_0 26 */
- "ISUBCONST ", /* ILOAD_1 27 */
- "IMULCONST ", /* ILOAD_2 28 */
- "IANDCONST ", /* ILOAD_3 29 */
- "IORCONST ", /* LLOAD_0 30 */
- "IXORCONST ", /* LLOAD_1 31 */
- "ISHLCONST ", /* LLOAD_2 32 */
- "ISHRCONST ", /* LLOAD_3 33 */
- "IUSHRCONST ", /* FLOAD_0 34 */
- "IREMPOW2 ", /* FLOAD_1 35 */
- "LADDCONST ", /* FLOAD_2 36 */
- "LSUBCONST ", /* FLOAD_3 37 */
- "LMULCONST ", /* DLOAD_0 38 */
- "LANDCONST ", /* DLOAD_1 39 */
- "LORCONST ", /* DLOAD_2 40 */
- "LXORCONST ", /* DLOAD_3 41 */
- "LSHLCONST ", /* ALOAD_0 42 */
- "LSHRCONST ", /* ALOAD_1 43 */
- "LUSHRCONST ", /* ALOAD_2 44 */
- "LREMPOW2 ", /* ALOAD_3 45 */
- "IALOAD ", /* 46 */
- "LALOAD ", /* 47 */
- "FALOAD ", /* 48 */
- "DALOAD ", /* 49 */
- "AALOAD ", /* 50 */
- "BALOAD ", /* 51 */
- "CALOAD ", /* 52 */
- "SALOAD ", /* 53 */
- "ISTORE ", /* 54 */
- "LSTORE ", /* 55 */
- "FSTORE ", /* 56 */
- "DSTORE ", /* 57 */
- "ASTORE ", /* 58 */
- "IF_LEQ ", /* ISTORE_0 59 */
- "IF_LNE ", /* ISTORE_1 60 */
- "IF_LLT ", /* ISTORE_2 61 */
- "IF_LGE ", /* ISTORE_3 62 */
- "IF_LGT ", /* LSTORE_0 63 */
- "IF_LLE ", /* LSTORE_1 64 */
- "IF_LCMPEQ ", /* LSTORE_2 65 */
- "IF_LCMPNE ", /* LSTORE_3 66 */
- "IF_LCMPLT ", /* FSTORE_0 67 */
- "IF_LCMPGE ", /* FSTORE_1 68 */
- "IF_LCMPGT ", /* FSTORE_2 69 */
- "IF_LCMPLE ", /* FSTORE_3 70 */
- "UNDEF71 ", /* DSTORE_0 71 */
- "UNDEF72 ", /* DSTORE_1 72 */
- "UNDEF73 ", /* DSTORE_2 73 */
- "UNDEF74 ", /* DSTORE_3 74 */
- "UNDEF75 ", /* ASTORE_0 75 */
- "UNDEF76 ", /* ASTORE_1 76 */
- "UNDEF77 ", /* ASTORE_2 77 */
- "UNDEF78 ", /* ASTORE_3 78 */
- "IASTORE ", /* 79 */
- "LASTORE ", /* 80 */
- "FASTORE ", /* 81 */
- "DASTORE ", /* 82 */
- "AASTORE ", /* 83 */
- "BASTORE ", /* 84 */
- "CASTORE ", /* 85 */
- "SASTORE ", /* 86 */
- "POP ", /* 87 */
- "POP2 ", /* 88 */
- "DUP ", /* 89 */
- "DUP_X1 ", /* 90 */
- "DUP_X2 ", /* 91 */
- "DUP2 ", /* 92 */
- "DUP2_X1 ", /* 93 */
- "DUP2_X2 ", /* 94 */
- "SWAP ", /* 95 */
- "IADD ", /* 96 */
- "LADD ", /* 97 */
- "FADD ", /* 98 */
- "DADD ", /* 99 */
- "ISUB ", /* 100 */
- "LSUB ", /* 101 */
- "FSUB ", /* 102 */
- "DSUB ", /* 103 */
- "IMUL ", /* 104 */
- "LMUL ", /* 105 */
- "FMUL ", /* 106 */
- "DMUL ", /* 107 */
- "IDIV ", /* 108 */
- "LDIV ", /* 109 */
- "FDIV ", /* 110 */
- "DDIV ", /* 111 */
- "IREM ", /* 112 */
- "LREM ", /* 113 */
- "FREM ", /* 114 */
- "DREM ", /* 115 */
- "INEG ", /* 116 */
- "LNEG ", /* 117 */
- "FNEG ", /* 118 */
- "DNEG ", /* 119 */
- "ISHL ", /* 120 */
- "LSHL ", /* 121 */
- "ISHR ", /* 122 */
- "LSHR ", /* 123 */
- "IUSHR ", /* 124 */
- "LUSHR ", /* 125 */
- "IAND ", /* 126 */
- "LAND ", /* 127 */
- "IOR ", /* 128 */
- "LOR ", /* 129 */
- "IXOR ", /* 130 */
- "LXOR ", /* 131 */
- "IINC ", /* 132 */
- "I2L ", /* 133 */
- "I2F ", /* 134 */
- "I2D ", /* 135 */
- "L2I ", /* 136 */
- "L2F ", /* 137 */
- "L2D ", /* 138 */
- "F2I ", /* 139 */
- "F2L ", /* 140 */
- "F2D ", /* 141 */
- "D2I ", /* 142 */
- "D2L ", /* 143 */
- "D2F ", /* 144 */
- "INT2BYTE ", /* 145 */
- "INT2CHAR ", /* 146 */
- "INT2SHORT ", /* 147 */
- "LCMP ", /* 148 */
- "FCMPL ", /* 149 */
- "FCMPG ", /* 150 */
- "DCMPL ", /* 151 */
- "DCMPG ", /* 152 */
- "IFEQ ", /* 153 */
- "IFNE ", /* 154 */
- "IFLT ", /* 155 */
- "IFGE ", /* 156 */
- "IFGT ", /* 157 */
- "IFLE ", /* 158 */
- "IF_ICMPEQ ", /* 159 */
- "IF_ICMPNE ", /* 160 */
- "IF_ICMPLT ", /* 161 */
- "IF_ICMPGE ", /* 162 */
- "IF_ICMPGT ", /* 163 */
- "IF_ICMPLE ", /* 164 */
- "IF_ACMPEQ ", /* 165 */
- "IF_ACMPNE ", /* 166 */
- "GOTO ", /* 167 */
- "JSR ", /* 168 */
- "RET ", /* 169 */
- "TABLESWITCH ", /* 170 */
- "LOOKUPSWITCH ", /* 171 */
- "IRETURN ", /* 172 */
- "LRETURN ", /* 173 */
- "FRETURN ", /* 174 */
- "DRETURN ", /* 175 */
- "ARETURN ", /* 176 */
- "RETURN ", /* 177 */
- "GETSTATIC ", /* 178 */
- "PUTSTATIC ", /* 179 */
- "GETFIELD ", /* 180 */
- "PUTFIELD ", /* 181 */
- "INVOKEVIRTUAL", /* 182 */
- "INVOKESPECIAL", /* 183 */
- "INVOKESTATIC ", /* 184 */
- "INVOKEINTERFACE",/* 185 */
- "CHECKASIZE ", /* UNDEF186 186 */
- "NEW ", /* 187 */
- "NEWARRAY ", /* 188 */
- "ANEWARRAY ", /* 189 */
- "ARRAYLENGTH ", /* 190 */
- "ATHROW ", /* 191 */
- "CHECKCAST ", /* 192 */
- "INSTANCEOF ", /* 193 */
- "MONITORENTER ", /* 194 */
- "MONITOREXIT ", /* 195 */
- "UNDEF196 ", /* WIDE 196 */
- "MULTIANEWARRAY",/* 197 */
- "IFNULL ", /* 198 */
- "IFNONNULL ", /* 199 */
- "UNDEF200 ", /* GOTO_W 200 */
- "UNDEF201 ", /* JSR_W 201 */
- "UNDEF202 ", /* BREAKPOINT 202 */
- "CHECKEXCEPTION", /* UNDEF203 203 */
- "IASTORECONST ", /* 204 */
- "LASTORECONST ", /* 205 */
- "FASTORECONST ", /* 206 */
- "DASTORECONST ", /* 207 */
- "AASTORECONST ", /* 208 */
- "BASTORECONST ", /* 209 */
- "CASTORECONST ", /* 210 */
- "SASTORECONST ", /* 211 */
- "UNDEF","UNDEF","UNDEF","UNDEF",
- "UNDEF216","UNDEF217","UNDEF218","UNDEF219","UNDEF220",
- "UNDEF","UNDEF","UNDEF","UNDEF","UNDEF",
- "UNDEF226","UNDEF227","UNDEF228","UNDEF229","UNDEF230",
- "UNDEF","UNDEF","UNDEF","UNDEF","UNDEF",
- "UNDEF236","UNDEF237","UNDEF238","UNDEF239","UNDEF240",
- "UNDEF","UNDEF","UNDEF","UNDEF","UNDEF",
- "UNDEF246","UNDEF247","UNDEF248","UNDEF249","UNDEF250",
- "UNDEF251","UNDEF252",
-
- "BUILTIN3 ", /* 253 */
- "BUILTIN2 ", /* 254 */
- "BUILTIN1 " /* 255 */
+ "NOP ", /* 0 */
+ "ACONST ", /* 1 */
+ "NULLCHECKPOP ", /* ICONST_M1 2 */
+ "ICONST ", /* 3 */
+ "UNDEF4 ", /* ICONST_1 4 */
+ "IDIVPOW2 ", /* ICONST_2 5 */
+ "LDIVPOW2 ", /* ICONST_3 6 */
+ "UNDEF7 ", /* ICONST_4 7 */
+ "UNDEF8 ", /* ICONST_5 8 */
+ "LCONST ", /* 9 */
+ "LCMPCONST ", /* LCONST_1 10 */
+ "FCONST ", /* 11 */
+ "UNDEF12 ", /* FCONST_1 12 */
+ "ELSE_ICONST ", /* FCONST_2 13 */
+ "DCONST ", /* 14 */
+ "IFEQ_ICONST ", /* DCONST_1 15 */
+ "IFNE_ICONST ", /* BIPUSH 16 */
+ "IFLT_ICONST ", /* SIPUSH 17 */
+ "IFGE_ICONST ", /* LDC1 18 */
+ "IFGT_ICONST ", /* LDC2 19 */
+ "IFLE_ICONST ", /* LDC2W 20 */
+ "ILOAD ", /* 21 */
+ "LLOAD ", /* 22 */
+ "FLOAD ", /* 23 */
+ "DLOAD ", /* 24 */
+ "ALOAD ", /* 25 */
+ "IADDCONST ", /* ILOAD_0 26 */
+ "ISUBCONST ", /* ILOAD_1 27 */
+ "IMULCONST ", /* ILOAD_2 28 */
+ "IANDCONST ", /* ILOAD_3 29 */
+ "IORCONST ", /* LLOAD_0 30 */
+ "IXORCONST ", /* LLOAD_1 31 */
+ "ISHLCONST ", /* LLOAD_2 32 */
+ "ISHRCONST ", /* LLOAD_3 33 */
+ "IUSHRCONST ", /* FLOAD_0 34 */
+ "IREMPOW2 ", /* FLOAD_1 35 */
+ "LADDCONST ", /* FLOAD_2 36 */
+ "LSUBCONST ", /* FLOAD_3 37 */
+ "LMULCONST ", /* DLOAD_0 38 */
+ "LANDCONST ", /* DLOAD_1 39 */
+ "LORCONST ", /* DLOAD_2 40 */
+ "LXORCONST ", /* DLOAD_3 41 */
+ "LSHLCONST ", /* ALOAD_0 42 */
+ "LSHRCONST ", /* ALOAD_1 43 */
+ "LUSHRCONST ", /* ALOAD_2 44 */
+ "LREMPOW2 ", /* ALOAD_3 45 */
+ "IALOAD ", /* 46 */
+ "LALOAD ", /* 47 */
+ "FALOAD ", /* 48 */
+ "DALOAD ", /* 49 */
+ "AALOAD ", /* 50 */
+ "BALOAD ", /* 51 */
+ "CALOAD ", /* 52 */
+ "SALOAD ", /* 53 */
+ "ISTORE ", /* 54 */
+ "LSTORE ", /* 55 */
+ "FSTORE ", /* 56 */
+ "DSTORE ", /* 57 */
+ "ASTORE ", /* 58 */
+ "IF_LEQ ", /* ISTORE_0 59 */
+ "IF_LNE ", /* ISTORE_1 60 */
+ "IF_LLT ", /* ISTORE_2 61 */
+ "IF_LGE ", /* ISTORE_3 62 */
+ "IF_LGT ", /* LSTORE_0 63 */
+ "IF_LLE ", /* LSTORE_1 64 */
+ "IF_LCMPEQ ", /* LSTORE_2 65 */
+ "IF_LCMPNE ", /* LSTORE_3 66 */
+ "IF_LCMPLT ", /* FSTORE_0 67 */
+ "IF_LCMPGE ", /* FSTORE_1 68 */
+ "IF_LCMPGT ", /* FSTORE_2 69 */
+ "IF_LCMPLE ", /* FSTORE_3 70 */
+ "UNDEF71 ", /* DSTORE_0 71 */
+ "UNDEF72 ", /* DSTORE_1 72 */
+ "UNDEF73 ", /* DSTORE_2 73 */
+ "UNDEF74 ", /* DSTORE_3 74 */
+ "UNDEF75 ", /* ASTORE_0 75 */
+ "UNDEF76 ", /* ASTORE_1 76 */
+ "UNDEF77 ", /* ASTORE_2 77 */
+ "UNDEF78 ", /* ASTORE_3 78 */
+ "IASTORE ", /* 79 */
+ "LASTORE ", /* 80 */
+ "FASTORE ", /* 81 */
+ "DASTORE ", /* 82 */
+ "AASTORE ", /* 83 */
+ "BASTORE ", /* 84 */
+ "CASTORE ", /* 85 */
+ "SASTORE ", /* 86 */
+ "POP ", /* 87 */
+ "POP2 ", /* 88 */
+ "DUP ", /* 89 */
+ "DUP_X1 ", /* 90 */
+ "DUP_X2 ", /* 91 */
+ "DUP2 ", /* 92 */
+ "DUP2_X1 ", /* 93 */
+ "DUP2_X2 ", /* 94 */
+ "SWAP ", /* 95 */
+ "IADD ", /* 96 */
+ "LADD ", /* 97 */
+ "FADD ", /* 98 */
+ "DADD ", /* 99 */
+ "ISUB ", /* 100 */
+ "LSUB ", /* 101 */
+ "FSUB ", /* 102 */
+ "DSUB ", /* 103 */
+ "IMUL ", /* 104 */
+ "LMUL ", /* 105 */
+ "FMUL ", /* 106 */
+ "DMUL ", /* 107 */
+ "IDIV ", /* 108 */
+ "LDIV ", /* 109 */
+ "FDIV ", /* 110 */
+ "DDIV ", /* 111 */
+ "IREM ", /* 112 */
+ "LREM ", /* 113 */
+ "FREM ", /* 114 */
+ "DREM ", /* 115 */
+ "INEG ", /* 116 */
+ "LNEG ", /* 117 */
+ "FNEG ", /* 118 */
+ "DNEG ", /* 119 */
+ "ISHL ", /* 120 */
+ "LSHL ", /* 121 */
+ "ISHR ", /* 122 */
+ "LSHR ", /* 123 */
+ "IUSHR ", /* 124 */
+ "LUSHR ", /* 125 */
+ "IAND ", /* 126 */
+ "LAND ", /* 127 */
+ "IOR ", /* 128 */
+ "LOR ", /* 129 */
+ "IXOR ", /* 130 */
+ "LXOR ", /* 131 */
+ "IINC ", /* 132 */
+ "I2L ", /* 133 */
+ "I2F ", /* 134 */
+ "I2D ", /* 135 */
+ "L2I ", /* 136 */
+ "L2F ", /* 137 */
+ "L2D ", /* 138 */
+ "F2I ", /* 139 */
+ "F2L ", /* 140 */
+ "F2D ", /* 141 */
+ "D2I ", /* 142 */
+ "D2L ", /* 143 */
+ "D2F ", /* 144 */
+ "INT2BYTE ", /* 145 */
+ "INT2CHAR ", /* 146 */
+ "INT2SHORT ", /* 147 */
+ "LCMP ", /* 148 */
+ "FCMPL ", /* 149 */
+ "FCMPG ", /* 150 */
+ "DCMPL ", /* 151 */
+ "DCMPG ", /* 152 */
+ "IFEQ ", /* 153 */
+ "IFNE ", /* 154 */
+ "IFLT ", /* 155 */
+ "IFGE ", /* 156 */
+ "IFGT ", /* 157 */
+ "IFLE ", /* 158 */
+ "IF_ICMPEQ ", /* 159 */
+ "IF_ICMPNE ", /* 160 */
+ "IF_ICMPLT ", /* 161 */
+ "IF_ICMPGE ", /* 162 */
+ "IF_ICMPGT ", /* 163 */
+ "IF_ICMPLE ", /* 164 */
+ "IF_ACMPEQ ", /* 165 */
+ "IF_ACMPNE ", /* 166 */
+ "GOTO ", /* 167 */
+ "JSR ", /* 168 */
+ "RET ", /* 169 */
+ "TABLESWITCH ", /* 170 */
+ "LOOKUPSWITCH ", /* 171 */
+ "IRETURN ", /* 172 */
+ "LRETURN ", /* 173 */
+ "FRETURN ", /* 174 */
+ "DRETURN ", /* 175 */
+ "ARETURN ", /* 176 */
+ "RETURN ", /* 177 */
+ "GETSTATIC ", /* 178 */
+ "PUTSTATIC ", /* 179 */
+ "GETFIELD ", /* 180 */
+ "PUTFIELD ", /* 181 */
+ "INVOKEVIRTUAL ", /* 182 */
+ "INVOKESPECIAL ", /* 183 */
+ "INVOKESTATIC ", /* 184 */
+ "INVOKEINTERFACE", /* 185 */
+ "CHECKASIZE ", /* UNDEF186 186 */
+ "NEW ", /* 187 */
+ "NEWARRAY ", /* 188 */
+ "ANEWARRAY ", /* 189 */
+ "ARRAYLENGTH ", /* 190 */
+ "ATHROW ", /* 191 */
+ "CHECKCAST ", /* 192 */
+ "INSTANCEOF ", /* 193 */
+ "MONITORENTER ", /* 194 */
+ "MONITOREXIT ", /* 195 */
+ "UNDEF196 ", /* WIDE 196 */
+ "MULTIANEWARRAY ", /* 197 */
+ "IFNULL ", /* 198 */
+ "IFNONNULL ", /* 199 */
+ "UNDEF200 ", /* GOTO_W 200 */
+ "UNDEF201 ", /* JSR_W 201 */
+ "UNDEF202 ", /* BREAKPOINT 202 */
+ "CHECKEXCEPTION ", /* UNDEF203 203 */
+ "IASTORECONST ", /* 204 */
+ "LASTORECONST ", /* 205 */
+ "FASTORECONST ", /* 206 */
+ "DASTORECONST ", /* 207 */
+ "AASTORECONST ", /* 208 */
+ "BASTORECONST ", /* 209 */
+ "CASTORECONST ", /* 210 */
+ "SASTORECONST ", /* 211 */
+ "PUTSTATICCONST ", /* 212 */
+ "PUTFIELDCONST ", /* 213 */
+ "IMULPOW2 ", /* 214 */
+ "LMULPOW2 ", /* 215 */
+
+ "UNDEF216", "UNDEF217", "UNDEF218", "UNDEF219", "UNDEF220",
+ "UNDEF221", "UNDEF222", "UNDEF223", "UNDEF224", "UNDEF225",
+ "UNDEF226", "UNDEF227", "UNDEF228", "UNDEF229", "UNDEF230",
+ "UNDEF231", "UNDEF232", "UNDEF233", "UNDEF234", "UNDEF235",
+ "UNDEF236", "UNDEF237", "UNDEF238", "UNDEF239", "UNDEF240",
+ "UNDEF241", "UNDEF242", "UNDEF243", "UNDEF244", "UNDEF245",
+ "UNDEF246", "UNDEF247", "UNDEF248", "UNDEF249", "UNDEF250",
+
+ "INLINE_START ", /* 251 */
+ "INLINE_END ", /* 252 */
+
+ "BUILTIN3 ", /* 253 */
+ "BUILTIN2 ", /* 254 */
+ "BUILTIN1 " /* 255 */
};
char *opcode_names[256] = {
- "NOP ", /* 0 */
- "ACONST ", /* 1 */
- "ICONST_M1 ", /* ICONST_M1 2 */
- "ICONST_0 ", /* ICONST_0 3 */
- "ICONST_1 ", /* ICONST_1 4 */
- "ICONST_2 ", /* ICONST_2 5 */
- "ICONST_3 ", /* ICONST_3 6 */
- "ICONST_4 ", /* ICONST_4 7 */
- "ICONST_5 ", /* ICONST_5 8 */
- "LCONST_0 ", /* LCONST_0 9 */
- "LCONST_1 ", /* LCONST_1 10 */
- "FCONST_0 ", /* FCONST_0 11 */
- "FCONST_1 ", /* FCONST_1 12 */
- "FCONST_2 ", /* FCONST_2 13 */
- "DCONST_0 ", /* DCONST_0 14 */
- "DCONST_1 ", /* DCONST_1 15 */
- "BIPUSH ", /* BIPUSH 16 */
- "SIPUSH ", /* SIPUSH 17 */
- "LDC ", /* LDC 18 */
- "LDC_W ", /* LDC_W 19 */
- "LDC2_W ", /* LDC2_W 20 */
- "ILOAD ", /* 21 */
- "LLOAD ", /* 22 */
- "FLOAD ", /* 23 */
- "DLOAD ", /* 24 */
- "ALOAD ", /* 25 */
- "ILOAD_0 ", /* ILOAD_0 26 */
- "ILOAD_1 ", /* ILOAD_1 27 */
- "ILOAD_2 ", /* ILOAD_2 28 */
- "ILOAD_3 ", /* ILOAD_3 29 */
- "LLOAD_0 ", /* LLOAD_0 30 */
- "LLOAD_1 ", /* LLOAD_1 31 */
- "LLOAD_2 ", /* LLOAD_2 32 */
- "LLOAD_3 ", /* LLOAD_3 33 */
- "FLOAD_0 ", /* FLOAD_0 34 */
- "FLOAD_1 ", /* FLOAD_1 35 */
- "FLOAD_2 ", /* FLOAD_2 36 */
- "FLOAD_3 ", /* FLOAD_3 37 */
- "DLOAD_0 ", /* DLOAD_0 38 */
- "DLOAD_1 ", /* DLOAD_1 39 */
- "DLOAD_2 ", /* DLOAD_2 40 */
- "DLOAD_3 ", /* DLOAD_3 41 */
- "ALOAD_0 ", /* ALOAD_0 42 */
- "ALOAD_1 ", /* ALOAD_1 43 */
- "ALOAD_2 ", /* ALOAD_2 44 */
- "ALOAD_3 ", /* ALOAD_3 45 */
- "IALOAD ", /* 46 */
- "LALOAD ", /* 47 */
- "FALOAD ", /* 48 */
- "DALOAD ", /* 49 */
- "AALOAD ", /* 50 */
- "BALOAD ", /* 51 */
- "CALOAD ", /* 52 */
- "SALOAD ", /* 53 */
- "ISTORE ", /* 54 */
- "LSTORE ", /* 55 */
- "FSTORE ", /* 56 */
- "DSTORE ", /* 57 */
- "ASTORE ", /* 58 */
- "ISTORE_0 ", /* ISTORE_0 59 */
- "ISTORE_1 ", /* ISTORE_1 60 */
- "ISTORE_2 ", /* ISTORE_2 61 */
- "ISTORE_3 ", /* ISTORE_3 62 */
- "LSTORE_0 ", /* LSTORE_0 63 */
- "LSTORE_1 ", /* LSTORE_1 64 */
- "LSTORE_2 ", /* LSTORE_2 65 */
- "LSTORE_3 ", /* LSTORE_3 66 */
- "FSTORE_0 ", /* FSTORE_0 67 */
- "FSTORE_1 ", /* FSTORE_1 68 */
- "FSTORE_2 ", /* FSTORE_2 69 */
- "FSTORE_3 ", /* FSTORE_3 70 */
- "DSTORE_0 ", /* DSTORE_0 71 */
- "DSTORE_1 ", /* DSTORE_1 72 */
- "DSTORE_2 ", /* DSTORE_2 73 */
- "DSTORE_3 ", /* DSTORE_3 74 */
- "ASTORE_0 ", /* ASTORE_0 75 */
- "ASTORE_1 ", /* ASTORE_1 76 */
- "ASTORE_2 ", /* ASTORE_2 77 */
- "ASTORE_3 ", /* ASTORE_3 78 */
- "IASTORE ", /* 79 */
- "LASTORE ", /* 80 */
- "FASTORE ", /* 81 */
- "DASTORE ", /* 82 */
- "AASTORE ", /* 83 */
- "BASTORE ", /* 84 */
- "CASTORE ", /* 85 */
- "SASTORE ", /* 86 */
- "POP ", /* 87 */
- "POP2 ", /* 88 */
- "DUP ", /* 89 */
- "DUP_X1 ", /* 90 */
- "DUP_X2 ", /* 91 */
- "DUP2 ", /* 92 */
- "DUP2_X1 ", /* 93 */
- "DUP2_X2 ", /* 94 */
- "SWAP ", /* 95 */
- "IADD ", /* 96 */
- "LADD ", /* 97 */
- "FADD ", /* 98 */
- "DADD ", /* 99 */
- "ISUB ", /* 100 */
- "LSUB ", /* 101 */
- "FSUB ", /* 102 */
- "DSUB ", /* 103 */
- "IMUL ", /* 104 */
- "LMUL ", /* 105 */
- "FMUL ", /* 106 */
- "DMUL ", /* 107 */
- "IDIV ", /* 108 */
- "LDIV ", /* 109 */
- "FDIV ", /* 110 */
- "DDIV ", /* 111 */
- "IREM ", /* 112 */
- "LREM ", /* 113 */
- "FREM ", /* 114 */
- "DREM ", /* 115 */
- "INEG ", /* 116 */
- "LNEG ", /* 117 */
- "FNEG ", /* 118 */
- "DNEG ", /* 119 */
- "ISHL ", /* 120 */
- "LSHL ", /* 121 */
- "ISHR ", /* 122 */
- "LSHR ", /* 123 */
- "IUSHR ", /* 124 */
- "LUSHR ", /* 125 */
- "IAND ", /* 126 */
- "LAND ", /* 127 */
- "IOR ", /* 128 */
- "LOR ", /* 129 */
- "IXOR ", /* 130 */
- "LXOR ", /* 131 */
- "IINC ", /* 132 */
- "I2L ", /* 133 */
- "I2F ", /* 134 */
- "I2D ", /* 135 */
- "L2I ", /* 136 */
- "L2F ", /* 137 */
- "L2D ", /* 138 */
- "F2I ", /* 139 */
- "F2L ", /* 140 */
- "F2D ", /* 141 */
- "D2I ", /* 142 */
- "D2L ", /* 143 */
- "D2F ", /* 144 */
- "INT2BYTE ", /* 145 */
- "INT2CHAR ", /* 146 */
- "INT2SHORT ", /* 147 */
- "LCMP ", /* 148 */
- "FCMPL ", /* 149 */
- "FCMPG ", /* 150 */
- "DCMPL ", /* 151 */
- "DCMPG ", /* 152 */
- "IFEQ ", /* 153 */
- "IFNE ", /* 154 */
- "IFLT ", /* 155 */
- "IFGE ", /* 156 */
- "IFGT ", /* 157 */
- "IFLE ", /* 158 */
- "IF_ICMPEQ ", /* 159 */
- "IF_ICMPNE ", /* 160 */
- "IF_ICMPLT ", /* 161 */
- "IF_ICMPGE ", /* 162 */
- "IF_ICMPGT ", /* 163 */
- "IF_ICMPLE ", /* 164 */
- "IF_ACMPEQ ", /* 165 */
- "IF_ACMPNE ", /* 166 */
- "GOTO ", /* 167 */
- "JSR ", /* 168 */
- "RET ", /* 169 */
- "TABLESWITCH ", /* 170 */
- "LOOKUPSWITCH ", /* 171 */
- "IRETURN ", /* 172 */
- "LRETURN ", /* 173 */
- "FRETURN ", /* 174 */
- "DRETURN ", /* 175 */
- "ARETURN ", /* 176 */
- "RETURN ", /* 177 */
- "GETSTATIC ", /* 178 */
- "PUTSTATIC ", /* 179 */
- "GETFIELD ", /* 180 */
- "PUTFIELD ", /* 181 */
- "INVOKEVIRTUAL", /* 182 */
- "INVOKESPECIAL", /* 183 */
- "INVOKESTATIC ", /* 184 */
- "INVOKEINTERFACE",/* 185 */
- "CHECKASIZE ", /* UNDEF186 186 */
- "NEW ", /* 187 */
- "NEWARRAY ", /* 188 */
- "ANEWARRAY ", /* 189 */
- "ARRAYLENGTH ", /* 190 */
- "ATHROW ", /* 191 */
- "CHECKCAST ", /* 192 */
- "INSTANCEOF ", /* 193 */
- "MONITORENTER ", /* 194 */
- "MONITOREXIT ", /* 195 */
- "WIDE ", /* WIDE 196 */
- "MULTIANEWARRAY",/* 197 */
- "IFNULL ", /* 198 */
- "IFNONNULL ", /* 199 */
- "GOTO_W ", /* GOTO_W 200 */
- "JSR_W ", /* JSR_W 201 */
- "BREAKPOINT ", /* BREAKPOINT 202 */
- "CHECKEXCEPTION", /* UNDEF203 203 */
- "IASTORECONST ", /* 204 */
- "LASTORECONST ", /* 205 */
- "FASTORECONST ", /* 206 */
- "DASTORECONST ", /* 207 */
- "AASTORECONST ", /* 208 */
- "BASTORECONST ", /* 209 */
- "CASTORECONST ", /* 210 */
- "SASTORECONST ", /* 211 */
- "UNDEF","UNDEF","UNDEF","UNDEF",
- "UNDEF216","UNDEF217","UNDEF218","UNDEF219","UNDEF220",
- "UNDEF","UNDEF","UNDEF","UNDEF","UNDEF",
- "UNDEF226","UNDEF227","UNDEF228","UNDEF229","UNDEF230",
- "UNDEF","UNDEF","UNDEF","UNDEF","UNDEF",
- "UNDEF236","UNDEF237","UNDEF238","UNDEF239","UNDEF240",
- "UNDEF","UNDEF","UNDEF","UNDEF","UNDEF",
- "UNDEF246","UNDEF247","UNDEF248","UNDEF249","UNDEF250",
- "UNDEF251","UNDEF252",
-
- "BUILTIN3 ", /* 253 */
- "BUILTIN2 ", /* 254 */
- "BUILTIN1 " /* 255 */
+ "NOP ", /* 0 */
+ "ACONST ", /* 1 */
+ "ICONST_M1 ", /* ICONST_M1 2 */
+ "ICONST_0 ", /* ICONST_0 3 */
+ "ICONST_1 ", /* ICONST_1 4 */
+ "ICONST_2 ", /* ICONST_2 5 */
+ "ICONST_3 ", /* ICONST_3 6 */
+ "ICONST_4 ", /* ICONST_4 7 */
+ "ICONST_5 ", /* ICONST_5 8 */
+ "LCONST_0 ", /* LCONST_0 9 */
+ "LCONST_1 ", /* LCONST_1 10 */
+ "FCONST_0 ", /* FCONST_0 11 */
+ "FCONST_1 ", /* FCONST_1 12 */
+ "FCONST_2 ", /* FCONST_2 13 */
+ "DCONST_0 ", /* DCONST_0 14 */
+ "DCONST_1 ", /* DCONST_1 15 */
+ "BIPUSH ", /* BIPUSH 16 */
+ "SIPUSH ", /* SIPUSH 17 */
+ "LDC ", /* LDC 18 */
+ "LDC_W ", /* LDC_W 19 */
+ "LDC2_W ", /* LDC2_W 20 */
+ "ILOAD ", /* 21 */
+ "LLOAD ", /* 22 */
+ "FLOAD ", /* 23 */
+ "DLOAD ", /* 24 */
+ "ALOAD ", /* 25 */
+ "ILOAD_0 ", /* ILOAD_0 26 */
+ "ILOAD_1 ", /* ILOAD_1 27 */
+ "ILOAD_2 ", /* ILOAD_2 28 */
+ "ILOAD_3 ", /* ILOAD_3 29 */
+ "LLOAD_0 ", /* LLOAD_0 30 */
+ "LLOAD_1 ", /* LLOAD_1 31 */
+ "LLOAD_2 ", /* LLOAD_2 32 */
+ "LLOAD_3 ", /* LLOAD_3 33 */
+ "FLOAD_0 ", /* FLOAD_0 34 */
+ "FLOAD_1 ", /* FLOAD_1 35 */
+ "FLOAD_2 ", /* FLOAD_2 36 */
+ "FLOAD_3 ", /* FLOAD_3 37 */
+ "DLOAD_0 ", /* DLOAD_0 38 */
+ "DLOAD_1 ", /* DLOAD_1 39 */
+ "DLOAD_2 ", /* DLOAD_2 40 */
+ "DLOAD_3 ", /* DLOAD_3 41 */
+ "ALOAD_0 ", /* ALOAD_0 42 */
+ "ALOAD_1 ", /* ALOAD_1 43 */
+ "ALOAD_2 ", /* ALOAD_2 44 */
+ "ALOAD_3 ", /* ALOAD_3 45 */
+ "IALOAD ", /* 46 */
+ "LALOAD ", /* 47 */
+ "FALOAD ", /* 48 */
+ "DALOAD ", /* 49 */
+ "AALOAD ", /* 50 */
+ "BALOAD ", /* 51 */
+ "CALOAD ", /* 52 */
+ "SALOAD ", /* 53 */
+ "ISTORE ", /* 54 */
+ "LSTORE ", /* 55 */
+ "FSTORE ", /* 56 */
+ "DSTORE ", /* 57 */
+ "ASTORE ", /* 58 */
+ "ISTORE_0 ", /* ISTORE_0 59 */
+ "ISTORE_1 ", /* ISTORE_1 60 */
+ "ISTORE_2 ", /* ISTORE_2 61 */
+ "ISTORE_3 ", /* ISTORE_3 62 */
+ "LSTORE_0 ", /* LSTORE_0 63 */
+ "LSTORE_1 ", /* LSTORE_1 64 */
+ "LSTORE_2 ", /* LSTORE_2 65 */
+ "LSTORE_3 ", /* LSTORE_3 66 */
+ "FSTORE_0 ", /* FSTORE_0 67 */
+ "FSTORE_1 ", /* FSTORE_1 68 */
+ "FSTORE_2 ", /* FSTORE_2 69 */
+ "FSTORE_3 ", /* FSTORE_3 70 */
+ "DSTORE_0 ", /* DSTORE_0 71 */
+ "DSTORE_1 ", /* DSTORE_1 72 */
+ "DSTORE_2 ", /* DSTORE_2 73 */
+ "DSTORE_3 ", /* DSTORE_3 74 */
+ "ASTORE_0 ", /* ASTORE_0 75 */
+ "ASTORE_1 ", /* ASTORE_1 76 */
+ "ASTORE_2 ", /* ASTORE_2 77 */
+ "ASTORE_3 ", /* ASTORE_3 78 */
+ "IASTORE ", /* 79 */
+ "LASTORE ", /* 80 */
+ "FASTORE ", /* 81 */
+ "DASTORE ", /* 82 */
+ "AASTORE ", /* 83 */
+ "BASTORE ", /* 84 */
+ "CASTORE ", /* 85 */
+ "SASTORE ", /* 86 */
+ "POP ", /* 87 */
+ "POP2 ", /* 88 */
+ "DUP ", /* 89 */
+ "DUP_X1 ", /* 90 */
+ "DUP_X2 ", /* 91 */
+ "DUP2 ", /* 92 */
+ "DUP2_X1 ", /* 93 */
+ "DUP2_X2 ", /* 94 */
+ "SWAP ", /* 95 */
+ "IADD ", /* 96 */
+ "LADD ", /* 97 */
+ "FADD ", /* 98 */
+ "DADD ", /* 99 */
+ "ISUB ", /* 100 */
+ "LSUB ", /* 101 */
+ "FSUB ", /* 102 */
+ "DSUB ", /* 103 */
+ "IMUL ", /* 104 */
+ "LMUL ", /* 105 */
+ "FMUL ", /* 106 */
+ "DMUL ", /* 107 */
+ "IDIV ", /* 108 */
+ "LDIV ", /* 109 */
+ "FDIV ", /* 110 */
+ "DDIV ", /* 111 */
+ "IREM ", /* 112 */
+ "LREM ", /* 113 */
+ "FREM ", /* 114 */
+ "DREM ", /* 115 */
+ "INEG ", /* 116 */
+ "LNEG ", /* 117 */
+ "FNEG ", /* 118 */
+ "DNEG ", /* 119 */
+ "ISHL ", /* 120 */
+ "LSHL ", /* 121 */
+ "ISHR ", /* 122 */
+ "LSHR ", /* 123 */
+ "IUSHR ", /* 124 */
+ "LUSHR ", /* 125 */
+ "IAND ", /* 126 */
+ "LAND ", /* 127 */
+ "IOR ", /* 128 */
+ "LOR ", /* 129 */
+ "IXOR ", /* 130 */
+ "LXOR ", /* 131 */
+ "IINC ", /* 132 */
+ "I2L ", /* 133 */
+ "I2F ", /* 134 */
+ "I2D ", /* 135 */
+ "L2I ", /* 136 */
+ "L2F ", /* 137 */
+ "L2D ", /* 138 */
+ "F2I ", /* 139 */
+ "F2L ", /* 140 */
+ "F2D ", /* 141 */
+ "D2I ", /* 142 */
+ "D2L ", /* 143 */
+ "D2F ", /* 144 */
+ "INT2BYTE ", /* 145 */
+ "INT2CHAR ", /* 146 */
+ "INT2SHORT ", /* 147 */
+ "LCMP ", /* 148 */
+ "FCMPL ", /* 149 */
+ "FCMPG ", /* 150 */
+ "DCMPL ", /* 151 */
+ "DCMPG ", /* 152 */
+ "IFEQ ", /* 153 */
+ "IFNE ", /* 154 */
+ "IFLT ", /* 155 */
+ "IFGE ", /* 156 */
+ "IFGT ", /* 157 */
+ "IFLE ", /* 158 */
+ "IF_ICMPEQ ", /* 159 */
+ "IF_ICMPNE ", /* 160 */
+ "IF_ICMPLT ", /* 161 */
+ "IF_ICMPGE ", /* 162 */
+ "IF_ICMPGT ", /* 163 */
+ "IF_ICMPLE ", /* 164 */
+ "IF_ACMPEQ ", /* 165 */
+ "IF_ACMPNE ", /* 166 */
+ "GOTO ", /* 167 */
+ "JSR ", /* 168 */
+ "RET ", /* 169 */
+ "TABLESWITCH ", /* 170 */
+ "LOOKUPSWITCH ", /* 171 */
+ "IRETURN ", /* 172 */
+ "LRETURN ", /* 173 */
+ "FRETURN ", /* 174 */
+ "DRETURN ", /* 175 */
+ "ARETURN ", /* 176 */
+ "RETURN ", /* 177 */
+ "GETSTATIC ", /* 178 */
+ "PUTSTATIC ", /* 179 */
+ "GETFIELD ", /* 180 */
+ "PUTFIELD ", /* 181 */
+ "INVOKEVIRTUAL ", /* 182 */
+ "INVOKESPECIAL ", /* 183 */
+ "INVOKESTATIC ", /* 184 */
+ "INVOKEINTERFACE", /* 185 */
+ "UNDEF186 ", /* 186 */
+ "NEW ", /* 187 */
+ "NEWARRAY ", /* 188 */
+ "ANEWARRAY ", /* 189 */
+ "ARRAYLENGTH ", /* 190 */
+ "ATHROW ", /* 191 */
+ "CHECKCAST ", /* 192 */
+ "INSTANCEOF ", /* 193 */
+ "MONITORENTER ", /* 194 */
+ "MONITOREXIT ", /* 195 */
+ "WIDE ", /* WIDE 196 */
+ "MULTIANEWARRAY ", /* 197 */
+ "IFNULL ", /* 198 */
+ "IFNONNULL ", /* 199 */
+ "GOTO_W ", /* GOTO_W 200 */
+ "JSR_W ", /* JSR_W 201 */
+ "BREAKPOINT ", /* BREAKPOINT 202 */
+
+ "UNDEF203", "UNDEF204", "UNDEF205",
+ "UNDEF206", "UNDEF207", "UNDEF208", "UNDEF209", "UNDEF210",
+ "UNDEF211", "UNDEF212", "UNDEF213", "UNDEF214", "UNDEF215",
+ "UNDEF216", "UNDEF217", "UNDEF218", "UNDEF219", "UNDEF220",
+ "UNDEF221", "UNDEF222", "UNDEF223", "UNDEF224", "UNDEF225",
+ "UNDEF226", "UNDEF227", "UNDEF228", "UNDEF229", "UNDEF230",
+ "UNDEF231", "UNDEF232", "UNDEF233", "UNDEF234", "UNDEF235",
+ "UNDEF236", "UNDEF237", "UNDEF238", "UNDEF239", "UNDEF240",
+ "UNDEF241", "UNDEF242", "UNDEF243", "UNDEF244", "UNDEF245",
+ "UNDEF246", "UNDEF247", "UNDEF248", "UNDEF249", "UNDEF250",
+ "UNDEF251", "UNDEF252", "UNDEF253", "UNDEF254", "UNDEF255"
};
SUPPORT_FLOAT && SUPPORT_FICVT,true ,"f2i"},
{ICMD_D2I , BUILTIN_d2i ,ICMD_BUILTIN1,TYPE_DOUBLE,TYPE_VOID ,TYPE_VOID ,TYPE_INT ,
SUPPORT_DOUBLE && SUPPORT_FICVT,true ,"d2i"},
+
+ { ICMD_FADD , BUILTIN_fadd , ICMD_BUILTIN2, TYPE_FLT, TYPE_FLT , TYPE_VOID , TYPE_FLT, SUPPORT_FLOAT, true, "fadd" },
+ { ICMD_FSUB , BUILTIN_fsub , ICMD_BUILTIN2, TYPE_FLT, TYPE_FLT , TYPE_VOID , TYPE_FLT, SUPPORT_FLOAT, true, "fsub" },
+ { ICMD_FMUL , BUILTIN_fmul , ICMD_BUILTIN2, TYPE_FLT, TYPE_FLT , TYPE_VOID , TYPE_FLT, SUPPORT_FLOAT, true, "fmul" },
+ { ICMD_FDIV , BUILTIN_fdiv , ICMD_BUILTIN2, TYPE_FLT, TYPE_FLT , TYPE_VOID , TYPE_FLT, SUPPORT_FLOAT, true, "fdiv" },
+ { ICMD_FNEG , BUILTIN_fneg , ICMD_BUILTIN1, TYPE_FLT, TYPE_VOID , TYPE_VOID , TYPE_FLT, SUPPORT_FLOAT, true, "fneg" },
+ { ICMD_FCMPL, BUILTIN_fcmpl , ICMD_BUILTIN2, TYPE_FLT, TYPE_FLT , TYPE_VOID , TYPE_INT, SUPPORT_FLOAT, true, "fcmpl" },
+ { ICMD_FCMPG, BUILTIN_fcmpg , ICMD_BUILTIN2, TYPE_FLT, TYPE_FLT , TYPE_VOID , TYPE_INT, SUPPORT_FLOAT, true, "fcmpg" },
+
+ { ICMD_DADD , BUILTIN_dadd , ICMD_BUILTIN2, TYPE_DBL, TYPE_DBL , TYPE_VOID , TYPE_DBL, SUPPORT_DOUBLE, true, "dadd" },
+ { ICMD_DSUB , BUILTIN_dsub , ICMD_BUILTIN2, TYPE_DBL, TYPE_DBL , TYPE_VOID , TYPE_DBL, SUPPORT_DOUBLE, true, "dsub" },
+ { ICMD_DMUL , BUILTIN_dmul , ICMD_BUILTIN2, TYPE_DBL, TYPE_DBL , TYPE_VOID , TYPE_DBL, SUPPORT_DOUBLE, true, "dmul" },
+ { ICMD_DDIV , BUILTIN_ddiv , ICMD_BUILTIN2, TYPE_DBL, TYPE_DBL , TYPE_VOID , TYPE_DBL, SUPPORT_DOUBLE, true, "ddiv" },
+ { ICMD_DNEG , BUILTIN_dneg , ICMD_BUILTIN1, TYPE_DBL, TYPE_VOID , TYPE_VOID , TYPE_DBL, SUPPORT_DOUBLE, true, "dneg" },
+ { ICMD_DCMPL, BUILTIN_dcmpl , ICMD_BUILTIN2, TYPE_DBL, TYPE_DBL , TYPE_VOID , TYPE_INT, SUPPORT_DOUBLE, true, "dcmpl" },
+ { ICMD_DCMPG, BUILTIN_dcmpg , ICMD_BUILTIN2, TYPE_DBL, TYPE_DBL , TYPE_VOID , TYPE_INT, SUPPORT_DOUBLE, true, "dcmpg" },
+
+ { ICMD_F2D, BUILTIN_f2d , ICMD_BUILTIN1, TYPE_FLT, TYPE_VOID , TYPE_VOID , TYPE_DBL, SUPPORT_FLOAT && SUPPORT_DOUBLE, true, "f2d" },
+ { ICMD_D2F, BUILTIN_d2f , ICMD_BUILTIN1, TYPE_DBL, TYPE_VOID , TYPE_VOID , TYPE_FLT, SUPPORT_FLOAT && SUPPORT_DOUBLE, true, "d2f" },
#endif
/* this record marks the end of the automatically replaced opcodes */
{255,BUILTIN_newarray_short ,ICMD_BUILTIN1,TYPE_INT ,TYPE_VOID ,TYPE_VOID ,TYPE_ADR ,0,0,"newarray_short"},
{255,BUILTIN_newarray_int ,ICMD_BUILTIN1,TYPE_INT ,TYPE_VOID ,TYPE_VOID ,TYPE_ADR ,0,0,"newarray_int"},
{255,BUILTIN_newarray_long ,ICMD_BUILTIN1,TYPE_INT ,TYPE_VOID ,TYPE_VOID ,TYPE_ADR ,0,0,"newarray_long"},
+#if defined(USE_THREADS)
{255,BUILTIN_monitorenter ,ICMD_BUILTIN1,TYPE_ADR ,TYPE_VOID ,TYPE_VOID ,TYPE_VOID ,0,0,"monitorenter"},
{255,BUILTIN_monitorexit ,ICMD_BUILTIN1,TYPE_ADR ,TYPE_VOID ,TYPE_VOID ,TYPE_VOID ,0,0,"monitorexit"},
+#endif
#if !SUPPORT_DIVISION
{255,BUILTIN_idiv ,ICMD_BUILTIN2,TYPE_INT ,TYPE_INT ,TYPE_VOID ,TYPE_INT ,0,0,"idiv"},
{255,BUILTIN_irem ,ICMD_BUILTIN2,TYPE_INT ,TYPE_INT ,TYPE_VOID ,TYPE_INT ,0,0,"irem"},
{ 0,NULL,0,0,0,0,0,0,0,"<END>"}
};
+
/* include compiler subsystems ************************************************/
/* dummy function, used when there is no JavaVM code available */
-static void* do_nothing_function()
+static functionptr do_nothing_function()
{
return NULL;
}
/* jit_compile *****************************************************************
- jit_compile, new version of compiler, translates one method to machine code
+ jit_compile, new version of compiler, translates one method to machine code
*******************************************************************************/
-static methodptr jit_compile_intern(methodinfo *m);
+static functionptr jit_compile_intern(methodinfo *m, codegendata *cd,
+ registerdata *rd, loopdata *ld,
+ t_inlining_globals *id);
-methodptr jit_compile(methodinfo *m)
+functionptr jit_compile(methodinfo *m)
{
- static bool jitrunning;
- methodptr r;
- s4 dumpsize;
+ functionptr r;
+ codegendata *cd;
+ registerdata *rd;
+ loopdata *ld;
+ t_inlining_globals *id;
+ s4 dumpsize;
+#if defined(STATISTICS)
if (opt_stat)
count_jit_calls++;
+#endif
+
+ /* this is the case if a native function is called by jni */
+
+ if (m->flags & ACC_NATIVE)
+ return (functionptr) m->stubroutine;
+#if defined(USE_THREADS)
/* enter a monitor on the method */
builtin_monitorenter((java_objectheader *) m);
+#endif
/* if method has been already compiled return immediately */
if (m->entrypoint) {
- builtin_monitorexit((java_objectheader *) m );
+#if defined(USE_THREADS)
+ builtin_monitorexit((java_objectheader *) m);
+#endif
return m->entrypoint;
}
+#if defined(STATISTICS)
if (opt_stat)
count_methods++;
+#endif
- if (jitrunning) {
- printf("JITRUNNING!!! new method=");
- utf_display_classname(m->class->name);printf(".");utf_display(m->name);
- printf("\n");
- }
- /* now the jit is running */
+ /* if there is no javacode, print error message and return empty method */
- jitrunning = true;
+ if (!m->jcode) {
+ if (compileverbose)
+ log_message_method("No code given for: ", m);
- /* mark start of dump memory area */
+ m->entrypoint = (functionptr) do_nothing_function;
- dumpsize = dump_size();
+ return m->entrypoint; /* return empty method */
+ }
+#if defined(STATISTICS)
/* measure time */
if (getcompilingtime)
compilingtime_start();
+#endif
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* allocate memory */
+
+ cd = DNEW(codegendata);
+ rd = DNEW(registerdata);
+ ld = DNEW(loopdata);
+ id = DNEW(t_inlining_globals);
+
+ /* RTA static analysis must be called before inlining */
+ if (opt_rt)
+ RT_jit_parse(m); /* will be called just once */
+ /* return value ignored for now */
+ /* XTA static analysis must be called before inlining */
+ if (opt_xta)
+ XTA_jit_parse(m); /* will be called just once */
+ /* return value ignored for now */
+
+
+ /* must be called before reg_setup, because it can change maxlocals */
+ /* init reqd to initialize for parse even in no inlining */
+ inlining_setup(m, id);
+
+ /* initialize the register allocator */
+ reg_setup(m, rd, id);
+
+ /* setup the codegendata memory */
+ codegen_setup(m, cd, id);
/* now call internal compile function */
- r = jit_compile_intern(m);
+ r = jit_compile_intern(m, cd, rd, ld, id);
- if (r) {
- if (compileverbose)
- log_message_method("Running: ", m);
- }
+ /* free some memory */
+
+ reg_free(m, rd);
+ codegen_free(m, cd);
/* clear pointers to dump memory area */
dump_release(dumpsize);
+#if defined(STATISTICS)
/* measure time */
if (getcompilingtime)
compilingtime_stop();
+#endif
- jitrunning = false;
+ /* define in options.h; Used in main.c, jit.c & inline.c */
+#ifdef INAFTERMAIN
+ if ((utf_new_char("main") == m->name) && (useinliningm))
+ useinlining = false;
+#endif
+#if defined(USE_THREADS)
/* leave the monitor */
builtin_monitorexit((java_objectheader *) m );
+#endif
+
+ if (r) {
+ if (compileverbose)
+ log_message_method("Running: ", m);
+ }
/* return pointer to the methods entry point */
}
-static methodptr jit_compile_intern(methodinfo *m)
-{
-t_inlining_globals *inline_env = NULL;
- /* if there is no javacode, print error message and return empty method */
+/* jit_compile_intern **********************************************************
- if (!m->jcode) {
- if (compileverbose)
- log_message_method("No code given for: ", m);
+ Static internal function which does the actual compilation.
+
+*******************************************************************************/
+
+static functionptr jit_compile_intern(methodinfo *m, codegendata *cd,
+ registerdata *rd, loopdata *ld,
+ t_inlining_globals *id)
+{
+#ifdef LSRA
+ bool old_opt_lsra;
+#endif
- return (methodptr) do_nothing_function; /* return empty method */
- }
/* print log message for compiled method */
descriptor2types(m);
-#if defined(__I386__)
- /* we try to use these registers as scratch registers */
- if (m->exceptiontablelength > 0) {
- method_uses_ecx = true;
- method_uses_edx = true;
-
- } else {
- /* XXX when we use this, we have to save used registers in asm_
- functions (see asm_check_clinit */
-/* method_uses_ecx = false; */
-/* method_uses_edx = false; */
- method_uses_ecx = true;
- method_uses_edx = true;
- }
-#endif
-
/* call the compiler passes ***********************************************/
- EXTABLEN
- /* first of all initialize the register allocator */
- reg_init(m);
-
- /* must be called before reg_setup, because it can change maxlocals */
- /* init reqd to initialize for parse even in no inlining */
- inline_env = inlining_init(m);
-
- EXTABLEN
-
- reg_setup(m);
-
- /* setup the codegendata memory */
- codegen_setup(m,inline_env);
-
- EXTABLEN
-
if (compileverbose)
log_message_method("Parsing: ", m);
- if (!parse(m, inline_env)) {
+ /* call parse pass */
+ if (!parse(m, cd, id)) {
if (compileverbose)
log_message_method("Exception while parsing: ", m);
log_message_method("Analysing: ", m);
}
-
- if (!analyse_stack(m->codegendata)) {
+ /* call stack analysis pass */
+ if (!analyse_stack(m, cd, rd)) {
if (compileverbose)
log_message_method("Exception while analysing: ", m);
if (compileverbose)
log_message_method("Typechecking: ", m);
- if (!typecheck(m->codegendata)) {
+ /* call typecheck pass */
+ if (!typecheck(m, cd, rd)) {
if (compileverbose)
log_message_method("Exception while typechecking: ", m);
log_message_method("Typechecking done: ", m);
}
#endif
+
if (opt_loops) {
- depthFirst(m);
- analyseGraph(m);
- optimize_loops(m);
+ depthFirst(m, ld);
+ analyseGraph(m, ld);
+ optimize_loops(m, cd, ld);
}
#ifdef SPECIALMEMUSE
- preregpass();
+ preregpass(m, rd);
#endif
if (compileverbose)
log_message_method("Allocating registers: ", m);
- regalloc(m);
+ /* allocate registers */
+#ifdef LSRA
+ old_opt_lsra=opt_lsra;
+ if (opt_lsra) {
+ if (!lsra(m, cd, rd, id)) {
+ opt_lsra = false;
+/* log_message_method("Regalloc Fallback: ", m); */
+ regalloc( m, cd, rd );
+ } else {
+#ifdef STATISTICS
+ if (opt_stat) count_methods_allocated_by_lsra++;
+#endif
+/* log_message_method("Regalloc LSRA: ", m); */
+ }
+ }
+ else
+#endif
+ {
+#ifdef STATISTICS
+ if (opt_stat)
+#ifdef LSRA
+ if (!opt_lsra)
+#endif
+ count_locals_conflicts += (cd->maxlocals-1)*(cd->maxlocals);
+#endif
+ regalloc(m, cd, rd);
+ }
+
+#ifdef STATISTICS
+ if (opt_stat)
+ reg_make_statistics(m, cd, rd);
+#endif
if (compileverbose) {
log_message_method("Allocating registers done: ", m);
}
/* now generate the machine code */
- codegen(m);
+ codegen(m, cd, rd);
if (compileverbose)
log_message_method("Generating code done: ", m);
/* intermediate and assembly code listings */
if (showintermediate) {
- show_icmd_method(m);
+ show_icmd_method(m, cd, rd);
} else if (showdisassemble) {
- disassemble((void *) (m->mcode + m->codegendata->dseglen),
- m->mcodelength - m->codegendata->dseglen);
+ disassemble((void *) ((long) m->mcode + cd->dseglen),
+ m->mcodelength - cd->dseglen);
}
if (showddatasegment)
- dseg_display(m);
-
- /* free some memory */
-
- reg_close(m);
- codegen_close(m);
+ dseg_display(m, cd);
if (compileverbose)
log_message_method("Compiling done: ", m);
+#ifdef LSRA
+ opt_lsra=old_opt_lsra;
+#endif
/* return pointer to the methods entry point */
return m->entrypoint;