LCOV - code coverage report
Current view: top level - flamenco/vm - fd_vm_interp.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 18 38 47.4 %
Date: 2025-08-05 05:04:49 Functions: 1 2 50.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        7779 : fd_vm_exec_notrace( fd_vm_t * vm ) {
       9             : 
      10        7779 : # undef FD_VM_INTERP_EXE_TRACING_ENABLED
      11        7779 : # undef FD_VM_INTERP_MEM_TRACING_ENABLED
      12             : 
      13             :   /* Pull out variables needed for the fd_vm_interp_core template */
      14        7779 :   ulong frame_max   = FD_VM_STACK_FRAME_MAX; /* FIXME: vm->frame_max to make this run-time configured */
      15             : 
      16        7779 :   ulong const * FD_RESTRICT text          = vm->text;
      17        7779 :   ulong                     text_cnt      = vm->text_cnt;
      18        7779 :   ulong                     entry_pc      = vm->entry_pc;
      19        7779 :   ulong const * FD_RESTRICT calldests     = vm->calldests;
      20             : 
      21        7779 :   fd_sbpf_syscalls_t const * FD_RESTRICT syscalls = vm->syscalls;
      22             : 
      23        7779 :   ulong const * FD_RESTRICT region_haddr = vm->region_haddr;
      24        7779 :   uint  const * FD_RESTRICT region_ld_sz = vm->region_ld_sz;
      25        7779 :   uint  const * FD_RESTRICT region_st_sz = vm->region_st_sz;
      26             : 
      27        7779 :   ulong * FD_RESTRICT reg = vm->reg;
      28             : 
      29        7779 :   fd_vm_shadow_t * FD_RESTRICT shadow = vm->shadow;
      30             : 
      31        7779 :   int err = FD_VM_SUCCESS;
      32             : 
      33             :   /* Run the VM */
      34        7779 : # include "fd_vm_interp_core.c"
      35             : 
      36        7779 :   return err;
      37      936351 : }
      38             : 
      39             : int
      40           0 : fd_vm_exec_trace( fd_vm_t * vm ) {
      41             : 
      42           0 : # define FD_VM_INTERP_EXE_TRACING_ENABLED 1
      43           0 : # define FD_VM_INTERP_MEM_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 * FD_RESTRICT region_ld_sz = vm->region_ld_sz;
      57           0 :   uint  const * FD_RESTRICT region_st_sz = vm->region_st_sz;
      58             : 
      59           0 :   ulong * FD_RESTRICT 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           0 : # undef FD_VM_INTERP_MEM_TRACING_ENABLED
      70             : 
      71           0 :   return err;
      72           0 : }

Generated by: LCOV version 1.14