remove support for java stuff (was broken and nobody used it anyway)
authorMatthias Braun <matze@braunis.de>
Sat, 11 Oct 2008 17:19:00 +0000 (17:19 +0000)
committerMatthias Braun <matze@braunis.de>
Sat, 11 Oct 2008 17:19:00 +0000 (17:19 +0000)
[r22694]

configure.ac
firm_config.h.in
ir/be/bechordal_main.c
ir/be/becopyheur3.c [deleted file]
ir/be/becopyopt.c
ir/be/bejavacoal.c [deleted file]
ir/be/bejavacoal.h [deleted file]
ir/be/bemodule.c
ir/be/bespill.c
ir/be/bespillslots.c

index 86710d7..f89f873 100644 (file)
@@ -130,18 +130,6 @@ fi
 AC_SUBST([FIRMCONFIG_WITH_ILP])
 AC_SUBST(enable_ilp)
 
-dnl enable JVM calling from Firm
-dnl --------------------------------
-AC_ARG_ENABLE([jvm],
-[AS_HELP_STRING([--enable-jvm], [enable to call the jvm])],
-[enable_jvm="$enableval"], [enable_jvm="no"])
-
-if test "$enable_jvm" = yes; then
-  FIRMCONFIG_WITH_JVM="#define FIRMCONFIG_WITH_JVM"
-fi
-AC_SUBST([FIRMCONFIG_WITH_JVM])
-AC_SUBST(enable_jvm)
-
 dnl enable wchar_t support for identifiers
 dnl --------------------------------
 AC_ARG_ENABLE([wchar_support],
index a2966c7..aa792de 100644 (file)
@@ -7,9 +7,6 @@
 /* define to 1 to use the ILP solver */
 @FIRMCONFIG_WITH_ILP@
 
-/* define to 1 to enable Firm to call the JVM */
-@FIRMCONFIG_WITH_JVM@
-
 /* define to 1 to have wchar_t support for identifiers */
 @FIRMCONFIG_FIRM_ENABLE_WCHAR@
 
index c6d99b2..60ecfc8 100644 (file)
@@ -59,7 +59,6 @@
 
 #include "bechordal_t.h"
 #include "beabi.h"
-#include "bejavacoal.h"
 #include "beutil.h"
 #include "besched.h"
 #include "besched_t.h"
@@ -83,7 +82,6 @@
 #include "bespillremat.h"
 #endif /* WITH_ILP */
 
-#include "bejavacoal.h"
 #include "becopystat.h"
 #include "becopyopt.h"
 #include "bessadestr.h"
diff --git a/ir/be/becopyheur3.c b/ir/be/becopyheur3.c
deleted file mode 100644 (file)
index 33b75fb..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief       More experiments on coalescing with Java implementation.
- * @author      Sebastian Hack
- * @date        25.07.2006
- * @version     $Id$
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef WITH_JVM
-
-#include "lc_opts.h"
-#include "lc_opts_enum.h"
-
-#include <stdlib.h>
-#include <limits.h>
-
-#include "list.h"
-#include "pdeq.h"
-#include "bitset.h"
-
-#include "debug.h"
-#include "bitfiddle.h"
-#include "bitset.h"
-#include "raw_bitset.h"
-
-#include "irgraph_t.h"
-#include "irnode_t.h"
-#include "irprintf.h"
-#include "irtools.h"
-
-#include "bemodule.h"
-#include "beabi.h"
-#include "benode_t.h"
-#include "becopyopt.h"
-#include "becopyopt_t.h"
-#include "bechordal_t.h"
-#include "bejavacoal.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#define DUMP_BEFORE 1
-#define DUMP_AFTER  2
-#define DUMP_ALL    2 * DUMP_AFTER - 1
-
-static unsigned dump_flags = 0;
-static int      dbg_level  = 0;
-
-static const lc_opt_enum_mask_items_t dump_items[] = {
-       { "before",  DUMP_BEFORE },
-       { "after",   DUMP_AFTER  },
-       { "all",     DUMP_ALL    },
-       { NULL,      0 }
-};
-
-static lc_opt_enum_mask_var_t dump_var = {
-       &dump_flags, dump_items
-};
-
-static const lc_opt_table_entry_t options[] = {
-       LC_OPT_ENT_ENUM_MASK("dump", "dump ifg cloud",                              &dump_var),
-       LC_OPT_ENT_INT      ("dbg",  "debug level for the Java coalescer",          &dbg_level),
-       LC_OPT_LAST
-};
-
-void be_init_copyheur3(void)
-{
-       lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
-       lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra");
-       lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal");
-       lc_opt_entry_t *co3_grp = lc_opt_get_grp(chordal_grp, "co3");
-
-       lc_opt_add_table(co3_grp, options);
-}
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur3);
-
-static void set_admissible_regs(be_java_coal_t *coal, copy_opt_t *co, ir_node *irn, int t_idx, int *col_map)
-{
-       const arch_register_req_t *req;
-
-       req = arch_get_register_req(co->aenv, irn, BE_OUT_POS(0));
-
-       // ir_printf("%+F\n", irn);
-       if(arch_register_req_is(req, limited)) {
-               unsigned i;
-               unsigned n_regs = co->cls->n_regs;
-
-               for(i = 0; i < n_regs; ++i) {
-                       if(!rbitset_is_set(req->limited, i) && col_map[i] >= 0) {
-                               be_java_coal_forbid_color(coal, t_idx, col_map[i]);
-                       }
-               }
-       }
-}
-
-int co_solve_heuristic_java(copy_opt_t *co)
-{
-       be_ifg_t *ifg   = co->cenv->ifg;
-       void *nodes_it  = be_ifg_nodes_iter_alloca(ifg);
-       void *neigh_it  = be_ifg_neighbours_iter_alloca(ifg);
-       bitset_t *nodes = bitset_malloc(get_irg_last_idx(co->irg));
-       unsigned n_regs = co->cenv->cls->n_regs;
-
-       char dbg[256];
-       unsigned i, j, curr_idx;
-       int *col_map;
-       int *inv_col_map;
-
-       int *node_map;
-       int *inv_node_map;
-
-       be_java_coal_t *coal;
-       ir_node *n, *m;
-
-       col_map     = alloca(n_regs * sizeof(col_map[0]));
-       inv_col_map = alloca(n_regs * sizeof(inv_col_map[0]));
-
-       memset(inv_col_map, -1, sizeof(inv_col_map[0]) * n_regs);
-
-       for(i = 0, j = 0; i < n_regs; ++i) {
-               const arch_register_t *reg = &co->cls->regs[i];
-               col_map[i] = -1;
-               if(!arch_register_type_is(reg, ignore)) {
-                       col_map[i] = j;
-                       inv_col_map[j] = i;
-                       ++j;
-               }
-       }
-
-       node_map     = XMALLOCN(int, get_irg_last_idx(co->irg) + 1);
-       inv_node_map = XMALLOCN(int, get_irg_last_idx(co->irg) + 1);
-
-       curr_idx = 0;
-       be_ifg_foreach_node(ifg, nodes_it, n) {
-               if(!arch_irn_is(co->aenv, n, ignore)) {
-                       int idx = get_irn_idx(n);
-                       bitset_set(nodes, idx);
-                       node_map[idx] = curr_idx;
-                       inv_node_map[curr_idx] = idx;
-                       curr_idx++;
-               }
-       }
-
-       if(curr_idx == 0) {
-               free(node_map);
-               free(inv_node_map);
-               bitset_free(nodes);
-               return 0;
-       }
-
-       coal = be_java_coal_init("test", curr_idx, j, dbg_level);
-
-       /* Check, if all neighbours are indeed connected to the node. */
-       be_ifg_foreach_node(ifg, nodes_it, n) {
-               int n_idx = get_irn_idx(n);
-               int t_idx = node_map[n_idx];
-
-               if(bitset_is_set(nodes, n_idx)) {
-                       affinity_node_t *an = get_affinity_info(co, n);
-
-                       ir_snprintf(dbg, sizeof(dbg), "%+F", n);
-                       be_java_coal_set_debug(coal, t_idx, dbg);
-                       be_java_coal_set_color(coal, t_idx, col_map[arch_get_irn_register(co->aenv, n)->index]);
-                       set_admissible_regs(coal, co, n, t_idx, col_map);
-                       be_ifg_foreach_neighbour(ifg, neigh_it, n, m) {
-                               int m_idx = get_irn_idx(m);
-                               int s_idx = node_map[m_idx];
-
-                               if(n_idx < m_idx && bitset_is_set(nodes, m_idx)) {
-                                       be_java_coal_add_int_edge(coal, s_idx, t_idx);
-                               }
-                       }
-
-                       if(an != NULL) {
-                               neighb_t *neigh;
-                               co_gs_foreach_neighb(an, neigh) {
-                                       int m_idx = get_irn_idx(neigh->irn);
-                                       int s_idx = node_map[m_idx];
-
-                                       if(n_idx < m_idx && bitset_is_set(nodes, m_idx)) {
-                                               be_java_coal_add_aff_edge(coal, s_idx, t_idx, neigh->costs);
-                                       }
-                               }
-                       }
-               }
-       }
-
-       if(dump_flags & DUMP_BEFORE) {
-               char fn[512];
-               ir_snprintf(fn, sizeof(fn), "%F-%s-before.dot", co->cenv->irg, co->cenv->cls->name);
-               be_java_coal_dump(coal, fn);
-       }
-
-       be_java_coal_coalesce(coal);
-
-       be_ifg_foreach_node(ifg, nodes_it, n) {
-               unsigned idx = get_irn_idx(n);
-               if(bitset_is_set(nodes, idx)) {
-                       unsigned t_idx             = node_map[idx];
-                       unsigned col               = inv_col_map[be_java_coal_get_color(coal, t_idx)];
-                       const arch_register_t *reg;
-
-                       assert(col < n_regs);
-                       reg     = &co->cls->regs[col];
-                       arch_set_irn_register(co->aenv, n, reg);
-               }
-       }
-
-       if(dump_flags & DUMP_AFTER) {
-               char fn[512];
-               ir_snprintf(fn, sizeof(fn), "%F-%s-after.dot", co->cenv->irg, co->cenv->cls->name);
-               be_java_coal_dump(coal, fn);
-       }
-
-       be_java_coal_destroy(coal);
-       bitset_free(nodes);
-       return 0;
-}
-
-#endif
index a0154f1..5ea97b2 100644 (file)
@@ -60,7 +60,6 @@
 #include "belive_t.h"
 #include "beinsn_t.h"
 #include "besched_t.h"
-#include "bejavacoal.h"
 #include "bestatevent.h"
 #include "beirg_t.h"
 #include "error.h"
diff --git a/ir/be/bejavacoal.c b/ir/be/bejavacoal.c
deleted file mode 100644 (file)
index 6b44f06..0000000
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief       Interface for external Java coalescer.
- * @author      Sebastian Hack
- * @version     $Id$
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "lc_opts.h"
-#include "lc_opts_enum.h"
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <dlfcn.h>
-#endif
-
-#include <signal.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <stdio.h>
-
-#include "xmalloc.h"
-#include "bejavacoal.h"
-#include "irtools.h"
-#include "bemodule.h"
-
-#ifdef WITH_JVM
-
-/* Path to the jar file. A little OS dependent convenience. */
-#ifdef _WIN32
-static char jar_file[512] = "y:\\user\\hack\\public\\coal.jar";
-#else
-static char jar_file[512] = "/ben/hack/public/coal.jar";
-#endif
-
-static char cls_name[256] = "coalescing/mst/safe/Algo";
-
-/* Name of the JVM dll/so */
-static char jvm_lib[512] = { 0 };
-
-static const lc_opt_table_entry_t options[] = {
-       LC_OPT_ENT_STR      ("jvm",  "absolute path to jvm dll",                    jvm_lib, sizeof(jvm_lib)),
-       LC_OPT_ENT_STR      ("jar",  "jar file of the coalescer",                   jar_file, sizeof(jar_file)),
-       LC_OPT_ENT_STR      ("cls",  "name of the class providing the factory",     cls_name, sizeof(cls_name)),
-       LC_OPT_LAST
-};
-
-void be_init_javacoal(void)
-{
-       lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
-       lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra");
-       lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal");
-       lc_opt_entry_t *jc_grp = lc_opt_get_grp(chordal_grp, "jc");
-       lc_opt_add_table(jc_grp, options);
-}
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_javacoal);
-
-#include <jni.h>
-
-typedef struct _jni_env_t {
-       JavaVM *jvm;
-       JNIEnv *jni;
-} jni_env_t;
-
-/*
-
-       Ugly code to retrieve the JVM dll/so file.
-
-*/
-
-#ifdef _WIN32
-/* Win32 version */
-static void *find_jvm_symbol(const char *vmlibpath, const char *sym)
-{
-       HINSTANCE hVM = LoadLibrary(vmlibpath);
-       return hVM ? GetProcAddress(hVM, sym) : NULL;
-}
-
-#define JRE_KEY "SOFTWARE\\JavaSoft\\Java Development Kit"
-
-static char *locate_jvm_lib(char *path, size_t path_len)
-{
-       char version[32];
-       char buf[256];
-       DWORD version_len = sizeof(version);
-       DWORD dwPathLen = path_len;
-       HKEY hKey;
-
-       RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY, 0, KEY_QUERY_VALUE, &hKey);
-       RegQueryValueEx(hKey, "CurrentVersion", NULL, NULL, (LPBYTE) version, &version_len);
-       RegCloseKey(hKey);
-
-       _snprintf(buf, sizeof(buf), JRE_KEY "\\%s", version);
-       RegOpenKeyEx(HKEY_LOCAL_MACHINE, buf, 0, KEY_QUERY_VALUE, &hKey);
-       RegQueryValueEx(hKey, "JavaHome", NULL, NULL, (LPBYTE) path, &dwPathLen);
-       RegCloseKey(hKey);
-
-       strncat(path, "\\jre\\bin\\server\\jvm.dll", path_len);
-       return path;
-}
-
-#else /* ! _WIN32 */
-/* Unix version */
-static void *find_jvm_symbol(const char *vmlibpath, const char *sym)
-{
-       void *libVM = dlopen(vmlibpath, RTLD_LAZY);
-       return libVM ? dlsym(libVM, sym) : NULL;
-}
-
-static char *locate_jvm_lib(char *path, size_t n)
-{
-       (void) path;
-       (void) n;
-       return NULL;
-}
-#endif /* _WIN32 */
-
-static int start_vm(jni_env_t *env, int argc, char *argv[])
-{
-       int i;
-       long ret;
-       JavaVMInitArgs args;
-       JavaVMOption *opts;
-
-       long (JNICALL * create_func)(JavaVM **, void **, void *) = find_jvm_symbol(jvm_lib, "JNI_CreateJavaVM");
-
-       if(!create_func) {
-               fprintf(stderr, "could not find JVM creation function\n");
-               exit(1);
-       }
-
-       memset(&args, 0, sizeof(args));
-       opts = XMALLOCN(JavaVMOption, argc);
-       for(i = 0; i < argc; ++i) {
-               opts[i].optionString = argv[i];
-               opts[i].extraInfo    = NULL;
-       }
-
-       args.version  = JNI_VERSION_1_4;
-       args.nOptions = argc;
-       args.options  = opts;
-       args.ignoreUnrecognized = JNI_FALSE;
-
-       ret = create_func(&env->jvm, (void **) &env->jni, &args);
-       free(opts);
-       if(ret != JNI_OK) {
-               fprintf(stderr, "JNI_CreateJavaVM returned errrocode %ld\n" , ret);
-               return 0;
-       }
-
-       return 1;
-}
-
-static void stop_vm(jni_env_t *env)
-{
-       JavaVM *jvm = env->jvm;
-       (*jvm)->DetachCurrentThread(jvm);
-       (*jvm)->DestroyJavaVM(jvm);
-}
-
-static int jvm_inited = 0;
-static jni_env_t env;
-void (*old_int_handler)(int);
-void (*old_abrt_handler)(int);
-
-static void sig_jvm_destroy_at_exit(int signal)
-{
-       if(jvm_inited)
-               stop_vm(&env);
-
-       switch(signal) {
-       case SIGABRT:
-               old_abrt_handler(signal);
-               break;
-       case SIGINT:
-               old_int_handler(signal);
-               break;
-       default:;
-       }
-}
-
-static void jvm_destroy_at_exit(void)
-{
-       sig_jvm_destroy_at_exit(0);
-}
-
-static jni_env_t *get_jvm(void)
-{
-       char cp_param[512];
-       char *args[1];
-
-       if(!jvm_inited) {
-               /* Find the dll */
-               if(strlen(jvm_lib) == 0) {
-                       if(!locate_jvm_lib(jvm_lib, sizeof(jvm_lib))) {
-                               fprintf(stderr, "could not find jvm library\n");
-                               exit(1);
-                       }
-               }
-
-               snprintf(cp_param, sizeof(cp_param), "-Djava.class.path=%s", jar_file);
-               args[0] = cp_param;
-               if(!start_vm(&env, sizeof(args) / sizeof(args[0]), args)) {
-                       fprintf(stderr, "Couldn't initialize java VM\n");
-                       abort();
-               }
-               jvm_inited = 1;
-               old_int_handler  = signal(SIGINT,  sig_jvm_destroy_at_exit);
-               old_abrt_handler = signal(SIGABRT, sig_jvm_destroy_at_exit);
-               atexit(jvm_destroy_at_exit);
-       }
-
-       return &env;
-}
-
-
-static void check(jni_env_t *env, const char *file, int line)
-{
-       JNIEnv *jni = env->jni;
-       jboolean exc = (*jni)->ExceptionCheck(jni);
-       if(exc) {
-               fprintf(stderr, "%s:%d: ", file, line);
-               (*jni)->ExceptionDescribe(jni);
-               (*jni)->ExceptionClear(jni);
-               stop_vm(env);
-               abort();
-       }
-}
-
-#define CHECK(env) check(env, __FILE__, __LINE__)
-
-enum {
-       mth_add_int_edge,
-       mth_add_aff_edge,
-       mth_set_color,
-       //mth_set_debug,
-       mth_get_color,
-       mth_forbid_color,
-       mth_coalesce,
-       mth_dump,
-       mth_finish,
-       mth_last
-};
-
-struct _mth_info_t {
-       const char *name;
-       const char *sig;
-};
-
-static const struct _mth_info_t mthis[mth_last] = {
-       { "addIntEdge",  "(II)V"                   }, /* public void addIntEdge(int, int); */
-       { "addAffEdge",  "(III)V"                  }, /* public void addAffEdge(int, int, int); */
-       { "setColor",    "(II)V"                   }, /* public void setColor(int, int); */
-       //{ "setDebug",    "(ILjava/lang/String;)V"  }, /* public void setDebug(int, String); */
-       { "getColor",    "(I)I"                    }, /* public int getColor(int); */
-       { "forbidColor", "(II)V"                   }, /* public void forbidColor(int, int); */
-       { "coalesce",    "()V"                     }, /* public void coalesce(); */
-       { "dump",        "(Ljava/lang/String;)V"   }, /* public void dump(String); */
-       { "finish",      "()V"                     }  /* public void finish(); */
-};
-
-/* public static coalescing.Extern createExtern(java.lang.String, int, int, int); */
-static const struct _mth_info_t mthi_factory = {
-       "createExtern", "(Ljava/lang/String;III)Lcoalescing/Extern;"
-};
-
-struct _be_java_coal_t {
-       jni_env_t *env;
-       jclass    cls;
-       jobject   obj;
-
-       jmethodID mth_ids[mth_last];
-};
-
-static void jc_call_void(be_java_coal_t *c, int mth_index, ...)
-{
-       JNIEnv *jni   = c->env->jni;
-       jmethodID mid = c->mth_ids[mth_index];
-
-       va_list args;
-
-       va_start(args, mth_index);
-       (*jni)->CallVoidMethodV(jni, c->obj, mid, args);
-       CHECK(c->env);
-       va_end(args);
-}
-
-static int jc_call_int(be_java_coal_t *c, int mth_index, ...)
-{
-       JNIEnv *jni   = c->env->jni;
-       jmethodID mid = c->mth_ids[mth_index];
-
-       int res;
-       va_list args;
-
-       va_start(args, mth_index);
-       res = (*jni)->CallIntMethodV(jni, c->obj, mid, args);
-       CHECK(c->env);
-       va_end(args);
-
-       return res;
-}
-
-be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level)
-{
-       jni_env_t *env = get_jvm();
-       JNIEnv *jni = env->jni;
-       jmethodID fact;
-       jclass cls;
-       jstring str;
-       int i;
-
-       be_java_coal_t *c = XMALLOCZ(be_java_coal_t);
-       c->env = env;
-
-       /* Find the class we are are looking for. */
-       cls = (*jni)->FindClass(jni, cls_name);
-       CHECK(env);
-
-       /* Get the static factory method. */
-       fact = (*jni)->GetStaticMethodID(jni, cls, mthi_factory.name, mthi_factory.sig);
-       CHECK(env);
-
-       /* Call the factory. */
-       str = (*jni)->NewStringUTF(jni, graph_name);
-       CHECK(env);
-       c->obj = (*jni)->CallStaticObjectMethod(jni, cls, fact, str, n_nodes, n_regs, dbg_level);
-       CHECK(env);
-       c->cls = (*jni)->GetObjectClass(jni, c->obj);
-
-       /* Reference the created object. */
-       c->obj = (*jni)->NewGlobalRef(jni, c->obj);
-       CHECK(env);
-
-       /* Lookup the member methods of the object. */
-       for(i = 0; i < mth_last; ++i) {
-               c->mth_ids[i] = (*jni)->GetMethodID(jni, c->cls, mthis[i].name, mthis[i].sig);
-               CHECK(env);
-       }
-
-       return c;
-}
-
-void be_java_coal_destroy(be_java_coal_t *c) {
-       JNIEnv *jni = c->env->jni;
-       jc_call_void(c, mth_finish);
-       (*jni)->DeleteGlobalRef(jni, c->obj);
-       free(c);
-}
-
-void be_java_coal_add_int_edge(be_java_coal_t *c, int n, int m)
-{
-       jc_call_void(c, mth_add_int_edge, (jint) n, (jint) m);
-}
-
-void be_java_coal_add_aff_edge(be_java_coal_t *c, int n, int m, int weight)
-{
-       jc_call_void(c, mth_add_aff_edge, (jint) n, (jint) m, (jint) weight);
-}
-
-void be_java_coal_set_color(be_java_coal_t *c, int n, int col)
-{
-       jc_call_void(c, mth_set_color, (jint) n, (jint) col);
-}
-
-void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg)
-{
-       (void) c;
-       (void) n;
-       (void) dbg;
-#if 0
-       JNIEnv *jni   = c->env->jni;
-       jmethodID mid = c->mth_ids[mth_set_debug];
-       jstring str;
-
-       str = (*jni)->NewStringUTF(jni, dbg);
-       CHECK(c->env);
-       (*jni)->CallVoidMethod(jni, c->obj, mid, (jint) n, str);
-       CHECK(c->env);
-#endif /* if 0 */
-}
-
-void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col)
-{
-       jc_call_void(c, mth_forbid_color, (jint) n, (jint) col);
-}
-
-void be_java_coal_coalesce(be_java_coal_t *c)
-{
-       jc_call_void(c, mth_coalesce);
-}
-
-void be_java_coal_dump(be_java_coal_t *c, const char *fn)
-{
-       JNIEnv *jni   = c->env->jni;
-       jmethodID mid = c->mth_ids[mth_dump];
-       jstring str;
-
-       str = (*jni)->NewStringUTF(jni, fn);
-       CHECK(c->env);
-       (*jni)->CallVoidMethod(jni, c->obj, mid, str);
-       CHECK(c->env);
-}
-
-int be_java_coal_get_color(be_java_coal_t *c, int n)
-{
-       return jc_call_int(c, mth_get_color, (jint) n);
-}
-
-void be_java_coal_start_jvm(void)
-{
-       get_jvm();
-}
-
-#else /* ! WITH_JVM */
-
-void be_java_coal_start_jvm(void)
-{
-}
-
-#endif /* WITH_JVM */
diff --git a/ir/be/bejavacoal.h b/ir/be/bejavacoal.h
deleted file mode 100644 (file)
index cbf7aa6..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief       Interface for external Java coalescer.
- * @author      Sebastian Hack
- * @version     $Id$
- */
-#ifndef FIRM_BE_BEJAVACOAL_H
-#define FIRM_BE_BEJAVACOAL_H
-
-struct _be_java_coal_t;
-typedef struct _be_java_coal_t be_java_coal_t;
-
-/**
- * Add an interference edge
- * @param n first node id.
- * @param m second node id.
- */
-void be_java_coal_add_int_edge(be_java_coal_t *c, int n, int m);
-
-/**
- * Add an affinity edge.
- * @param n first node id.
- * @param m second node id.
- * @param costs Costs for the edge.
- */
-void be_java_coal_add_aff_edge(be_java_coal_t *c, int n, int m, int costs);
-
-/**
- * Set the color of a node.
- * @param n The node.
- * @param col The color.
- */
-void be_java_coal_set_color(be_java_coal_t *c, int n, int col);
-
-/**
- * Set debug information for a node.
- * @param n The node.
- * @param dbg Some string copied to Java.
- */
-void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg);
-
-/**
- * Forbid a color for a node.
- * Afterwards, the node may not be assigned that color.
- * @param n The node.
- * @param col The color.
- */
-void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col);
-
-/**
- * Start the coalescing.
- */
-void be_java_coal_coalesce(be_java_coal_t *c);
-
-/**
- * Dump the graph into a dot file.
- * @param fn Filename to dump to.
- */
-void be_java_coal_dump(be_java_coal_t *c, const char *fn);
-
-/**
- * Get the color of a node.
- * @param n The node.
- * @return The color of the node.
- */
-int be_java_coal_get_color(be_java_coal_t *c, int n);
-
-/**
- * Init the JAVA coalescer.
- * @param graph_name The name of the graph to coalesce.
- * @param n_nodes The number of nodes in the graph. Each node has an ID which ranges from 0 to n_nodes - 1.
- * @param n_regs  The number of colors available.
- * @param dbg_level Te debug level for the coalescer. 0 means quiet. >0 more verbose.
- * @return The coalescing object.
- */
-be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level);
-
-/**
- * Start the JVM.
- * This is also done lazily by be_java_coal_init() but as that is called by
- * the coalescing driver, it might tamper the runtime measurements. So here is
- * an extra call.
- */
-void be_java_coal_start_jvm(void);
-
-/**
- * Destroy the coalescing object.
- */
-void be_java_coal_destroy(be_java_coal_t *c);
-
-#endif /* FIRM_BE_BEJAVACOAL_H */
index dda79d9..c6e6735 100644 (file)
@@ -43,7 +43,6 @@ void be_init_chordal(void);
 void be_init_chordal_main(void);
 void be_init_copycoal(void);
 void be_init_copyheur2(void);
-void be_init_copyheur3(void);
 void be_init_copyheur4(void);
 void be_init_copyheur5(void);
 void be_init_copystat(void);
@@ -57,7 +56,6 @@ void be_init_arch_sta(void);
 void be_init_arch_TEMPLATE(void);
 void be_init_ilpsched(void);
 void be_init_copyilp(void);
-void be_init_javacoal(void);
 void be_init_peephole(void);
 void be_init_ra(void);
 void be_init_spillbelady(void);
@@ -130,11 +128,6 @@ void be_init_modules(void)
        be_init_copyilp();
 #endif /* WITH_ILP */
 
-#ifdef WITH_JVM
-       be_init_copyheur3();
-       be_init_javacoal();
-#endif /* WITH_JVM */
-
 #if PLUGIN_IR_BE_STA
        be_init_arch_sta();
 #endif /* PLUGIN_IR_BE_STA */
index f13938d..503db08 100644 (file)
@@ -55,7 +55,6 @@
 #include "belive_t.h"
 #include "benode_t.h"
 #include "bechordal_t.h"
-#include "bejavacoal.h"
 #include "bespilloptions.h"
 #include "bestatevent.h"
 #include "bessaconstr.h"
index 408222c..cc58ba3 100644 (file)
@@ -43,7 +43,6 @@
 #include "besched.h"
 #include "bespillslots.h"
 #include "bechordal_t.h"
-#include "bejavacoal.h"
 #include "bestatevent.h"
 #include "bespilloptions.h"
 #include "bemodule.h"