#define COMP_DEBUG 1
+/*
+ If 1 always favorite the emission of direct constants when these are know
+ instead of the corresponding frame slot access.
+ This has to prove to have some perf advantage but certainly makes the
+ generated code C-like code more bloated.
+*/
+
+#define CONST_PROP_MAX 0
+
#define STR(s) #s
#define FIRST(x) \
static gcc_jit_rvalue *
emit_mvar_val (Lisp_Object mvar)
{
- if (NILP (FUNCALL1 (comp-mvar-const-vld, mvar)))
- return
- gcc_jit_lvalue_as_rvalue(
- comp.frame[XFIXNUM (FUNCALL1 (comp-mvar-slot, mvar))]);
+ if (CONST_PROP_MAX)
+ {
+ if (NILP (FUNCALL1 (comp-mvar-const-vld, mvar)))
+ return
+ gcc_jit_lvalue_as_rvalue(
+ comp.frame[XFIXNUM (FUNCALL1 (comp-mvar-slot, mvar))]);
+ else
+ return emit_lisp_obj_from_ptr (FUNCALL1 (comp-mvar-constant, mvar));
+ }
else
- return emit_lisp_obj_from_ptr (FUNCALL1 (comp-mvar-constant, mvar));
+ {
+ if (NILP (FUNCALL1 (comp-mvar-slot, mvar)))
+ {
+ /* If the slot is not specified this must be a constant. */
+ eassert (!NILP (FUNCALL1 (comp-mvar-const-vld, mvar)));
+ return emit_lisp_obj_from_ptr (FUNCALL1 (comp-mvar-constant, mvar));
+ }
+ return
+ gcc_jit_lvalue_as_rvalue(
+ comp.frame[XFIXNUM (FUNCALL1 (comp-mvar-slot, mvar))]);
+ }
}
static gcc_jit_rvalue *
SET_INTERNAL_SET);
return emit_call ("set_internal", comp.void_type , 4, gcc_args);
}
- error ("LIMPLE call is inconsistet");
+ error ("LIMPLE call is inconsistent");
}
static gcc_jit_rvalue *