Skip to content
Commits on Source (3)
......@@ -47,6 +47,7 @@ typedef
void **cp;
char **op;
GB_VALUE *ret;
bool *exec_debug;
void (*debug)(const char *fmt, ...);
JIT_PCODE *(*get_code)(void *class, int index);
void (*throw)(int code, ...) NORETURN;
......@@ -75,6 +76,7 @@ typedef
void (*push_complex)(void);
void (*push_vargs)(void);
void (*pop_vargs)(void);
void (*exec_quit)(ushort code);
}
JIT_INTERFACE;
......
......@@ -340,6 +340,7 @@ const void *const GAMBAS_JitApi[] =
(void *)&CP,
(void *)&OP,
(void *)&TEMP,
(void *)&EXEC_debug,
(void *)JIT_debug,
(void *)JIT_get_code,
(void *)THROW,
......@@ -368,6 +369,7 @@ const void *const GAMBAS_JitApi[] =
(void *)EXEC_push_complex,
(void *)EXEC_push_vargs,
(void *)EXEC_drop_vargs,
(void *)EXEC_quit,
NULL
};
......
......@@ -1943,7 +1943,7 @@ void EXEC_new(ushort code)
}
void EXEC_quit(void)
void EXEC_do_quit(void)
{
GAMBAS_DoNotRaiseEvent = TRUE;
......
......@@ -239,7 +239,7 @@ void *EXEC_create_object(CLASS *class, int np, char *event);
void EXEC_new(ushort code);
void EXEC_release_return_value(void);
void EXEC_quit(void);
void EXEC_do_quit(void);
void EXEC_dup(int n);
......@@ -345,6 +345,8 @@ void SUBR_left(ushort code);
void SUBR_mid(ushort code);
void SUBR_right(ushort code);
void EXEC_quit(ushort code);
void EXEC_push_array(ushort code);
void EXEC_pop_array(ushort code);
......
......@@ -66,7 +66,6 @@
static void my_VALUE_class_read(CLASS *class, VALUE *value, char *addr, CTYPE ctype, void *ref);
static void my_VALUE_class_constant(CLASS *class, VALUE *value, int ind);
static void _quit(ushort code);
static void _break(ushort code);
//static void _SUBR_comp(ushort code);
......@@ -1867,7 +1866,7 @@ _BREAK:
_QUIT:
_quit(code);
EXEC_quit(code);
goto _NEXT;
/*-----------------------------------------------*/
......@@ -3927,12 +3926,12 @@ __POP_ARRAY_2:
POP(); /* free the object */
}
static void _quit(ushort code)
void EXEC_quit(ushort code)
{
switch(code & 3)
{
case 0:
EXEC_quit();
EXEC_do_quit();
break;
case 1:
......@@ -3948,7 +3947,7 @@ static void _quit(ushort code)
VALUE_conv(&SP[-1], T_BYTE);
SP--;
EXEC_quit_value = (uchar)SP->_integer.value;
EXEC_quit();
EXEC_do_quit();
break;
}
}
......
......@@ -386,3 +386,4 @@ enum
#define ERROR_handler (*(ERROR_HANDLER **)(JIT.error_handler))
#define ERROR_reset JIT.error_reset
#define QUIT(_code) (SP = sp, JIT.exec_quit(_code))
......@@ -2658,9 +2658,23 @@ _BREAK:
goto _MAIN;
_QUIT:
JIT_print(" ");
if ((code & 3) == 3)
{
check_stack(1);
JIT_print("%s,", push_expr(-1, T_BYTE));
pop_stack(1);
}
JIT_print(" QUIT(0x%04X);\n", code);
goto _MAIN;
_TRY:
JIT_print(" TRY {\n", _pc);
JIT_print(" TRY {\n");
p++;
goto _MAIN;
......@@ -2723,7 +2737,6 @@ _ON_GOTO_GOSUB:
_PUSH_EVENT:
_PUSH_EXTERN:
_BYREF:
_QUIT:
_CALL_QUICK:
_CALL_SLOW:
_ILLEGAL:
......