Remove dead implicit-destinations logic from IL.
This commit is contained in:
parent
6277b462e9
commit
c014748c01
@ -1123,14 +1123,14 @@ let elf32_linux_x86_file
|
||||
let plt_frag =
|
||||
let (reg, _, _) = X86.get_next_pc_thunk in
|
||||
|
||||
Il.emit_full e (Some plt_entry_fixup) [] Il.Dead;
|
||||
Il.emit_full e (Some plt_entry_fixup) Il.Dead;
|
||||
|
||||
Abi.load_fixup_addr e reg got_plt_section_fixup Il.CodeTy;
|
||||
|
||||
Il.emit e (Il.jmp Il.JMP (got_code_cell reg (2+i)));
|
||||
|
||||
Il.emit_full e (Some jump_slot_initial_target_fixup)
|
||||
[] (Il.Push (X86.immi (Int64.of_int i)));
|
||||
(Il.Push (X86.immi (Int64.of_int i)));
|
||||
|
||||
Il.emit e (Il.jmp Il.JMP (Il.direct_code_ptr plt0_fixup));
|
||||
X86.frags_of_emitted_quads sess e
|
||||
|
@ -227,7 +227,6 @@ type quad' =
|
||||
|
||||
type quad =
|
||||
{ quad_fixup: fixup option;
|
||||
quad_implicits: label list;
|
||||
quad_body: quad'; }
|
||||
|
||||
type quads = quad array ;;
|
||||
@ -703,13 +702,11 @@ type emitter = { mutable emit_pc: int;
|
||||
|
||||
|
||||
let badq = { quad_fixup = None;
|
||||
quad_implicits = [];
|
||||
quad_body = End }
|
||||
;;
|
||||
|
||||
|
||||
let deadq = { quad_fixup = None;
|
||||
quad_implicits = [];
|
||||
quad_body = Dead }
|
||||
;;
|
||||
|
||||
@ -828,21 +825,18 @@ let is_mov uop =
|
||||
|
||||
let mk_quad (q':quad') : quad =
|
||||
{ quad_body = q';
|
||||
quad_implicits = [];
|
||||
quad_fixup = None }
|
||||
;;
|
||||
|
||||
let emit_full
|
||||
(e:emitter)
|
||||
(fix:fixup option)
|
||||
(implicits:label list)
|
||||
(q':quad')
|
||||
: unit =
|
||||
let fixup = ref fix in
|
||||
let emit_quad_bottom q' =
|
||||
grow_if_necessary e;
|
||||
e.emit_quads.(e.emit_pc) <- { quad_body = q';
|
||||
quad_implicits = implicits;
|
||||
quad_fixup = (!fixup) };
|
||||
fixup := None;
|
||||
e.emit_pc <- e.emit_pc + 1
|
||||
@ -1050,7 +1044,7 @@ let emit_full
|
||||
;;
|
||||
|
||||
let emit (e:emitter) (q':quad') : unit =
|
||||
emit_full e None [] q'
|
||||
emit_full e None q'
|
||||
;;
|
||||
|
||||
let patch_jump (e:emitter) (jmp:int) (targ:int) : unit =
|
||||
|
@ -961,7 +961,7 @@ let emit_file
|
||||
let edx_pointee =
|
||||
Il.Mem ((Il.RegIn (edx, None)), Il.ScalarTy (Il.AddrTy Il.OpaqueTy))
|
||||
in
|
||||
Il.emit_full e (Some start_fixup) [] Il.Dead;
|
||||
Il.emit_full e (Some start_fixup) Il.Dead;
|
||||
|
||||
(* zero marks the bottom of the frame chain. *)
|
||||
Il.emit e (Il.Push (X86.imm (Asm.IMM 0L)));
|
||||
|
@ -131,12 +131,9 @@ let kill_redundant_moves (cx:ctxt) : unit =
|
||||
;;
|
||||
|
||||
let quad_jump_target_labels (q:quad) : Il.label list =
|
||||
let explicits =
|
||||
match q.Il.quad_body with
|
||||
Il.Jmp { Il.jmp_targ = Il.CodeLabel lab } -> [ lab ]
|
||||
| _ -> []
|
||||
in
|
||||
explicits @ q.quad_implicits;
|
||||
match q.Il.quad_body with
|
||||
Il.Jmp { Il.jmp_targ = Il.CodeLabel lab } -> [ lab ]
|
||||
| _ -> []
|
||||
;;
|
||||
|
||||
let quad_used_vregs (q:quad) : Il.vreg list =
|
||||
|
@ -564,7 +564,7 @@ let emit_get_next_pc_thunk (e:Il.emitter) : unit =
|
||||
let rty = Il.ScalarTy sty in
|
||||
let deref_esp = Il.Mem (Il.RegIn (Il.Hreg esp, None), rty) in
|
||||
let eax = (Il.Reg (Il.Hreg eax, sty)) in
|
||||
Il.emit_full e (Some get_next_pc_thunk_fixup) []
|
||||
Il.emit_full e (Some get_next_pc_thunk_fixup)
|
||||
(Il.umov eax (Il.Cell deref_esp));
|
||||
Il.emit e Il.Ret;
|
||||
;;
|
||||
@ -756,7 +756,7 @@ let crawl_stack_calling_glue
|
||||
let pop x = emit (Il.Pop x) in
|
||||
let add x y = emit (Il.binary Il.ADD (rc x) (ro x) (ro y)) in
|
||||
let codefix fix = Il.CodePtr (Il.ImmPtr (fix, Il.CodeTy)) in
|
||||
let mark fix = Il.emit_full e (Some fix) [] Il.Dead in
|
||||
let mark fix = Il.emit_full e (Some fix) Il.Dead in
|
||||
|
||||
let repeat_jmp_fix = new_fixup "repeat jump" in
|
||||
let skip_jmp_fix = new_fixup "skip jump" in
|
||||
@ -822,7 +822,7 @@ let sweep_gc_chain
|
||||
let edi_n = word_n (Il.Hreg edi) in
|
||||
let ecx_n = word_n (Il.Hreg ecx) in
|
||||
let codefix fix = Il.CodePtr (Il.ImmPtr (fix, Il.CodeTy)) in
|
||||
let mark fix = Il.emit_full e (Some fix) [] Il.Dead in
|
||||
let mark fix = Il.emit_full e (Some fix) Il.Dead in
|
||||
let repeat_jmp_fix = new_fixup "repeat jump" in
|
||||
let skip_jmp_fix = new_fixup "skip jump" in
|
||||
let exit_jmp_fix = new_fixup "exit jump" in
|
||||
@ -1592,7 +1592,7 @@ let objfile_start
|
||||
let emit = Il.emit e in
|
||||
let mov dst src = emit (Il.umov dst src) in
|
||||
let push_pos32 = push_pos32 e in
|
||||
Il.emit_full e (Some start_fixup) [] Il.Dead;
|
||||
Il.emit_full e (Some start_fixup) Il.Dead;
|
||||
save_callee_saves e;
|
||||
mov (rc ebp) (ro esp);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user