Disabling JIT compiler works correctly again.

[INTERPRETER]
* BUG: Disabling JIT compiler works correctly again.
This commit is contained in:
gambas 2019-03-13 12:59:14 +01:00
parent dd336c2067
commit 63d9d81bd2
4 changed files with 10 additions and 14 deletions

View file

@ -879,11 +879,8 @@ static void error_EXEC_function_real(void)
void EXEC_function_real()
{
EXEC.func = &EXEC.class->load->func[EXEC.index];
if (EXEC.func->fast)
{
JIT_exec(FALSE);
if (EXEC.func->fast && !JIT_exec(FALSE))
return;
}
// We need to push a void frame, because EXEC_leave looks at *PC to know if a return value is expected
STACK_push_frame(&EXEC_current, 0);

View file

@ -1145,9 +1145,8 @@ _CALL:
__EXEC_ENTER:
if (EXEC.func->fast)
if (EXEC.func->fast && !JIT_exec(TRUE))
{
JIT_exec(TRUE);
goto _NEXT;
}
else
@ -1231,9 +1230,8 @@ _CALL:
EXEC.class = EXEC.desc->class;
EXEC.func = &EXEC.class->load->func[EXEC.index];
if (EXEC.func->fast)
if (EXEC.func->fast && !JIT_exec(TRUE))
{
JIT_exec(TRUE);
goto _NEXT;
}
else
@ -1411,9 +1409,8 @@ _CALL_SLOW:
EXEC.func = &EXEC.class->load->func[EXEC.index];
if (EXEC.func->fast)
if (EXEC.func->fast && !JIT_exec(TRUE))
{
JIT_exec(TRUE);
goto _NEXT;
}
else

View file

@ -61,7 +61,7 @@ void JIT_abort(void)
{
static GB_FUNCTION _func;
if (!_component_loaded)
if (!_component_loaded || JIT_disabled)
return;
if (GB_GetFunction(&_func, CLASS_find_global("Jit"), "_Abort", NULL, NULL))
@ -232,7 +232,7 @@ static bool create_function(CLASS *class, int index)
}
void JIT_exec(bool ret_on_stack)
bool JIT_exec(bool ret_on_stack)
{
VALUE *sp = SP;
JIT_FUNCTION *jit;
@ -250,7 +250,7 @@ void JIT_exec(bool ret_on_stack)
if (!func->fast_linked)
{
if (create_function(class, EXEC.index))
return;
return TRUE;
}
STACK_push_frame(&EXEC_current, func->stack_usage);
@ -309,6 +309,8 @@ void JIT_exec(bool ret_on_stack)
*SP++ = ret;
ret.type = T_VOID;
}
return FALSE;
}
PCODE *JIT_get_code(FUNCTION *func)

View file

@ -40,7 +40,7 @@ extern bool JIT_disabled;
void JIT_compile(ARCHIVE *arch);
void JIT_debug(const char *fmt, ...);
void JIT_exec(bool ret_on_stack);
bool JIT_exec(bool ret_on_stack);
PCODE *JIT_get_code(FUNCTION *func);
CLASS_CONST *JIT_get_constant(int index);
void *JIT_get_class_ref(int index);