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