@@ -518,30 +518,6 @@ impl CheckerState {
518518 self . check_val ( inst, * op, * alloc, val, allocs, checker) ?;
519519 }
520520 }
521- & CheckerInst :: Safepoint { inst, ref allocs } => {
522- for & alloc in allocs {
523- let val = self . get_value ( & alloc) . unwrap_or ( & default_val) ;
524- trace ! (
525- "checker: checkinst {:?}: safepoint slot {}, checker value {:?}" ,
526- checkinst,
527- alloc,
528- val
529- ) ;
530-
531- let reffy = val
532- . vregs ( )
533- . expect ( "checker value should not be Universe set" )
534- . iter ( )
535- . any ( |vreg| checker. reftyped_vregs . contains ( vreg) ) ;
536- if !reffy {
537- return Err ( CheckerError :: NonRefValuesInStackmap {
538- inst,
539- alloc,
540- vregs : val. vregs ( ) . unwrap ( ) . clone ( ) ,
541- } ) ;
542- }
543- }
544- }
545521 & CheckerInst :: Move { into, from } => {
546522 // Ensure that the allocator never returns stack-to-stack moves.
547523 let is_stack = |alloc : Allocation | {
@@ -565,7 +541,7 @@ impl CheckerState {
565541 }
566542
567543 /// Update according to instruction.
568- fn update < ' a , F : Function > ( & mut self , checkinst : & CheckerInst , checker : & Checker < ' a , F > ) {
544+ fn update ( & mut self , checkinst : & CheckerInst ) {
569545 self . become_defined ( ) ;
570546
571547 match checkinst {
@@ -645,23 +621,6 @@ impl CheckerState {
645621 self . remove_value ( & Allocation :: reg ( * clobber) ) ;
646622 }
647623 }
648- & CheckerInst :: Safepoint { ref allocs, .. } => {
649- for ( alloc, value) in self . get_mappings_mut ( ) {
650- if alloc. is_reg ( ) {
651- continue ;
652- }
653- if !allocs. contains ( & alloc) {
654- // Remove all reftyped vregs as labels.
655- let new_vregs = value
656- . vregs ( )
657- . unwrap ( )
658- . difference ( & checker. reftyped_vregs )
659- . cloned ( )
660- . collect ( ) ;
661- * value = CheckerValue :: VRegs ( new_vregs) ;
662- }
663- }
664- }
665624 }
666625 }
667626
@@ -749,10 +708,6 @@ pub(crate) enum CheckerInst {
749708 allocs : Vec < Allocation > ,
750709 clobbers : Vec < PReg > ,
751710 } ,
752-
753- /// A safepoint, with the given Allocations specified as containing
754- /// reftyped values. All other reftyped values become invalid.
755- Safepoint { inst : Inst , allocs : Vec < Allocation > } ,
756711}
757712
758713#[ derive( Debug ) ]
@@ -761,7 +716,6 @@ pub struct Checker<'a, F: Function> {
761716 bb_in : FxHashMap < Block , CheckerState > ,
762717 bb_insts : FxHashMap < Block , Vec < CheckerInst > > ,
763718 edge_insts : FxHashMap < ( Block , Block ) , Vec < CheckerInst > > ,
764- reftyped_vregs : FxHashSet < VReg > ,
765719 machine_env : & ' a MachineEnv ,
766720 stack_pregs : PRegSet ,
767721}
@@ -775,7 +729,6 @@ impl<'a, F: Function> Checker<'a, F> {
775729 let mut bb_in = FxHashMap :: default ( ) ;
776730 let mut bb_insts = FxHashMap :: default ( ) ;
777731 let mut edge_insts = FxHashMap :: default ( ) ;
778- let mut reftyped_vregs = FxHashSet :: default ( ) ;
779732
780733 for block in 0 ..f. num_blocks ( ) {
781734 let block = Block :: new ( block) ;
@@ -786,10 +739,6 @@ impl<'a, F: Function> Checker<'a, F> {
786739 }
787740 }
788741
789- for & vreg in f. reftype_vregs ( ) {
790- reftyped_vregs. insert ( vreg) ;
791- }
792-
793742 bb_in. insert ( f. entry_block ( ) , CheckerState :: default ( ) ) ;
794743
795744 let mut stack_pregs = PRegSet :: empty ( ) ;
@@ -802,7 +751,6 @@ impl<'a, F: Function> Checker<'a, F> {
802751 bb_in,
803752 bb_insts,
804753 edge_insts,
805- reftyped_vregs,
806754 machine_env,
807755 stack_pregs,
808756 }
@@ -812,15 +760,6 @@ impl<'a, F: Function> Checker<'a, F> {
812760 /// and allocation results.
813761 pub fn prepare ( & mut self , out : & Output ) {
814762 trace ! ( "checker: out = {:?}" , out) ;
815- // Preprocess safepoint stack-maps into per-inst vecs.
816- let mut safepoint_slots: FxHashMap < Inst , Vec < Allocation > > = FxHashMap :: default ( ) ;
817- for & ( progpoint, slot) in & out. safepoint_slots {
818- safepoint_slots
819- . entry ( progpoint. inst ( ) )
820- . or_insert_with ( || vec ! [ ] )
821- . push ( slot) ;
822- }
823-
824763 let mut last_inst = None ;
825764 for block in 0 ..self . f . num_blocks ( ) {
826765 let block = Block :: new ( block) ;
@@ -829,7 +768,7 @@ impl<'a, F: Function> Checker<'a, F> {
829768 InstOrEdit :: Inst ( inst) => {
830769 debug_assert ! ( last_inst. is_none( ) || inst > last_inst. unwrap( ) ) ;
831770 last_inst = Some ( inst) ;
832- self . handle_inst ( block, inst, & mut safepoint_slots , out) ;
771+ self . handle_inst ( block, inst, out) ;
833772 }
834773 InstOrEdit :: Edit ( edit) => self . handle_edit ( block, edit) ,
835774 }
@@ -838,21 +777,7 @@ impl<'a, F: Function> Checker<'a, F> {
838777 }
839778
840779 /// For each original instruction, create an `Op`.
841- fn handle_inst (
842- & mut self ,
843- block : Block ,
844- inst : Inst ,
845- safepoint_slots : & mut FxHashMap < Inst , Vec < Allocation > > ,
846- out : & Output ,
847- ) {
848- // If this is a safepoint, then check the spillslots at this point.
849- if self . f . requires_refs_on_stack ( inst) {
850- let allocs = safepoint_slots. remove ( & inst) . unwrap_or_else ( || vec ! [ ] ) ;
851-
852- let checkinst = CheckerInst :: Safepoint { inst, allocs } ;
853- self . bb_insts . get_mut ( & block) . unwrap ( ) . push ( checkinst) ;
854- }
855-
780+ fn handle_inst ( & mut self , block : Block , inst : Inst , out : & Output ) {
856781 // Skip normal checks if this is a branch: the blockparams do
857782 // not exist in post-regalloc code, and the edge-moves have to
858783 // be inserted before the branch rather than after.
@@ -931,14 +856,14 @@ impl<'a, F: Function> Checker<'a, F> {
931856 let mut state = self . bb_in . get ( & block) . cloned ( ) . unwrap ( ) ;
932857 trace ! ( "analyze: block {} has state {:?}" , block. index( ) , state) ;
933858 for inst in self . bb_insts . get ( & block) . unwrap ( ) {
934- state. update ( inst, self ) ;
859+ state. update ( inst) ;
935860 trace ! ( "analyze: inst {:?} -> state {:?}" , inst, state) ;
936861 }
937862
938863 for & succ in self . f . block_succs ( block) {
939864 let mut new_state = state. clone ( ) ;
940865 for edge_inst in self . edge_insts . get ( & ( block, succ) ) . unwrap ( ) {
941- new_state. update ( edge_inst, self ) ;
866+ new_state. update ( edge_inst) ;
942867 trace ! (
943868 "analyze: succ {:?}: inst {:?} -> state {:?}" ,
944869 succ,
@@ -987,7 +912,7 @@ impl<'a, F: Function> Checker<'a, F> {
987912 trace ! ( "Checker error: {:?}" , e) ;
988913 errors. push ( e) ;
989914 }
990- state. update ( inst, self ) ;
915+ state. update ( inst) ;
991916 if let Err ( e) = state. check ( InstPosition :: After , inst, self ) {
992917 trace ! ( "Checker error: {:?}" , e) ;
993918 errors. push ( e) ;
@@ -1021,9 +946,6 @@ impl<'a, F: Function> Checker<'a, F> {
1021946 trace ! ( " {{ {} }}" , s. join( ", " ) )
1022947 }
1023948 }
1024- for vreg in self . f . reftype_vregs ( ) {
1025- trace ! ( " REF: {}" , vreg) ;
1026- }
1027949 for bb in 0 ..self . f . num_blocks ( ) {
1028950 let bb = Block :: new ( bb) ;
1029951 trace ! ( "block{}:" , bb. index( ) ) ;
@@ -1049,18 +971,11 @@ impl<'a, F: Function> Checker<'a, F> {
1049971 & CheckerInst :: Move { from, into } => {
1050972 trace ! ( " {} -> {}" , from, into) ;
1051973 }
1052- & CheckerInst :: Safepoint { ref allocs, .. } => {
1053- let mut slotargs = vec ! [ ] ;
1054- for & slot in allocs {
1055- slotargs. push ( format ! ( "{}" , slot) ) ;
1056- }
1057- trace ! ( " safepoint: {}" , slotargs. join( ", " ) ) ;
1058- }
1059974 & CheckerInst :: ParallelMove { .. } => {
1060975 panic ! ( "unexpected parallel_move in body (non-edge)" )
1061976 }
1062977 }
1063- state. update ( inst, & self ) ;
978+ state. update ( inst) ;
1064979 print_state ( & state) ;
1065980 }
1066981
@@ -1078,7 +993,7 @@ impl<'a, F: Function> Checker<'a, F> {
1078993 }
1079994 _ => panic ! ( "unexpected edge_inst: not a parallel move" ) ,
1080995 }
1081- state. update ( edge_inst, & self ) ;
996+ state. update ( edge_inst) ;
1082997 print_state ( & state) ;
1083998 }
1084999 }
0 commit comments