File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1419,7 +1419,7 @@ mod tests {
14191419 fn test_emit_cpop_all ( ) {
14201420 let ( mut asm, mut cb) = setup_asm ( ) ;
14211421
1422- asm. cpop_all ( ) ;
1422+ asm. cpop_all ( crate :: core :: RegMapping :: default ( ) ) ;
14231423 asm. compile_with_num_regs ( & mut cb, 0 ) ;
14241424 }
14251425
Original file line number Diff line number Diff line change @@ -1824,12 +1824,12 @@ impl Assembler {
18241824 out
18251825 }
18261826
1827- pub fn cpop_all ( & mut self ) {
1827+ pub fn cpop_all ( & mut self , reg_mapping : RegMapping ) {
18281828 self . push_insn ( Insn :: CPopAll ) ;
18291829
18301830 // Re-enable ccall's RegMappings assertion disabled by cpush_all.
18311831 // cpush_all + cpop_all preserve all stack temp registers, so it's safe.
1832- self . set_reg_mapping ( self . ctx . get_reg_mapping ( ) ) ;
1832+ self . set_reg_mapping ( reg_mapping ) ;
18331833 }
18341834
18351835 pub fn cpop_into ( & mut self , opnd : Opnd ) {
@@ -1840,14 +1840,16 @@ impl Assembler {
18401840 self . push_insn ( Insn :: CPush ( opnd) ) ;
18411841 }
18421842
1843- pub fn cpush_all ( & mut self ) {
1843+ pub fn cpush_all ( & mut self ) -> RegMapping {
18441844 self . push_insn ( Insn :: CPushAll ) ;
18451845
18461846 // Mark all temps as not being in registers.
18471847 // Temps will be marked back as being in registers by cpop_all.
18481848 // We assume that cpush_all + cpop_all are used for C functions in utils.rs
18491849 // that don't require spill_regs for GC.
1850+ let mapping = self . ctx . get_reg_mapping ( ) ;
18501851 self . set_reg_mapping ( RegMapping :: default ( ) ) ;
1852+ mapping
18511853 }
18521854
18531855 pub fn cret ( & mut self , opnd : Opnd ) {
Original file line number Diff line number Diff line change @@ -8314,7 +8314,7 @@ fn gen_send_iseq(
83148314 // We also do this after spill_regs() to avoid doubly spilling the same thing on asm.ccall().
83158315 if get_option ! ( gen_stats) {
83168316 // Protect caller-saved registers in case they're used for arguments
8317- asm. cpush_all ( ) ;
8317+ let mapping = asm. cpush_all ( ) ;
83188318
83198319 // Assemble the ISEQ name string
83208320 let name_str = get_iseq_name ( iseq) ;
@@ -8324,7 +8324,7 @@ fn gen_send_iseq(
83248324
83258325 // Increment the counter for this cfunc
83268326 asm. ccall ( incr_iseq_counter as * const u8 , vec ! [ iseq_idx. into( ) ] ) ;
8327- asm. cpop_all ( ) ;
8327+ asm. cpop_all ( mapping ) ;
83288328 }
83298329
83308330 // The callee might change locals through Kernel#binding and other means.
You can’t perform that action at this time.
0 commit comments