@@ -71,6 +71,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
7171 let vm_execution = VmExecutionConfig {
7272 interrupt : cli. vm_interrupt_config ( ) ?,
7373 execution_mode : cli. vm_execution_mode . unwrap_or_default ( ) ,
74+ jit_enabled : cli. vm_jit ,
7475 } ;
7576 let store_limits = cli. runtime_store_limits ( ) ;
7677 if cli. disable_metrics {
@@ -80,6 +81,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
8081 . with_metrics_collection_enabled ( !cli. disable_metrics )
8182 . with_vm_execution_config ( vm_execution) ;
8283 info ! ( "vm execution mode={}" , vm_execution. execution_mode. as_str( ) ) ;
84+ info ! ( "vm jit enabled={}" , vm_execution. jit_enabled) ;
8385 match vm_execution. interrupt {
8486 VmInterruptConfig :: None => { }
8587 VmInterruptConfig :: Fuel {
@@ -212,6 +214,7 @@ struct CliArgs {
212214 vm_epoch_deadline : Option < u64 > ,
213215 vm_epoch_check_interval : Option < u32 > ,
214216 vm_execution_mode : Option < VmExecutionMode > ,
217+ vm_jit : bool ,
215218 control_plane_url : Option < String > ,
216219 edge_id : Option < String > ,
217220 edge_name : Option < String > ,
@@ -378,6 +381,9 @@ where
378381 let value = next_arg_value ( "--vm-execution-mode" , & mut args) ?;
379382 cli. vm_execution_mode = Some ( parse_vm_execution_mode ( & value) ?) ;
380383 }
384+ "--vm-jit" => {
385+ cli. vm_jit = true ;
386+ }
381387 "--edge-id" => {
382388 cli. edge_id = Some ( next_arg_value ( "--edge-id" , & mut args) ?) ;
383389 }
@@ -471,6 +477,7 @@ fn print_cli_help() {
471477 " --vm-epoch-deadline <TICKS> Enable cooperative VM epoch slices per request (1 tick = 1ms wall clock)\n " ,
472478 " --vm-epoch-check-interval <OPS> Epoch check interval when --vm-epoch-deadline is enabled (default: 1)\n " ,
473479 " --vm-execution-mode <MODE> VM execution mode: async|threading (default: async)\n " ,
480+ " --vm-jit Enable VM JIT/trace execution (default: off)\n " ,
474481 " --control-plane-url <URL> Enable active control-plane RPC client\n " ,
475482 " --edge-id <UUID> Explicit edge UUID used by active control-plane client\n " ,
476483 " --edge-name <NAME> Friendly edge name (default: hostname)\n " ,
@@ -667,6 +674,7 @@ mod tests {
667674 vm_epoch_deadline: None ,
668675 vm_epoch_check_interval: None ,
669676 vm_execution_mode: None ,
677+ vm_jit: false ,
670678 control_plane_url: Some ( "http://127.0.0.1:9100" . to_string( ) ) ,
671679 edge_id: Some ( "123e4567-e89b-12d3-a456-426614174000" . to_string( ) ) ,
672680 edge_name: Some ( "test-edge" . to_string( ) ) ,
@@ -781,6 +789,16 @@ mod tests {
781789 assert_eq ! ( cli. vm_execution_mode, Some ( VmExecutionMode :: Threading ) ) ;
782790 }
783791
792+ #[ test]
793+ fn parse_cli_args_from_parses_vm_jit_flag ( ) {
794+ let action = parse_cli_args_from ( [ "--vm-jit" . to_string ( ) ] ) . expect ( "parse should succeed" ) ;
795+
796+ let CliAction :: Run ( cli) = action else {
797+ panic ! ( "expected run action" ) ;
798+ } ;
799+ assert ! ( cli. vm_jit) ;
800+ }
801+
784802 #[ test]
785803 fn runtime_store_limits_uses_defaults_and_overrides ( ) {
786804 let cli = CliArgs {
0 commit comments