[m-rev.] diff: more LLDS accurate GC tweaks
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Oct 23 16:34:12 AEST 2003
Estimated hours taken: 1
Branches: main
runtime/mercury_accurate_gc.c:
Add some XXX comments.
Fix a bug where the checking for `type != MR_LONG_LVAL_TYPE_STACKVAR'
was being done in the wrong place.
Workspace: /home/ceres/fjh/mercury
Index: runtime/mercury_accurate_gc.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_accurate_gc.c,v
retrieving revision 1.26
diff -u -d -r1.26 mercury_accurate_gc.c
--- runtime/mercury_accurate_gc.c 22 Oct 2003 08:50:15 -0000 1.26
+++ runtime/mercury_accurate_gc.c 23 Oct 2003 06:33:29 -0000
@@ -373,6 +373,10 @@
/*
** Save the old succip and its location.
*/
+ /*
+ ** XXX The code below is wrong for temp frames,
+ ** which do not have the succip or succfr slots!
+ */
assert(location == -1); /* succip is saved in succip_slot */
saved_success_location = MR_succip_slot_addr(curfr_at_signal);
saved_success = *saved_success_location;
@@ -550,6 +554,7 @@
** This should be OK, because none of the values used by a procedure
** will be stored in registers across a call, since we have no
** caller-save registers (they are all callee-save).
+ ** XXX except for the topmost frame!
*/
type_params = MR_materialize_type_params_base(label_layout,
NULL, stack_pointer, current_frame);
@@ -598,17 +603,21 @@
int number;
location = proc_layout->MR_sle_succip_locn;
- type = MR_LONG_LVAL_TYPE(location);
- number = MR_LONG_LVAL_NUMBER(location);
- if (type != MR_LONG_LVAL_TYPE_STACKVAR) {
- MR_fatal_error("can only handle stackvars");
- }
if (MR_DETISM_DET_STACK(proc_layout->MR_sle_detism)) {
+ type = MR_LONG_LVAL_TYPE(location);
+ number = MR_LONG_LVAL_NUMBER(location);
+ if (type != MR_LONG_LVAL_TYPE_STACKVAR) {
+ MR_fatal_error("can only handle stackvars");
+ }
success_ip = (MR_Code *)
MR_based_stackvar(stack_pointer, number);
stack_pointer = stack_pointer -
proc_layout->MR_sle_stack_slots;
} else {
+ /*
+ ** XXX The code below is wrong for temp frames,
+ ** which do not have the succip or succfr slots!
+ */
/* succip is saved in succip_slot */
assert(location == -1);
success_ip = MR_succip_slot(current_frame);
@@ -687,7 +696,9 @@
** saved; This should be OK, because none of the values used
** by a procedure will be stored in registers across a call,
** since we have no caller-save registers (they are all
- ** callee-save).
+ ** callee-save). XXX except for frame which was active
+ ** when we entered the garbage collector!
+ **
** XXX Is it right to pass MR_redofr_slot(max_frame) here?
** Why not just max_frame?
*/
--
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