Skip to content

Commit c014748

Browse files
committed
Remove dead implicit-destinations logic from IL.
1 parent 6277b46 commit c014748

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

src/boot/be/elf.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1123,14 +1123,14 @@ let elf32_linux_x86_file
11231123
let plt_frag =
11241124
let (reg, _, _) = X86.get_next_pc_thunk in
11251125

1126-
Il.emit_full e (Some plt_entry_fixup) [] Il.Dead;
1126+
Il.emit_full e (Some plt_entry_fixup) Il.Dead;
11271127

11281128
Abi.load_fixup_addr e reg got_plt_section_fixup Il.CodeTy;
11291129

11301130
Il.emit e (Il.jmp Il.JMP (got_code_cell reg (2+i)));
11311131

11321132
Il.emit_full e (Some jump_slot_initial_target_fixup)
1133-
[] (Il.Push (X86.immi (Int64.of_int i)));
1133+
(Il.Push (X86.immi (Int64.of_int i)));
11341134

11351135
Il.emit e (Il.jmp Il.JMP (Il.direct_code_ptr plt0_fixup));
11361136
X86.frags_of_emitted_quads sess e

src/boot/be/il.ml

+1-7
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ type quad' =
227227

228228
type quad =
229229
{ quad_fixup: fixup option;
230-
quad_implicits: label list;
231230
quad_body: quad'; }
232231

233232
type quads = quad array ;;
@@ -703,13 +702,11 @@ type emitter = { mutable emit_pc: int;
703702

704703

705704
let badq = { quad_fixup = None;
706-
quad_implicits = [];
707705
quad_body = End }
708706
;;
709707

710708

711709
let deadq = { quad_fixup = None;
712-
quad_implicits = [];
713710
quad_body = Dead }
714711
;;
715712

@@ -828,21 +825,18 @@ let is_mov uop =
828825

829826
let mk_quad (q':quad') : quad =
830827
{ quad_body = q';
831-
quad_implicits = [];
832828
quad_fixup = None }
833829
;;
834830

835831
let emit_full
836832
(e:emitter)
837833
(fix:fixup option)
838-
(implicits:label list)
839834
(q':quad')
840835
: unit =
841836
let fixup = ref fix in
842837
let emit_quad_bottom q' =
843838
grow_if_necessary e;
844839
e.emit_quads.(e.emit_pc) <- { quad_body = q';
845-
quad_implicits = implicits;
846840
quad_fixup = (!fixup) };
847841
fixup := None;
848842
e.emit_pc <- e.emit_pc + 1
@@ -1050,7 +1044,7 @@ let emit_full
10501044
;;
10511045

10521046
let emit (e:emitter) (q':quad') : unit =
1053-
emit_full e None [] q'
1047+
emit_full e None q'
10541048
;;
10551049

10561050
let patch_jump (e:emitter) (jmp:int) (targ:int) : unit =

src/boot/be/macho.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ let emit_file
961961
let edx_pointee =
962962
Il.Mem ((Il.RegIn (edx, None)), Il.ScalarTy (Il.AddrTy Il.OpaqueTy))
963963
in
964-
Il.emit_full e (Some start_fixup) [] Il.Dead;
964+
Il.emit_full e (Some start_fixup) Il.Dead;
965965

966966
(* zero marks the bottom of the frame chain. *)
967967
Il.emit e (Il.Push (X86.imm (Asm.IMM 0L)));

src/boot/be/ra.ml

+3-6
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,9 @@ let kill_redundant_moves (cx:ctxt) : unit =
131131
;;
132132

133133
let quad_jump_target_labels (q:quad) : Il.label list =
134-
let explicits =
135-
match q.Il.quad_body with
136-
Il.Jmp { Il.jmp_targ = Il.CodeLabel lab } -> [ lab ]
137-
| _ -> []
138-
in
139-
explicits @ q.quad_implicits;
134+
match q.Il.quad_body with
135+
Il.Jmp { Il.jmp_targ = Il.CodeLabel lab } -> [ lab ]
136+
| _ -> []
140137
;;
141138

142139
let quad_used_vregs (q:quad) : Il.vreg list =

src/boot/be/x86.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ let emit_get_next_pc_thunk (e:Il.emitter) : unit =
564564
let rty = Il.ScalarTy sty in
565565
let deref_esp = Il.Mem (Il.RegIn (Il.Hreg esp, None), rty) in
566566
let eax = (Il.Reg (Il.Hreg eax, sty)) in
567-
Il.emit_full e (Some get_next_pc_thunk_fixup) []
567+
Il.emit_full e (Some get_next_pc_thunk_fixup)
568568
(Il.umov eax (Il.Cell deref_esp));
569569
Il.emit e Il.Ret;
570570
;;
@@ -756,7 +756,7 @@ let crawl_stack_calling_glue
756756
let pop x = emit (Il.Pop x) in
757757
let add x y = emit (Il.binary Il.ADD (rc x) (ro x) (ro y)) in
758758
let codefix fix = Il.CodePtr (Il.ImmPtr (fix, Il.CodeTy)) in
759-
let mark fix = Il.emit_full e (Some fix) [] Il.Dead in
759+
let mark fix = Il.emit_full e (Some fix) Il.Dead in
760760

761761
let repeat_jmp_fix = new_fixup "repeat jump" in
762762
let skip_jmp_fix = new_fixup "skip jump" in
@@ -822,7 +822,7 @@ let sweep_gc_chain
822822
let edi_n = word_n (Il.Hreg edi) in
823823
let ecx_n = word_n (Il.Hreg ecx) in
824824
let codefix fix = Il.CodePtr (Il.ImmPtr (fix, Il.CodeTy)) in
825-
let mark fix = Il.emit_full e (Some fix) [] Il.Dead in
825+
let mark fix = Il.emit_full e (Some fix) Il.Dead in
826826
let repeat_jmp_fix = new_fixup "repeat jump" in
827827
let skip_jmp_fix = new_fixup "skip jump" in
828828
let exit_jmp_fix = new_fixup "exit jump" in
@@ -1592,7 +1592,7 @@ let objfile_start
15921592
let emit = Il.emit e in
15931593
let mov dst src = emit (Il.umov dst src) in
15941594
let push_pos32 = push_pos32 e in
1595-
Il.emit_full e (Some start_fixup) [] Il.Dead;
1595+
Il.emit_full e (Some start_fixup) Il.Dead;
15961596
save_callee_saves e;
15971597
mov (rc ebp) (ro esp);
15981598

0 commit comments

Comments
 (0)