aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2019-07-18 17:35:30 +0200
committerAndrea Corallo2020-01-01 11:33:54 +0100
commit13811eba32c8d43126e3d137ddcedbdab4dd81c6 (patch)
tree6cd09cf25be430eae02fc13120616df146061338 /src
parentc87027e054ec247f3c7b80b2159cfcc633bfab7c (diff)
downloademacs-13811eba32c8d43126e3d137ddcedbdab4dd81c6.tar.gz
emacs-13811eba32c8d43126e3d137ddcedbdab4dd81c6.zip
better generated code
Diffstat (limited to 'src')
-rw-r--r--src/comp.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/comp.c b/src/comp.c
index 03a9e4b286d..152a0e61808 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -35,6 +35,15 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
35 35
36#define COMP_DEBUG 1 36#define COMP_DEBUG 1
37 37
38/*
39 If 1 always favorite the emission of direct constants when these are know
40 instead of the corresponding frame slot access.
41 This has to prove to have some perf advantage but certainly makes the
42 generated code C-like code more bloated.
43*/
44
45#define CONST_PROP_MAX 0
46
38#define STR(s) #s 47#define STR(s) #s
39 48
40#define FIRST(x) \ 49#define FIRST(x) \
@@ -958,12 +967,27 @@ emit_PURE_P (gcc_jit_rvalue *ptr)
958static gcc_jit_rvalue * 967static gcc_jit_rvalue *
959emit_mvar_val (Lisp_Object mvar) 968emit_mvar_val (Lisp_Object mvar)
960{ 969{
961 if (NILP (FUNCALL1 (comp-mvar-const-vld, mvar))) 970 if (CONST_PROP_MAX)
962 return 971 {
963 gcc_jit_lvalue_as_rvalue( 972 if (NILP (FUNCALL1 (comp-mvar-const-vld, mvar)))
964 comp.frame[XFIXNUM (FUNCALL1 (comp-mvar-slot, mvar))]); 973 return
974 gcc_jit_lvalue_as_rvalue(
975 comp.frame[XFIXNUM (FUNCALL1 (comp-mvar-slot, mvar))]);
976 else
977 return emit_lisp_obj_from_ptr (FUNCALL1 (comp-mvar-constant, mvar));
978 }
965 else 979 else
966 return emit_lisp_obj_from_ptr (FUNCALL1 (comp-mvar-constant, mvar)); 980 {
981 if (NILP (FUNCALL1 (comp-mvar-slot, mvar)))
982 {
983 /* If the slot is not specified this must be a constant. */
984 eassert (!NILP (FUNCALL1 (comp-mvar-const-vld, mvar)));
985 return emit_lisp_obj_from_ptr (FUNCALL1 (comp-mvar-constant, mvar));
986 }
987 return
988 gcc_jit_lvalue_as_rvalue(
989 comp.frame[XFIXNUM (FUNCALL1 (comp-mvar-slot, mvar))]);
990 }
967} 991}
968 992
969static gcc_jit_rvalue * 993static gcc_jit_rvalue *
@@ -1007,7 +1031,7 @@ emit_limple_call (Lisp_Object arg1)
1007 SET_INTERNAL_SET); 1031 SET_INTERNAL_SET);
1008 return emit_call ("set_internal", comp.void_type , 4, gcc_args); 1032 return emit_call ("set_internal", comp.void_type , 4, gcc_args);
1009 } 1033 }
1010 error ("LIMPLE call is inconsistet"); 1034 error ("LIMPLE call is inconsistent");
1011} 1035}
1012 1036
1013static gcc_jit_rvalue * 1037static gcc_jit_rvalue *