Obj *bytecode_eval(Process *process, Obj *bytecodeObj) { if(bytecodeObj->tag != 'X') { set_error_return_nil("The code to eval must be bytecode, ", bytecodeObj); } shadow_stack_push(process, bytecodeObj); process->frames[process->frame].p = 0; process->frames[process->frame].bytecodeObj = bytecodeObj; process->frames[process->frame].env = process->global_env; Obj *final_result = NULL; while(!final_result) { final_result = bytecode_eval_internal(process, bytecodeObj, 100); } shadow_stack_pop(process); return final_result; }
Obj *process_tick(Process *process) { if(!process->final_result) { process->final_result = bytecode_eval_internal(process, process->bytecodeObj, 100, 0); } return process->final_result; }