LCOV - code coverage report
Current view: top level - flamenco/vm - fd_vm_interp.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 42 42 100.0 %
Date: 2025-01-08 12:08:44 Functions: 2 2 100.0 %

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

Generated by: LCOV version 1.14