mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-12 20:34:19 +00:00
Estimated hours taken: 4 Branches: main 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. 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/higher_order.m: Look for the two new cons_ids, instead of the old ones. Make the code more maintainable. compiler/*.m: Minor changes to conform to the changes above. library/private_builtin.m: Delete the statement that the compiler depends on the functors of the type_info and type_ctor_info types. bytecode/mb_bytecode.h: Document that some bytecodes generated by the compiler are not yet implemented by the bytecode interpreter.
This directory holds the source code for the Mercury bytecode utilities. `mdis' is the Mercury bytecode disassembler. `mbi' is the Mercury bytecode interpreter. `libmbi' is the same thing, minus main(). All exported symbols defined in modules in this directory should be prefixed with `MB_', for "Mercury Bytecode", to avoid clashes with names defined in other packages.