Commit 66820938 authored by Erick's avatar Erick

Added a new instruction in the VM: PUSH-HANDLER-FAR

A version of PUSH-HANDLER where handler body size cannot be expressed
with an small integer.
parent 63cf8133
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -154,14 +154,15 @@
# define DEEP_LOC_REF_FAR 149
# define DEEP_LOC_SET_FAR 150
# define CREATE_CLOSURE_FAR 151
# define IN_FXADD2 152
# define IN_FXSUB2 153
# define IN_FXMUL2 154
# define IN_FXDIV2 155
# define IN_SINT_FXADD2 156
# define IN_SINT_FXSUB2 157
# define IN_SINT_FXMUL2 158
# define IN_SINT_FXDIV2 159
# define PUSH_HANDLER_FAR 152
# define IN_FXADD2 153
# define IN_FXSUB2 154
# define IN_FXMUL2 155
# define IN_FXDIV2 156
# define IN_SINT_FXADD2 157
# define IN_SINT_FXSUB2 158
# define IN_SINT_FXMUL2 159
# define IN_SINT_FXDIV2 160
# define NB_VM_INSTR (IN_SINT_FXDIV2 +1)
#endif
......@@ -322,6 +323,7 @@ static void *jump_table[] = {
&&lab_DEEP_LOC_REF_FAR ,
&&lab_DEEP_LOC_SET_FAR ,
&&lab_CREATE_CLOSURE_FAR ,
&&lab_PUSH_HANDLER_FAR ,
&&lab_IN_FXADD2 ,
&&lab_IN_FXSUB2 ,
&&lab_IN_FXMUL2 ,
......@@ -490,6 +492,7 @@ static char *name_table[] = {
"DEEP_LOC_REF_FAR ",
"DEEP_LOC_SET_FAR ",
"CREATE_CLOSURE_FAR ",
"PUSH_HANDLER_FAR ",
"IN_FXADD2 ",
"IN_FXSUB2 ",
"IN_FXMUL2 ",
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 1-Mar-2000 19:51 (eg)
* Last file update: 26-Mar-2018 09:31 (eg)
* Last file update: 29-Jun-2018 17:09 (eg)
*/
// INLINER values
......@@ -902,7 +902,7 @@ static void run_vm(vm_thread_t *vm)
{
jbuf jb;
jbuf *old_jb = NULL; /* to make Gcc happy */
short offset, nargs=0;
int offset, nargs=0;
short tailp;
int have_global_lock = 0; /* if true, we're patching the code */
#if defined(USE_COMPUTED_GOTO)
......@@ -1426,7 +1426,9 @@ CASE(ENTER_TAIL_LET) {
CASE(PUSH_HANDLER) {
int offset = fetch_next();
offset = fetch_next();
do_push_handler:
/* place the value in val on the stack as well as the value of handlers */
if (STk_procedurep(vm->val) == STk_false)
......@@ -1446,6 +1448,11 @@ CASE(PUSH_HANDLER) {
NEXT;
}
CASE(PUSH_HANDLER_FAR) {
offset = INT_VAL(fetch_const()); // Read a FAR offset in constants */
goto do_push_handler;
}
CASE(POP_HANDLER) {
UNSAVE_HANDLER_STATE();
RESTORE_VM_STATE(vm->sp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment