[m-rev.] for review: add ll_debug GC grade

Ian MacLarty maclarty at csse.unimelb.edu.au
Tue Dec 6 20:29:22 AEDT 2011


For review by Julien.

Branches: main, 11.07

Add a new GC grade for the .ll_debug Mercury grade.

Previously the .ll_debug grade used the usual "gc" GC grade.  This was a
problem, because it meant that installing a .ll_debug grade would overwrite the
libgc library with the unoptimised .ll_debug version, resulting in a severe
performance loss for applications even if they weren't built in the .ll_debug
grade.

compiler/compile_target_code.m:
    Link against the ll_debug GC library if low-level debugging
    is enabled.

scripts/ml.in:
    Use the new ll_debug GC grade for the .ll_debug Mercury
    grades.

Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.179
diff -u -r1.179 compile_target_code.m
--- compiler/compile_target_code.m	5 Dec 2011 04:43:29 -0000	1.179
+++ compiler/compile_target_code.m	6 Dec 2011 09:16:14 -0000
@@ -2126,6 +2126,14 @@
                 GCMethod = gc_boehm_debug,
                 GCGrade0 = "gc_debug"
             ),
+            globals.lookup_bool_option(Globals, low_level_debug, LLDebug),
+            ( 
+                LLDebug = yes,
+                GCGrade1 = GCGrade0 ++ "_ll_debug"
+            ;
+                LLDebug = no,
+                GCGrade1 = GCGrade0
+            ),
             globals.lookup_bool_option(Globals, profile_time, ProfTime),
             globals.lookup_bool_option(Globals, profile_deep, ProfDeep),
             (
@@ -2133,17 +2141,17 @@
                 ; ProfDeep = yes
                 )
             ->
-                GCGrade1 = GCGrade0 ++ "_prof"
+                GCGrade2 = GCGrade1 ++ "_prof"
             ;
-                GCGrade1 = GCGrade0
+                GCGrade2 = GCGrade1
             ),
             globals.lookup_bool_option(Globals, parallel, Parallel),
             (
                 Parallel = yes,
-                GCGrade = "par_" ++ GCGrade1
+                GCGrade = "par_" ++ GCGrade2
             ;
                 Parallel = no,
-                GCGrade = GCGrade1
+                GCGrade = GCGrade2
             ),
             link_lib_args(Globals, TargetType, StdLibDir, "", LibExt,
                 GCGrade, StaticGCLibs, SharedGCLibs)
Index: scripts/ml.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/ml.in,v
retrieving revision 1.130
diff -u -r1.130 ml.in
--- scripts/ml.in	26 Oct 2011 05:50:19 -0000	1.130
+++ scripts/ml.in	6 Dec 2011 09:16:16 -0000
@@ -213,6 +213,9 @@
 
 # Compute the gc grade from the grade
 case "$GRADE" in
+	*.par*.gcd*.ll_debug*.prof*)
+		gc_grade=par_gc_debug_ll_debug_prof
+		;;
 	*.par*.gcd*.prof*)
 		gc_grade=par_gc_debug_prof
 		;;
@@ -225,6 +228,15 @@
 	*.gcd*)
 		gc_grade=gc_debug
 		;;
+	*.par*.gc*.ll_debug*.prof*)
+		gc_grade=par_gc_ll_debug_prof
+		;;
+	*.par*.gc*.ll_debug*)
+		gc_grade=par_gc_ll_debug
+		;;
+	*.gc*.ll_debug*)
+		gc_grade=gc_ll_debug
+		;;
 	*.par*.gc*.prof*)
 		gc_grade=par_gc_prof
 		;;
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list