Line data Source code
1 : #include "fd_vm_base.h" 2 : #include "fd_vm_private.h" 3 : #include "../runtime/tests/fd_dump_pb.h" 4 : 5 : /* FIXME: MAKE DIFFERENT VERSIONS FOR EACH COMBO OF CHECK_ALIGN/TRACE? */ 6 : /* TODO: factor out common unpacking code */ 7 : 8 : int 9 7779 : fd_vm_exec_notrace( fd_vm_t * vm ) { 10 : 11 7779 : # undef FD_VM_INTERP_EXE_TRACING_ENABLED 12 7779 : # undef FD_VM_INTERP_MEM_TRACING_ENABLED 13 : 14 : /* Pull out variables needed for the fd_vm_interp_core template */ 15 7779 : ulong frame_max = FD_VM_STACK_FRAME_MAX; /* FIXME: vm->frame_max to make this run-time configured */ 16 : 17 7779 : ulong const * FD_RESTRICT text = vm->text; 18 7779 : ulong text_cnt = vm->text_cnt; 19 7779 : ulong entry_pc = vm->entry_pc; 20 7779 : ulong const * FD_RESTRICT calldests = vm->calldests; 21 : 22 7779 : fd_sbpf_syscalls_t const * FD_RESTRICT syscalls = vm->syscalls; 23 : 24 7779 : ulong const * FD_RESTRICT region_haddr = vm->region_haddr; 25 7779 : uint const * FD_RESTRICT region_ld_sz = vm->region_ld_sz; 26 7779 : uint const * FD_RESTRICT region_st_sz = vm->region_st_sz; 27 : 28 7779 : ulong * FD_RESTRICT reg = vm->reg; 29 : 30 7779 : fd_vm_shadow_t * FD_RESTRICT shadow = vm->shadow; 31 : 32 7779 : int err = FD_VM_SUCCESS; 33 : 34 : /* Run the VM */ 35 7779 : # include "fd_vm_interp_core.c" 36 : 37 7779 : return err; 38 936351 : } 39 : 40 : int 41 0 : fd_vm_exec_trace( fd_vm_t * vm ) { 42 : 43 0 : # define FD_VM_INTERP_EXE_TRACING_ENABLED 1 44 0 : # define FD_VM_INTERP_MEM_TRACING_ENABLED 1 45 : 46 : /* Pull out variables needed for the fd_vm_interp_core template */ 47 0 : ulong frame_max = FD_VM_STACK_FRAME_MAX; /* FIXME: vm->frame_max to make this run-time configured */ 48 : 49 0 : ulong const * FD_RESTRICT text = vm->text; 50 0 : ulong text_cnt = vm->text_cnt; 51 0 : ulong entry_pc = vm->entry_pc; 52 0 : ulong const * FD_RESTRICT calldests = vm->calldests; 53 : 54 0 : fd_sbpf_syscalls_t const * FD_RESTRICT syscalls = vm->syscalls; 55 : 56 0 : ulong const * FD_RESTRICT region_haddr = vm->region_haddr; 57 0 : uint const * FD_RESTRICT region_ld_sz = vm->region_ld_sz; 58 0 : uint const * FD_RESTRICT region_st_sz = vm->region_st_sz; 59 : 60 0 : ulong * FD_RESTRICT reg = vm->reg; 61 : 62 0 : fd_vm_shadow_t * FD_RESTRICT shadow = vm->shadow; 63 : 64 0 : int err = FD_VM_SUCCESS; 65 : 66 : /* Run the VM */ 67 0 : # include "fd_vm_interp_core.c" 68 : 69 0 : # undef FD_VM_INTERP_EXE_TRACING_ENABLED 70 0 : # undef FD_VM_INTERP_MEM_TRACING_ENABLED 71 : 72 0 : return err; 73 0 : }