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: 2026-01-13 05:01:51 Functions: 1 2 50.0 %

          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        7779 : fd_vm_exec_notrace( fd_vm_t * vm ) {
      11             : 
      12        7779 : # undef FD_VM_INTERP_EXE_TRACING_ENABLED
      13        7779 : # undef FD_VM_INTERP_MEM_TRACING_ENABLED
      14             : 
      15             :   /* Pull out variables needed for the fd_vm_interp_core template */
      16        7779 :   ulong frame_max   = FD_VM_STACK_FRAME_MAX; /* FIXME: vm->frame_max to make this run-time configured */
      17             : 
      18        7779 :   ulong const * FD_RESTRICT text          = vm->text;
      19        7779 :   ulong                     text_cnt      = vm->text_cnt;
      20        7779 :   ulong                     entry_pc      = vm->entry_pc;
      21        7779 :   ulong const * FD_RESTRICT calldests     = vm->calldests;
      22             : 
      23        7779 :   fd_sbpf_syscalls_t const * FD_RESTRICT syscalls = vm->syscalls;
      24             : 
      25        7779 :   ulong const * FD_RESTRICT region_haddr = vm->region_haddr;
      26        7779 :   uint  const * FD_RESTRICT region_ld_sz = vm->region_ld_sz;
      27        7779 :   uint  const * FD_RESTRICT region_st_sz = vm->region_st_sz;
      28             : 
      29        7779 :   ulong * FD_RESTRICT reg = vm->reg;
      30             : 
      31        7779 :   fd_vm_shadow_t * FD_RESTRICT shadow = vm->shadow;
      32             : 
      33        7779 :   int err = FD_VM_SUCCESS;
      34             : 
      35             :   /* Run the VM */
      36        7779 : # include "fd_vm_interp_core.c"
      37             : 
      38        7779 :   return err;
      39      936159 : }
      40             : 
      41             : int
      42           0 : fd_vm_exec_trace( fd_vm_t * vm ) {
      43             : 
      44           0 : # define FD_VM_INTERP_EXE_TRACING_ENABLED 1
      45           0 : # define FD_VM_INTERP_MEM_TRACING_ENABLED 1
      46             : 
      47             :   /* Pull out variables needed for the fd_vm_interp_core template */
      48           0 :   ulong frame_max   = FD_VM_STACK_FRAME_MAX; /* FIXME: vm->frame_max to make this run-time configured */
      49             : 
      50           0 :   ulong const * FD_RESTRICT text          = vm->text;
      51           0 :   ulong                     text_cnt      = vm->text_cnt;
      52           0 :   ulong                     entry_pc      = vm->entry_pc;
      53           0 :   ulong const * FD_RESTRICT calldests     = vm->calldests;
      54             : 
      55           0 :   fd_sbpf_syscalls_t const * FD_RESTRICT syscalls = vm->syscalls;
      56             : 
      57           0 :   ulong const * FD_RESTRICT region_haddr = vm->region_haddr;
      58           0 :   uint  const * FD_RESTRICT region_ld_sz = vm->region_ld_sz;
      59           0 :   uint  const * FD_RESTRICT region_st_sz = vm->region_st_sz;
      60             : 
      61           0 :   ulong * FD_RESTRICT reg = vm->reg;
      62             : 
      63           0 :   fd_vm_shadow_t * FD_RESTRICT shadow = vm->shadow;
      64             : 
      65           0 :   int err = FD_VM_SUCCESS;
      66             : 
      67             :   /* Run the VM */
      68           0 : # include "fd_vm_interp_core.c"
      69             : 
      70           0 : # undef FD_VM_INTERP_EXE_TRACING_ENABLED
      71           0 : # undef FD_VM_INTERP_MEM_TRACING_ENABLED
      72             : 
      73           0 :   return err;
      74           0 : }

Generated by: LCOV version 1.14