Skip to content

Commit

Permalink
Enables JIT everywhere by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Apr 24, 2023
1 parent 4b0e16d commit db057de
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,17 @@ impl LoadedProgram {
verify_code_time.stop();
metrics.verify_code_us = verify_code_time.as_us();

if use_jit {
#[cfg(all(not(target_os = "windows"), target_arch = "x86_64"))]
{
let mut jit_compile_time = Measure::start("jit_compile_time");
match &mut program {
LoadedProgramType::LegacyV0(executable) => executable.jit_compile(),
LoadedProgramType::LegacyV1(executable) => executable.jit_compile(),
LoadedProgramType::Typed(executable) => executable.jit_compile(),
_ => Err(EbpfError::JitNotCompiled),
}?;
jit_compile_time.stop();
metrics.jit_compile_us = jit_compile_time.as_us();
}
#[cfg(all(not(target_os = "windows"), target_arch = "x86_64"))]
{
let mut jit_compile_time = Measure::start("jit_compile_time");
match &mut program {
LoadedProgramType::LegacyV0(executable) => executable.jit_compile(),
LoadedProgramType::LegacyV1(executable) => executable.jit_compile(),
LoadedProgramType::Typed(executable) => executable.jit_compile(),
_ => Err(EbpfError::JitNotCompiled),
}?;
jit_compile_time.stop();
metrics.jit_compile_us = jit_compile_time.as_us();
}

Ok(Self {
Expand Down

0 comments on commit db057de

Please sign in to comment.