mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-17 14:57:03 +00:00
Estimated hours taken: 8
Branches: main
Add an option `--no-inline-builtins', which causes builtins to
be generated as calls to out-of-line procedures. This is done
by default when debugging, as without this option the execution
of builtins is not traced.
On earth, a compiler built in grade asm_fast.gc.tr.debug
takes 36.8s to run `mmc -C -I ../analysis/ hlds.make_hlds'.
When the compiler is built with `--no-inline-builtins',
this is increased to 38.6s.
The size of the compiler built in grade asm_fast.gc.tr.debug
increases from 45.0MB to 46.6MB.
compiler/options.m:
Add the option.
compiler/code_util.m:
Work out whether builtins should be generated inline.
compiler/handle_options.m:
Disable inlining of builtins when debugging.
compiler/simplify.m:
compiler/higher_order.m:
compiler/modes.m:
code_util__builtin_state now needs to know where the
builtin is being called from to know whether a particular
call should be treated as an inline builtin. The "recursive"
calls from the automatically generated procedures for each
builtin should always be generated inline, or else we would
generate an infinite loop.
NEWS:
doc/user_guide.texi:
compiler/notes/todo.html:
Document the change.
tests/debugger/Mmakefile:
tests/debugger/no_inline_builtins.{m,exp,inp}:
Test case.
tests/debugger/*.{inp,exp,exp2}:
tests/debugger/declarative/*.{inp,exp,exp2}:
Update due to changed event numbers.
tests/debugger/lval_desc_array.inp:
Use a less brittle method for stepping to the point in
the program where the test needs to display variables.
tests/debugger/declarative/library_forwarding.m:
tests/debugger/declarative/*.m:
Add forwarding predicates for some library predicates
and functions so that the declarative debugger doesn't
ask different questions depending on whether or not
the library was compiled with debugging enabled.