diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-03-14 22:33:57 +0200 | 
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-03-14 23:17:04 +0200 | 
| commit | 2a2d096b61262c2059ea022379869b9c4a70eafa (patch) | |
| tree | 42f0c6a53506f613f1441a9f206e756dbae3afa7 /examples/fib.c | |
| parent | f5c729ea59d227a507f83bd94d07f4366b46d72b (diff) | |
| download | ejit-2a2d096b61262c2059ea022379869b9c4a70eafa.tar.gz ejit-2a2d096b61262c2059ea022379869b9c4a70eafa.zip | |
protect jit pages
Diffstat (limited to 'examples/fib.c')
| -rw-r--r-- | examples/fib.c | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/examples/fib.c b/examples/fib.c index 308ecd1..999546b 100644 --- a/examples/fib.c +++ b/examples/fib.c @@ -3,7 +3,7 @@  #include "../include/ejit/ejit.h" -struct ejit_func *compile(bool try_jit) +struct ejit_func *compile(bool try_jit, bool im_scawed)  {  	struct ejit_operand args[1] = {  		EJIT_OPERAND_GPR(0, EJIT_INT32) /* loc 0 contains n */ @@ -34,7 +34,7 @@ struct ejit_func *compile(bool try_jit)  	/* the highest location we used was 1, so we need to request 2 locations  	 * for general purpose registers in total. No floating point registers,  	 * so 0. */ -	ejit_select_compile_func(f, 2, 0, EJIT_USE64(int32_t), try_jit); +	ejit_select_compile_func(f, 2, 0, EJIT_USE64(int32_t), try_jit, im_scawed);  	return f;  } @@ -45,13 +45,13 @@ int main(int argc, char *argv[])  		return -1;  	} -	int try_jit = strtoull(argv[3], 0, 0); +	int jit_level = strtoull(argv[3], 0, 0);  	size_t compile_num = strtoull(argv[1], 0, 0);  	struct ejit_func **info = calloc(compile_num, sizeof(struct ejit_func *));  	clock_t t = clock();  	for(size_t i = 0; i < compile_num; ++i){ -		info[i] = compile(try_jit); +		info[i] = compile(jit_level > 0, jit_level > 1);  	}  	t = clock() - t; | 
