From 8ecbe49a8fa8b4bb17c2d798d5de6fc0303c5bc6 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 5 Oct 2010 18:44:39 -0700 Subject: Add -minimal mode to rustboot that skips emitting code that's broken or unneeded for rustc. Shrink rustc by 300kb. Back under 1mb. --- src/boot/be/abi.ml | 3 ++- src/boot/be/x86.ml | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/boot/be') diff --git a/src/boot/be/abi.ml b/src/boot/be/abi.ml index c16fec36..a7b98c2c 100644 --- a/src/boot/be/abi.ml +++ b/src/boot/be/abi.ml @@ -126,7 +126,8 @@ type abi = -> Common.nabi -> Common.fixup (* grow_task *) -> bool (* is_obj_fn *) - -> unit); + -> bool (* minimal *) + -> unit); abi_emit_fn_epilogue: (Il.emitter -> unit); diff --git a/src/boot/be/x86.ml b/src/boot/be/x86.ml index 468d1ab1..dd21c329 100644 --- a/src/boot/be/x86.ml +++ b/src/boot/be/x86.ml @@ -1236,6 +1236,7 @@ let fn_prologue (nabi:nabi) (grow_task_fixup:fixup) (is_obj_fn:bool) + (minimal:bool) : unit = let esi_n = word_n (h esi) in @@ -1372,8 +1373,11 @@ let fn_prologue in (* "Full" frame size-check. *) - stack_growth_check e nabi grow_task_fixup - dynamic_frame_sz dynamic_grow_jmp restart_pc (h esi) (h edi); + match dynamic_grow_jmp with + None when minimal -> () + | _ -> + stack_growth_check e nabi grow_task_fixup + dynamic_frame_sz dynamic_grow_jmp restart_pc (h esi) (h edi); (* Establish a frame, wherever we landed. *) -- cgit v1.2.3