// TODO: Activate Omit fp in epilogue
if(env->flags.try_omit_fp) {
- curr_sp = be_new_IncSP(env->isa->sp, env->irg, bl, curr_sp, *mem, BE_STACK_FRAME_SIZE_SHRINK);
+ curr_sp = be_new_IncSP(env->isa->sp, env->irg, bl, curr_sp, BE_STACK_FRAME_SIZE_SHRINK);
+ add_irn_dep(curr_sp, *mem);
curr_lr = be_new_CopyKeep_single(&arm_reg_classes[CLASS_arm_gp], env->irg, bl, curr_lr, curr_sp, get_irn_mode(curr_lr));
be_node_set_reg_class(curr_lr, 1, &arm_reg_classes[CLASS_arm_gp]);
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;
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) {
mth_add_int_edge,
mth_add_aff_edge,
mth_set_color,
+ mth_set_debug,
mth_get_color,
mth_forbid_color,
mth_coalesce,
{ "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(); */
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)
+{
+ 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);
+}
+
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);
assert(0 && "use --enable-jvm");
}
+void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg)
+{
+ assert(0 && "use --enable-jvm");
+}
+
void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col)
{
assert(0 && "use --enable-jvm");
*/
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.
/* Set output constraint to stack register. */
be_set_constr_single_reg(irn, OUT_POS(0), sp);
- be_node_set_reg_class(irn, 1, sp->reg_class);
- be_node_set_reg_class(irn, 2, sp->reg_class);
- be_node_set_irn_reg(NULL, irn, sp);
+ be_node_set_reg_class(irn, be_pos_AddSP_size, sp->reg_class);
+ be_node_set_reg_class(irn, be_pos_AddSP_old_sp, sp->reg_class);
return irn;
}