[m-rev.] agc: don't add tracing code to gc_trace/1
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Jun 6 21:43:08 AEST 2002
Estimated hours taken: 1
Branches: main
compiler/ml_elim_nested.m:
A minor optimization: don't add GC tracing code
to the gc_trace/1 primitive.
Also update the accurate GC TODO list.
Workspace: /home/ceres/fjh/mercury
Index: compiler/ml_elim_nested.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_elim_nested.m,v
retrieving revision 1.57
diff -u -d -r1.57 ml_elim_nested.m
--- compiler/ml_elim_nested.m 2 Apr 2002 16:36:11 -0000 1.57
+++ compiler/ml_elim_nested.m 6 Jun 2002 11:40:23 -0000
@@ -152,14 +152,24 @@
% This is described in more detail in the following paper:
% Fergus Henderson <fjh at cs.mu.oz.au>,
% "Accurate garbage collection in an uncooperative environment".
-% Submitted for publication. Available from the author on request.
+% International Symposium on Memory Management, Berlin, Germany, 2002.
%
% XXX Accurate GC is still not yet fully implemented.
% TODO:
+% - heap reclamation on failure is not yet supported.
+% One difficulty is that when resetting the heap,
+% we need to also reset all the local variables which might
+% point to reclaimed garbage, otherwise the collector might
+% try to trace through them, which can result in an error
+% since the data pointed to isn't of the right type
+% because it has been overwritten.
+% - the garbage collector should resize the heap if/when it fills up
+% - the garbage collector should collect the solutions heap
+% and the global heap as well as the ordinary heap
% - handle `pragma export'
-% - support higher-order code: fix the remaining problems with tracing
-% the wrapper functions generated for higher-order code.
-% - support type classes: same issues as for higher-order code, I think
+% - support type classes: currently we generate code for type class
+% method wrappers which calls MR_materialize_closure_type_params(),
+% which only works for closures, not for typeclass_infos.
% - support --nondet-copy-out (see comment in flatten_nested_defn)
% - support --high-level-data (fixup_newobj_in_atomic_statement
% gets the types wrong; see comment in ml_code_util.m)
@@ -411,7 +421,15 @@
Defn0 = mlds__defn(Name, Context, Flags, DefnBody0),
(
DefnBody0 = mlds__function(PredProcId, Params0,
- defined_here(FuncBody0), Attributes)
+ defined_here(FuncBody0), Attributes),
+ % Don't add GC tracing code to the gc_trace/1 primitive!
+ % (Doing so would just slow things down unnecessarily.)
+ \+ (
+ Name = function(PredLabel, _, _, _),
+ PredLabel = pred(_, _, "gc_trace", 1, _, _),
+ mercury_private_builtin_module(PrivateBuiltin),
+ ModuleName = mercury_module_name_to_mlds(PrivateBuiltin)
+ )
->
EnvName = ml_env_name(Name, Action),
EnvTypeName = ml_create_env_type_name(EnvName,
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list