[m-rev.] for review: type_info_cell_constructor

David Overton dmo at cs.mu.OZ.AU
Tue Jun 24 09:19:09 AEST 2003


On Sun, Jun 22, 2003 at 08:48:55PM +1000, Zoltan Somogyi wrote:
> I have already discussed the basic concept with Fergus, and the implementation
> is straightforward. However, I would like David to confirm that it is OK for a
> compiler-generated inst to refer to a function symbol that is not in the
> program at all. (The old code already lied about the arity of function symbols
> in insts.)

You didn't post the code for this change, but I think what you're
proposing should be okay.

> 
> Zoltan.
> 
> Prepare to make type_info and typeclass_info foreign types by eliminating the
> compiler's dependence on their function symbols. At the moment, the compiler
> generates type_intos and typeclass_infos by using the function symbols of these
> types as cons_ids. However, the function symbols have fake arities, which
> demanded special treatment in many places. This change makes the compiler use
> the cons_ids type_into_cell_constructor and typeclass_into_cell_constructor
> instead, except in insts, which need to know the arity of the constructor.
> 
> compiler/hlds_data.m:
> 	Add the two new cons_ids.
> 
> compiler/polymorphism.m:
> 	Use the two new cons_ids instead of the function symbols of the
> 	type_info and typeclass_info types, since those function symbols
> 	will soon be deleted.
> 
> compiler/type_util.m:
> 	Add a type and some predicates to control the representation of
> 	type_info and typeclass_info cells in one place.
> 
> 	Since we no longer depend on the representations of the function
> 	symbols of the type_info and typeclass_info types, do not special
> 	case their representation.

You should ensure that type_util__cons_id_arg_types, which is called by 
inst_match.bound_inst_list_is_complete_for_type, does the right thing.
The predicate bound_inst_list_is_complete_for_type requires the
representation of the cons_ids which are used in insts.

> 
> compiler/hlds_code_util.m:
> 	Implement the representation of the two new function symbols.
> 
> compiler/bytecode.m:
> 	Add two new cons_ids to parallel the ones in hlds_data.m.
> 
> compiler/bytecode.m:
> 	Add two new cons_ids to parallel the ones in hlds_data.m.
> 
> compiler/*.m:
> 	Minor changes to conform to the changes above.
> 
> bytecode/mb_bytecode.h:
> 	Document that some bytecodes generated by the compiler are not yet
> 	implemented by the bytecode interpreter.


David
-- 
David Overton                  Uni of Melbourne     +61 3 8344 1354
dmo at cs.mu.oz.au                Monash Uni (Clayton) +61 3 9905 5779
http://www.cs.mu.oz.au/~dmo    Mobile Phone         +61 4 0337 4393
--------------------------------------------------------------------------
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