@@ -444,14 +444,9 @@ impl Instance {
444444 // Apply element segments now that data segments have been validated
445445 if let Some ( collected) = collected_elements {
446446 let table_rc = inst. table . as_ref ( ) . ok_or ( Error :: Link ( UNKNOWN_TABLE ) ) ?. clone ( ) ;
447- #[ cfg( feature = "wasm_debug" ) ]
448- {
449- let sz = table_rc. borrow ( ) . size ( ) ;
450- crate :: debug_println!( "[elem] table size={} segments={} " , sz, collected. len( ) ) ;
451- }
452447 for ( offset, indices) in collected. iter ( ) {
453- for ( j, idx_fn ) in indices. iter ( ) . enumerate ( ) {
454- let func_idx = * idx_fn as usize ;
448+ for ( j, idx ) in indices. iter ( ) . enumerate ( ) {
449+ let func_idx = * idx as usize ;
455450 let f = inst. functions [ func_idx] . clone ( ) ;
456451 let ( owner_id, owner_func_idx) = if let ( Some ( weak_owner) , Some ( owner_idx) ) = ( f. owner . clone ( ) , f. owner_idx ) {
457452 if let Some ( owner_rc) = weak_owner. upgrade ( ) { ( owner_rc. id , owner_idx as u32 ) } else { ( inst. id , func_idx as u32 ) }
@@ -895,10 +890,7 @@ impl Instance {
895890 0x01 | 0xbc | 0xbd | 0xbe | 0xbf => { } // nop and reinterprets (no-op on raw bits)
896891 0x02 => { // block
897892 let sig = Signature :: read ( & self . module . types , bytes, & mut pc) ?;
898- crate :: debug_println!( "[ctrl] enter block: pc_after_bt={} (0x{:x})" , pc, pc) ;
899- debug_assert ! ( self . module. block_ends. contains_key( & pc) , "missing block end mapping for key {}" , pc) ;
900893 let block_end = * self . module . block_ends . get ( & pc) . unwrap ( ) ;
901- crate :: debug_println!( "[ctrl] block_end={} (0x{:x})" , block_end, block_end) ;
902894 control. push ( ControlFrame {
903895 stack_len : stack. len ( ) - sig. params . len ( ) ,
904896 dest_pc : block_end,
@@ -909,7 +901,6 @@ impl Instance {
909901 0x03 => { // loop
910902 let loop_op_pc = pc - 1 ;
911903 let sig = Signature :: read ( & self . module . types , bytes, & mut pc) ?;
912- crate :: debug_println!( "[ctrl] enter loop: loop_op_pc={} (0x{:x}) pc_after_bt={} (0x{:x})" , loop_op_pc, loop_op_pc, pc, pc) ;
913904 control. push ( ControlFrame {
914905 stack_len : stack. len ( ) - sig. params . len ( ) ,
915906 dest_pc : loop_op_pc,
@@ -920,10 +911,7 @@ impl Instance {
920911 0x04 => { // if
921912 let sig = Signature :: read ( & self . module . types , bytes, & mut pc) ?;
922913 let cond = pop_val ! ( ) . as_u32 ( ) ;
923- crate :: debug_println!( "[ctrl] enter if: pc_after_bt={} (0x{:x}) cond={}" , pc, pc, cond) ;
924- debug_assert ! ( self . module. if_jumps. contains_key( & pc) , "missing if jump mapping for key {}" , pc) ;
925914 let if_jump = self . module . if_jumps . get ( & pc) . unwrap ( ) ;
926- crate :: debug_println!( "[ctrl] else_offset={} (0x{:x}) end_offset={} (0x{:x})" , if_jump. else_offset, if_jump. else_offset, if_jump. end_offset, if_jump. end_offset) ;
927915 control. push ( ControlFrame {
928916 stack_len : stack. len ( ) - sig. params . len ( ) ,
929917 dest_pc : if_jump. end_offset ,
@@ -933,12 +921,9 @@ impl Instance {
933921 if cond == 0 { pc = if_jump. else_offset ; }
934922 }
935923 0x05 => { // else
936- crate :: debug_println!( "[ctrl] else: simulating br depth 0" ) ;
937924 let _ = Instance :: branch ( & mut pc, stack, control, 0 ) ;
938925 }
939926 0x0b => { // end
940- crate :: debug_println!( "[ctrl] end: control_depth={}" , control. len( ) ) ;
941-
942927 // Check if we're at a function boundary
943928 if let Some ( & frame_idx) = ctrl_bases. last ( ) {
944929 if frame_idx == control. len ( ) . saturating_sub ( 1 ) {
0 commit comments