21a22 > 3735,3823c3736 < /* < This assumes a closure with a function pointer to the customized vm < function in free var 0, the constants datastructure in free var 1 and < variables in free ref 2. Also the customized VM operation ends with a < tail call. < */ < VM_DEFINE_OP (175, custom_vm , "custom-vm", (X8_F24)) < { < scm_t_uint32 nlocals, proc = 0; < SCM *free = &(SCM_PROGRAM_FREE_VARIABLE_REF(FP_REF (0), 0)); < SCM fkn_scm = free[0]; < custom_vm_t fkn_cvm = (custom_vm_t) (SCM_UNPACK(fkn_scm) & (~2)); < union scm_vm_stack_element *old_fp, *old_sp = sp, *fp=vp->fp; < < nlocals = scm_to_int(free[1]); < < ALLOC_FRAME (nlocals); < < scm_simple_format(SCM_BOOL_T, < scm_from_locale_string("custom_vm(~a,~a,~a,~a,~a)~%"), < scm_list_5(free[0],free[1],free[2],free[3],free[4])); < < sp = fkn_cvm(fp, old_sp, free, &proc, 0); < < printf("BACK proc = %d, sp = %p\n",proc, (void *) (fp - sp)); < < VM_HANDLE_INTERRUPTS; < < RESET_FRAME (vp->fp - sp); < < if(proc) < { < // call < PUSH_CONTINUATION_HOOK (); < < old_fp = vp->fp; < vp->fp = SCM_FRAME_SLOT (old_fp, proc - 1); < SCM_FRAME_SET_DYNAMIC_LINK (vp->fp, old_fp); < SCM_FRAME_SET_RETURN_ADDRESS (vp->fp, ip + 1); < < RESET_FRAME (nlocals); < < if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0)))) < ip = SCM_PROGRAM_CODE (FP_REF (0)); < else < ip = (scm_t_uint32 *) vm_apply_non_program_code; < < APPLY_HOOK (); < < NEXT (0); < } < else < { < //tail call < ip = SCM_PROGRAM_CODE (FP_REF (0)); < APPLY_HOOK (); < < NEXT (0); < } < } < < { < scm_t_uint32 proc, nlocals; < union scm_vm_stack_element *old_fp; < < UNPACK_24 (op, proc); < UNPACK_24 (ip[1], nlocals); < < VM_HANDLE_INTERRUPTS; < < PUSH_CONTINUATION_HOOK (); < < old_fp = vp->fp; < vp->fp = SCM_FRAME_SLOT (old_fp, proc - 1); < SCM_FRAME_SET_DYNAMIC_LINK (vp->fp, old_fp); < SCM_FRAME_SET_RETURN_ADDRESS (vp->fp, ip + 2); < < RESET_FRAME (nlocals); < < if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0)))) < ip = SCM_PROGRAM_CODE (FP_REF (0)); < else < ip = (scm_t_uint32 *) vm_apply_non_program_code; < < APPLY_HOOK (); < < NEXT (0); < } < --- > VM_DEFINE_OP (175, unused_175, NULL, NOP) 3901,3902c3814,3815 < VM_DEFINE_OP (253, unused_253, NULL, NOP) < VM_DEFINE_OP (254, unused_254, NULL, NOP) --- > VM_DEFINE_OP (253, unused_253, NULL, NOP) > VM_DEFINE_OP (254, unused_254, NULL, NOP)