aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-04-02 21:16:13 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-04-02 21:16:13 +0300
commit89d9f5c3fc59eff3b1a46fe6d44f5ee92eeb7be4 (patch)
tree98e2ab35e8332e7dea389b1b680a32e974057406
parentb6642566af5ca9a21b7ce36ce9a996ff73f52da1 (diff)
downloadejit-alloca.tar.gz
ejit-alloca.zip
armhf seems to workalloca
-rwxr-xr-xscripts/select-compile1
-rw-r--r--src/compile/compile.c4
-rw-r--r--src/ejit.c1
-rw-r--r--src/interp.c10
4 files changed, 9 insertions, 7 deletions
diff --git a/scripts/select-compile b/scripts/select-compile
index 38fc7b0..37c67a1 100755
--- a/scripts/select-compile
+++ b/scripts/select-compile
@@ -13,6 +13,7 @@ case "$ARCH" in
mips64el) echo "$JIT" ;;
aarch64) echo "$JIT" ;;
mipsel) echo "$JIT" ;;
+ armhf) echo "$JIT" ;;
amd64) echo "$JIT" ;;
x86*) echo "$JIT" ;;
*) echo "$NOJIT" ;;
diff --git a/src/compile/compile.c b/src/compile/compile.c
index dac8dfd..3b5399a 100644
--- a/src/compile/compile.c
+++ b/src/compile/compile.c
@@ -1927,7 +1927,7 @@ static void compile_trampoline(struct ejit_func *f, jit_state_t *j)
jit_leave_jit_abi(j, 0, 0, frame);
jit_ret(j); /* should just forward the return value */
- f->direct_call = jit_address(j);
+ f->direct_call = jit_address_to_function_pointer(jit_address(j));
jit_patch_here(j, r);
operands_destroy(&args);
@@ -2435,7 +2435,7 @@ calli:
relocs_destroy(&relocs);
addrs_destroy(&addrs);
- if (jit_end(j, &size))
+ if ((f->extern_call = jit_end(j, &size)))
return 0;
return size;
diff --git a/src/ejit.c b/src/ejit.c
index 0ee3986..75f6a6a 100644
--- a/src/ejit.c
+++ b/src/ejit.c
@@ -345,6 +345,7 @@ struct ejit_func *ejit_create_func(enum ejit_type rtype, size_t argc,
f->fpr = fpr_stats_create();
f->arena = NULL;
f->direct_call = NULL;
+ f->extern_call = NULL;
f->size = 0;
f->prio = 1;
f->use_64 = false;
diff --git a/src/interp.c b/src/interp.c
index 049498a..e7be77b 100644
--- a/src/interp.c
+++ b/src/interp.c
@@ -227,24 +227,24 @@ union interp_ret ejit_run(struct ejit_func *f, size_t paramc, struct ejit_arg pa
assert(f->size && "trying to run a function that hasn't been compiled");
- if (f->arena) {
+ if (f->extern_call) {
if (f->rtype == EJIT_INT64 || f->rtype == EJIT_UINT64)
return (union interp_ret){
- .i = ((ejit_escape_l_t)f->arena)(paramc, params)
+ .i = ((ejit_escape_l_t)f->extern_call)(paramc, params)
};
if (f->rtype == EJIT_DOUBLE)
return (union interp_ret){
- .f = ((ejit_escape_d_t)f->arena)(paramc, params)
+ .f = ((ejit_escape_d_t)f->extern_call)(paramc, params)
};
if (f->rtype == EJIT_FLOAT)
return (union interp_ret){
- .f = ((ejit_escape_f_t)f->arena)(paramc, params)
+ .f = ((ejit_escape_f_t)f->extern_call)(paramc, params)
};
return (union interp_ret){
- .i = ((ejit_escape_i_t)f->arena)(paramc, params)
+ .i = ((ejit_escape_i_t)f->extern_call)(paramc, params)
};
}