projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
prepare varargs calls
[m6w6/ext-psi]
/
src
/
libjit.c
diff --git
a/src/libjit.c
b/src/libjit.c
index 736b54dbbbd67e7a2a61b12b44b9cba7934d90b3..13c0aa46f8e13d8420cee2146af1304058b6e098 100644
(file)
--- a/
src/libjit.c
+++ b/
src/libjit.c
@@
-1,4
+1,11
@@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "php.h"
#include "php.h"
+
+#ifdef HAVE_LIBJIT
+
#include "php_psi.h"
#include "libjit.h"
#include "php_psi.h"
#include "libjit.h"
@@
-80,6
+87,8
@@
static inline PSI_LibjitCall *PSI_LibjitCallAlloc(PSI_Context *C, decl *decl) {
call->params[c] = NULL;
decl->call.info = call;
call->params[c] = NULL;
decl->call.info = call;
+ decl->call.rval = decl->func->ptr;
+ decl->call.argc = c;
decl->call.args = (void **) &call->params[c+1];
call->signature = jit_type_create_signature(
decl->call.args = (void **) &call->params[c+1];
call->signature = jit_type_create_signature(
@@
-142,12
+151,14
@@
static void psi_jit_init(PSI_Context *C)
static void psi_jit_dtor(PSI_Context *C)
{
static void psi_jit_dtor(PSI_Context *C)
{
- size_t i;
+ if (C->decls) {
+ size_t i;
- for (i = 0; i < C->decls->count; ++i) {
- decl *decl = C->decls->list[i];
+
for (i = 0; i < C->decls->count; ++i) {
+
decl *decl = C->decls->list[i];
- PSI_LibjitCallFree(decl->call.info);
+ PSI_LibjitCallFree(decl->call.info);
+ }
}
PSI_LibjitContextFree((void *) &C->context);
}
}
PSI_LibjitContextFree((void *) &C->context);
}
@@
-199,11
+210,11
@@
static zend_function_entry *psi_jit_compile(PSI_Context *C)
return zfe;
}
return zfe;
}
-static void psi_jit_call(PSI_Context *C,
impl_val *ret_val, decl *dec
l) {
- PSI_LibjitCall *call = decl
->call.
info;
+static void psi_jit_call(PSI_Context *C,
decl_callinfo *decl_cal
l) {
+ PSI_LibjitCall *call = decl
_call->
info;
- jit_apply(call->signature, decl
->call.sym, decl->call.
args,
- decl
->args->count, ret_
val);
+ jit_apply(call->signature, decl
_call->sym, decl_call->
args,
+ decl
_call->argc, decl_call->r
val);
}
static PSI_ContextOps ops = {
}
static PSI_ContextOps ops = {
@@
-217,3
+228,5
@@
PSI_ContextOps *PSI_Libjit(void)
{
return &ops;
}
{
return &ops;
}
+
+#endif /* HAVE_LIBJIT */