pub fn execute_program_jit(&mut self, instruction_meter: &mut I) -> ProgramResult<E> {
        let reg1 = if self
            .memory_mapping
            .map::<UserError>(AccessType::Store, ebpf::MM_INPUT_START, 1)
            .is_ok()
        {
            ebpf::MM_INPUT_START
        } else {
            0
        };
        let initial_insn_count = if self.executable.get_config().enable_instruction_meter {
            instruction_meter.get_remaining()
        } else {
            0
        };
        let result: ProgramResult<E> = Ok(0);
        let compiled_program = self
            .executable
            .get_compiled_program()
            .ok_or(EbpfError::JITNotCompiled)?;
        unsafe {
            self.syscall_context_objects[SYSCALL_CONTEXT_OBJECTS_OFFSET - 1] =
                &mut self.tracer as *mut _ as *mut u8;
            self.last_insn_count = (compiled_program.main)(
                &result,
                reg1,
                &*(self.syscall_context_objects.as_ptr() as *const JitProgramArgument),
                instruction_meter,
            )
            .max(0) as u64;
        }
        if self.executable.get_config().enable_instruction_meter {
            let remaining_insn_count = instruction_meter.get_remaining();
            self.total_insn_count = remaining_insn_count - self.last_insn_count;
            instruction_meter.consume(self.total_insn_count);
            self.total_insn_count += initial_insn_count - remaining_insn_count;
        }
        match result {
            Err(EbpfError::ExceededMaxInstructions(pc, _)) => {
                Err(EbpfError::ExceededMaxInstructions(pc, initial_insn_count))
            }
            x => x,
        }
    }
/// Execute the previously JIT-compiled program, with the given packet data in a manner
/// very similar to `execute_program_interpreted()`.
///
/// # Safety
///
/// **WARNING:** JIT-compiled assembly code is not safe. It may be wise to check that
/// the program works with the interpreter before running the JIT-compiled version of it.
///
Execute the previously JIT-compiled program, with the given packet data in a manner
very similar to `execute_program_interpreted()`.
Execute the previously JIT - compiled program with the given packet data in a manner very similar to ` execute_program_interpreted () ` .
pub fn execute_program_jit(&mut self, instruction_meter: &mut I) -> ProgramResult<E> {
        let reg1 = if self
            .memory_mapping
            .map::<UserError>(AccessType::Store, ebpf::MM_INPUT_START, 1)
            .is_ok()
        {
            ebpf::MM_INPUT_START
        } else {
            0
        };
        let initial_insn_count = if self.executable.get_config().enable_instruction_meter {
            instruction_meter.get_remaining()
        } else {
            0
        };
        let result: ProgramResult<E> = Ok(0);
        let compiled_program = self
            .executable
            .get_compiled_program()
            .ok_or(EbpfError::JITNotCompiled)?;
        unsafe {
            self.syscall_context_objects[SYSCALL_CONTEXT_OBJECTS_OFFSET - 1] =
                &mut self.tracer as *mut _ as *mut u8;
            self.last_insn_count = (compiled_program.main)(
                &result,
                reg1,
                &*(self.syscall_context_objects.as_ptr() as *const JitProgramArgument),
                instruction_meter,
            )
            .max(0) as u64;
        }
        if self.executable.get_config().enable_instruction_meter {
            let remaining_insn_count = instruction_meter.get_remaining();
            self.total_insn_count = remaining_insn_count - self.last_insn_count;
            instruction_meter.consume(self.total_insn_count);
            self.total_insn_count += initial_insn_count - remaining_insn_count;
        }
        match result {
            Err(EbpfError::ExceededMaxInstructions(pc, _)) => {
                Err(EbpfError::ExceededMaxInstructions(pc, initial_insn_count))
            }
            x => x,
        }
    }
pub fn execute_program_jit ( & mut self , instruction_meter : & mut I ) -> ProgramResult < E > { let reg1 = if self . memory_mapping . map :: < UserError > ( AccessType :: Store , ebpf :: MM_INPUT_START , 1 ) . is_ok ( ) { ebpf :: MM_INPUT_START } else { 0 } ; let initial_insn_count = if self . executable . get_config ( ) . enable_instruction_meter { instruction_meter . get_remaining ( ) } else { 0 } ; let result : ProgramResult < E > = Ok ( 0 ) ; let compiled_program = self . executable . get_compiled_program ( ) . ok_or ( EbpfError :: JITNotCompiled ) ? ; unsafe { self . syscall_context_objects [ SYSCALL_CONTEXT_OBJECTS_OFFSET - 1 ] = & mut self . tracer as * mut _ as * mut u8 ; self . last_insn_count = ( compiled_program . main ) ( & result , reg1 , & * ( self . syscall_context_objects . as_ptr ( ) as * const JitProgramArgument ) , instruction_meter , ) . max ( 0 ) as u64 ; } if self . executable . get_config ( ) . enable_instruction_meter { let remaining_insn_count = instruction_meter . get_remaining ( ) ; self . total_insn_count = remaining_insn_count - self . last_insn_count ; instruction_meter . consume ( self . total_insn_count ) ; self . total_insn_count += initial_insn_count - remaining_insn_count ; } match result { Err ( EbpfError :: ExceededMaxInstructions ( pc , _ ) ) => { Err ( EbpfError :: ExceededMaxInstructions ( pc , initial_insn_count ) ) } x => x , } }
Execute the previously JIT-compiled program, with the given packet data in a manner
very similar to `execute_program_interpreted()`.
Execute the previously JIT - compiled program with the given packet data in a manner very similar to ` execute_program_interpreted () ` .
&mut self
instruction_meter
&mut I
safety
JIT-compiled assembly code is not safe. It may be wise to check that
the program works with the interpreter before running the JIT-compiled version of it.
JIT - compiled assembly code is not safe . It may be wise to check that the program works with the interpreter before running the JIT - compiled version of it .