[m-rev.] diff: narrow position_info

Zoltan Somogyi zs at csse.unimelb.edu.au
Fri Jun 6 17:51:25 AEST 2008


compiler/code_info.m:
	Make the position_info type contain just the location dependent part of
	the code_info. This avoids requiring the Boehm collector to hold on to
	old versions of maps in the persistent part.

	Modify the save_hp_in_branch predicate, which may need to allocate
	persistent temporaries, to take and update the persistent part
	of the *current* code_info instead of the no-longer-there persistent
	part of the initial position_info. This fixes a potential bug:
	with the old arrangement, the final code info at the end of the
	disjunction would not have known about any such allocations
	of persistent temporaries.

compiler/disj_gen.m:
	Conform to the change in save_hp_in_branch.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.363
diff -u -b -r1.363 code_info.m
--- compiler/code_info.m	2 Jun 2008 02:33:35 -0000	1.363
+++ compiler/code_info.m	4 Jun 2008 05:57:00 -0000
@@ -1192,14 +1192,15 @@
     code_info::in, code_info::out) is det.
 
 :- pred save_hp_in_branch(code_tree::out, lval::out,
-    position_info::in, position_info::out) is det.
+    position_info::in, position_info::out, code_info::in, code_info::out)
+    is det.
 
 :- implementation.
 
 :- type position_info
     --->    position_info(
-                code_info   % The code_info at a given position
-                            % in the code of the procedure.
+                code_info_loc_dep   % The location-dependent part of the
+                                    % code_info at a given position.
             ).
 
 :- type branch_end_info
@@ -1207,10 +1208,13 @@
                 code_info   % The code_info at the end of a branch.
             ).
 
-remember_position(CI, position_info(CI)).
+:- func pos_get_fail_info(position_info) = fail_info.
+
+pos_get_fail_info(position_info(LocDep)) = LocDep ^ cild_fail_info.
+
+remember_position(CI, position_info(CI ^ code_info_loc_dep)).
 
-reset_to_position(position_info(PosCI), CurCI, NextCI) :-
-    PosCI   = code_info(_, LocDep, _),
+reset_to_position(position_info(LocDep), CurCI, NextCI) :-
     CurCI   = code_info(Static, _, Persistent),
     NextCI0 = code_info(Static, LocDep, Persistent),
 
@@ -1220,8 +1224,7 @@
     set_temps_in_use(TempsInUse, NextCI0, NextCI).
 
 reset_resume_known(BranchStart, !CI) :-
-    BranchStart = position_info(BranchStartCI),
-    get_fail_info(BranchStartCI, BranchStartFailInfo),
+    BranchStartFailInfo = pos_get_fail_info(BranchStart),
     BranchStartFailInfo = fail_info(_, BSResumeKnown, _, _, _),
     get_fail_info(!.CI, CurFailInfo),
     CurFailInfo = fail_info(CurFailStack, _, CurCurfMaxfr, CurCondEnv,
@@ -1312,7 +1315,8 @@
     (
         MaybeEnd = yes(BranchEnd),
         BranchEnd = branch_end_info(BranchEndCodeInfo),
-        reset_to_position(position_info(BranchEndCodeInfo), !CI),
+        BranchEndLocDep = BranchEndCodeInfo ^ code_info_loc_dep,
+        reset_to_position(position_info(BranchEndLocDep), !CI),
         remake_with_store_map(StoreMap, !CI)
     ;
         MaybeEnd = no,
@@ -1335,10 +1339,15 @@
     reinit_var_locn_state(VarLvals, VarLocnInfo0, VarLocnInfo),
     set_var_locn_info(VarLocnInfo, !CI).
 
-save_hp_in_branch(Code, Slot, Pos0, Pos) :-
-    Pos0 = position_info(CodeInfo0),
-    save_hp(Code, Slot, CodeInfo0, CodeInfo),
-    Pos  = position_info(CodeInfo).
+save_hp_in_branch(Code, Slot, Pos0, Pos, CI0, CI) :-
+    CI0 = code_info(CIStatic0, CILocDep0, CIPersistent0),
+    Pos0 = position_info(LocDep0),
+    CI1 = code_info(CIStatic0, LocDep0, CIPersistent0),
+    save_hp(Code, Slot, CI1, CI2),
+    CI2 = code_info(CIStatic, LocDep, CIPersistent),
+    Pos = position_info(LocDep),
+    % Reset the location dependent part to the original.
+    CI = code_info(CIStatic, CILocDep0, CIPersistent).
 
 %---------------------------------------------------------------------------%
 %---------------------------------------------------------------------------%
Index: compiler/disj_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/disj_gen.m,v
retrieving revision 1.110
diff -u -b -r1.110 disj_gen.m
--- compiler/disj_gen.m	2 Jun 2008 02:27:25 -0000	1.110
+++ compiler/disj_gen.m	4 Jun 2008 05:18:41 -0000
@@ -526,7 +526,7 @@
             % location-dependent state originally in BranchStart0.
 
             save_hp_in_branch(BranchSaveHpCode, BranchHpSlot,
-                BranchStart0, BranchStart),
+                BranchStart0, BranchStart, !CI),
             tree.flatten(SaveHpCode, HpCodeList),
             tree.flatten(BranchSaveHpCode, BranchHpCodeList),
             expect(unify(HpCodeList, BranchHpCodeList), this_file,
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_allegro
cvs diff: Diffing extras/graphics/mercury_allegro/examples
cvs diff: Diffing extras/graphics/mercury_allegro/samples
cvs diff: Diffing extras/graphics/mercury_allegro/samples/demo
cvs diff: Diffing extras/graphics/mercury_allegro/samples/mandel
cvs diff: Diffing extras/graphics/mercury_allegro/samples/pendulum2
cvs diff: Diffing extras/graphics/mercury_allegro/samples/speed
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/posix/samples
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/standalone_c
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/solver_types
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing ssdb
cvs diff: Diffing tests
cvs diff: Diffing tests/analysis
cvs diff: Diffing tests/analysis/ctgc
cvs diff: Diffing tests/analysis/excp
cvs diff: Diffing tests/analysis/ext
cvs diff: Diffing tests/analysis/sharing
cvs diff: Diffing tests/analysis/table
cvs diff: Diffing tests/analysis/trail
cvs diff: Diffing tests/analysis/unused_args
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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