diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common.h | 2 | ||||
| -rw-r--r-- | src/compile/compile.c | 8 | ||||
| -rw-r--r-- | src/ejit.c | 8 | 
3 files changed, 12 insertions, 6 deletions
| diff --git a/src/common.h b/src/common.h index c3442c6..1e21e89 100644 --- a/src/common.h +++ b/src/common.h @@ -152,6 +152,6 @@ union interp_ret ejit_interp(struct ejit_func *f, size_t argc,  int64_t ejit_run_interp(struct ejit_func *f, size_t argc,                       struct ejit_arg args[argc], struct interp_state *state); -bool ejit_compile(struct ejit_func *f); +bool ejit_compile(struct ejit_func *f, bool use_64);  #endif /* EJIT_COMMON_H */ diff --git a/src/compile/compile.c b/src/compile/compile.c index c9a92a2..4ac68d3 100644 --- a/src/compile/compile.c +++ b/src/compile/compile.c @@ -522,8 +522,14 @@ static size_t compile_fn_body(struct ejit_func *f, jit_state_t *j, void *arena,  	return size;  } -bool ejit_compile(struct ejit_func *f) +bool ejit_compile(struct ejit_func *f, bool use_64)  { +	(void)use_64; +#if __WORDSIZE == 32 +	/* can't compile 64bit code on 32bit systems, give up early */ +	if (use_64) +		return false; +#endif  	if (!init_jit())  		return false; @@ -60,13 +60,13 @@ struct ejit_func *ejit_create_func(enum ejit_type rtype, size_t argc,  	return f;  } -void ejit_compile_func(struct ejit_func *f, size_t gpr, size_t fpr) +void ejit_compile_func(struct ejit_func *f, size_t gpr, size_t fpr, bool use_64)  { -	ejit_select_compile_func(f, gpr, fpr, true); +	ejit_select_compile_func(f, gpr, fpr, use_64, true);  }  void ejit_select_compile_func(struct ejit_func *f, size_t gpr, size_t fpr, -                              bool try_jit) +                              bool use_64, bool try_jit)  {  	/* emit a final end instruction in case user didn't do a return */  	emit_insn_i(f, END, 0, 0, 0); @@ -75,7 +75,7 @@ void ejit_select_compile_func(struct ejit_func *f, size_t gpr, size_t fpr,  	f->fpr = fpr;  	/* try to jit compile if possible */ -	if (try_jit && ejit_compile(f)) +	if (try_jit && ejit_compile(f, use_64))  		return;  	/* otherwise, convert opcodes to address labels */ | 
