diff options
| author | Graydon Hoare <[email protected]> | 2010-08-03 18:52:49 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-08-03 18:52:49 -0700 |
| commit | c014748c0191b711e2adf5a5db224474ea4e75d3 (patch) | |
| tree | 6c48001fb6c568ff409c73c3d6998dd292b31800 | |
| parent | More stdlib hashmap work. Add a simple test and XFAIL it due to a valgrind-s... (diff) | |
| download | rust-c014748c0191b711e2adf5a5db224474ea4e75d3.tar.xz rust-c014748c0191b711e2adf5a5db224474ea4e75d3.zip | |
Remove dead implicit-destinations logic from IL.
| -rw-r--r-- | src/boot/be/elf.ml | 4 | ||||
| -rw-r--r-- | src/boot/be/il.ml | 8 | ||||
| -rw-r--r-- | src/boot/be/macho.ml | 2 | ||||
| -rw-r--r-- | src/boot/be/ra.ml | 9 | ||||
| -rw-r--r-- | src/boot/be/x86.ml | 8 |
5 files changed, 11 insertions, 20 deletions
diff --git a/src/boot/be/elf.ml b/src/boot/be/elf.ml index 56905b2a..3d25657b 100644 --- a/src/boot/be/elf.ml +++ b/src/boot/be/elf.ml @@ -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 diff --git a/src/boot/be/il.ml b/src/boot/be/il.ml index b77516b7..24f2ae31 100644 --- a/src/boot/be/il.ml +++ b/src/boot/be/il.ml @@ -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 = diff --git a/src/boot/be/macho.ml b/src/boot/be/macho.ml index c2970e78..da3c8550 100644 --- a/src/boot/be/macho.ml +++ b/src/boot/be/macho.ml @@ -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))); diff --git a/src/boot/be/ra.ml b/src/boot/be/ra.ml index 53b4f46f..3da474b4 100644 --- a/src/boot/be/ra.ml +++ b/src/boot/be/ra.ml @@ -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 = diff --git a/src/boot/be/x86.ml b/src/boot/be/x86.ml index 7e1614a6..ac567df0 100644 --- a/src/boot/be/x86.ml +++ b/src/boot/be/x86.ml @@ -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); |