-/* vm/jit/jit.c - calls the code generation functions
+/* src/vm/jit/jit.c - calls the code generation functions
Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
Reinhard Grafl
Changes: Edwin Steiner
+ Christian Thalinger
- $Id: jit.c 1944 2005-02-15 16:30:41Z christian $
+ $Id: jit.c 2040 2005-03-20 13:39:51Z twisti $
*/
#include <stdlib.h>
+#include "config.h"
#include "codegen.h"
#include "disass.h"
#include "types.h"
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,
"BASTORECONST ", /* 209 */
"CASTORECONST ", /* 210 */
"SASTORECONST ", /* 211 */
+ "PUTSTATICCONST ", /* 212 */
+ "PUTFIELDCONST ", /* 213 */
+ "IMULPOW2 ", /* 214 */
+ "LMULPOW2 ", /* 215 */
- "UNDEF212", "UNDEF213", "UNDEF214", "UNDEF215",
"UNDEF216", "UNDEF217", "UNDEF218", "UNDEF219", "UNDEF220",
"UNDEF221", "UNDEF222", "UNDEF223", "UNDEF224", "UNDEF225",
"UNDEF226", "UNDEF227", "UNDEF228", "UNDEF229", "UNDEF230",
{ ICMD_LCMP, TYPE_LONG, TYPE_LONG, TYPE_INT, ICMD_BUILTIN2,
(functionptr) builtin_lcmp , SUPPORT_LONG && SUPPORT_LONG_CMP, false },
{ ICMD_LAND, TYPE_LONG, TYPE_LONG, TYPE_LONG, ICMD_BUILTIN2,
- (functionptr) builtin_land , SUPPORT_LONG && SUPPORT_LONG_LOG, false },
+ (functionptr) builtin_land , SUPPORT_LONG && SUPPORT_LONG_LOGICAL, false },
{ ICMD_LOR, TYPE_LONG, TYPE_LONG, TYPE_LONG, ICMD_BUILTIN2,
- (functionptr) builtin_lor , SUPPORT_LONG && SUPPORT_LONG_LOG, false },
+ (functionptr) builtin_lor , SUPPORT_LONG && SUPPORT_LONG_LOGICAL, false },
{ ICMD_LXOR, TYPE_LONG, TYPE_LONG, TYPE_LONG, ICMD_BUILTIN2,
- (functionptr) builtin_lxor , SUPPORT_LONG && SUPPORT_LONG_LOG, false },
+ (functionptr) builtin_lxor , SUPPORT_LONG && SUPPORT_LONG_LOGICAL, false },
{ ICMD_LSHL, TYPE_LONG, TYPE_INT, TYPE_LONG, ICMD_BUILTIN2,
(functionptr) builtin_lshl , SUPPORT_LONG && SUPPORT_LONG_SHIFT, false },
{ ICMD_LSHR, TYPE_LONG, TYPE_INT, TYPE_LONG, ICMD_BUILTIN2,
SUPPORT_LONG && SUPPORT_LONG_CMP,false,"lcmp"},
{ICMD_LAND , BUILTIN_land ,ICMD_BUILTIN2,TYPE_LONG ,TYPE_LONG ,TYPE_VOID ,TYPE_LONG ,
- SUPPORT_LONG && SUPPORT_LONG_LOG,false,"land"},
+ SUPPORT_LONG && SUPPORT_LONG_LOGICAL,false,"land"},
{ICMD_LOR , BUILTIN_lor ,ICMD_BUILTIN2,TYPE_LONG ,TYPE_LONG ,TYPE_VOID ,TYPE_LONG ,
- SUPPORT_LONG && SUPPORT_LONG_LOG,false,"lor"},
+ SUPPORT_LONG && SUPPORT_LONG_LOGICAL,false,"lor"},
{ICMD_LXOR , BUILTIN_lxor ,ICMD_BUILTIN2,TYPE_LONG ,TYPE_LONG ,TYPE_VOID ,TYPE_LONG ,
- SUPPORT_LONG && SUPPORT_LONG_LOG,false,"lxor"},
+ SUPPORT_LONG && SUPPORT_LONG_LOGICAL,false,"lxor"},
{ICMD_LSHL , BUILTIN_lshl ,ICMD_BUILTIN2,TYPE_LONG ,TYPE_INT ,TYPE_VOID ,TYPE_LONG ,
SUPPORT_LONG && SUPPORT_LONG_SHIFT,false,"lshl"},
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 */
return m->entrypoint;
}
+#if defined(STATISTICS)
if (opt_stat)
count_methods++;
+#endif
/* if there is no javacode, print error message and return empty method */
return m->entrypoint; /* return empty method */
}
+#if defined(STATISTICS)
/* measure time */
if (getcompilingtime)
compilingtime_start();
+#endif
/* mark start of dump memory area */
dump_release(dumpsize);
+#if defined(STATISTICS)
/* measure time */
if (getcompilingtime)
compilingtime_stop();
+#endif
/* define in options.h; Used in main.c, jit.c & inline.c */
#ifdef INAFTERMAIN
bool old_opt_lsra;
#endif
+
/* print log message for compiled method */
if (compileverbose)
#ifdef LSRA
old_opt_lsra=opt_lsra;
if (opt_lsra) {
- if (!lsra(m, cd, rd, ld, id)) {
+ if (!lsra(m, cd, rd, id)) {
opt_lsra = false;
/* log_message_method("Regalloc Fallback: ", m); */
regalloc( m, cd, rd );
- } /* else log_message_method("Regalloc LSRA: ", m); */
+ } 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);