Estimated hours taken: 5
bytecode*.m:
These now compile without errors. No other promises are made :-)
options:
Adda new option, --generate-bytecode.
mercury_compile:
Generate bytecode if the option is set.
goal_util:
Add a predicate to find all the variables in a goal, even the ones
that have been quantified. Used by the bytecode generator.
call_gen:
Add a predicate and export another for use by the bytecode generator.
hlds_module:
Add a predicate to look up full naming details on a PredId.
Used by the bytecode generator.
hlds_pred:
Remove the follow_vars field from proc_infos, since it is not needed
any more.
hlds_goal:
Remove the store_map field from goal_infos, since it is not needed
any more.
code_gen, code_info, follow_vars, goal_util, hlds_out, middle_rec, store_alloc:
Accommodate the changes in hlds_goal and hlds_pred
vn_block:
Fix an oversight in my previous change.
Estimated hours taken: 4
bytecode*.m:
Almost to first draft.
optimize:
When --debug-opt is given, print each instruction sequence only
if it differs from the previous sequence.
vn_block:
Do not create parallels for backward jumps. Without this precaution,
pred-value-number may create incorrect code. For example, given the
code L1: r1 = detstackvar(1), ... goto L1, it may create a specialized
variant of L1 which assumes detstackvar(1) is in r1. This is true
the first time around, but false on later times.
With this fix, the compiler now passes bootcheck at -O5. (It still
causes misreporting of singleton variables, and my changes to binary
can't track it down. Arrrrgghh.)
options:
Add a (deliberately) undocumented option --vn-fudge <n>, to try to
make up for the inadequacy of the value numbering cost function.
value_number, vn_debug:
Changes to accommodate --vn-fudge.
Estimated hours taken: 4
An early draft of the bytecode generator.
bytecode:
Defines the bytecode data type and the predicates for printing it out.
bytecode_gen:
The code to convert HLDS to bytecode.