vocabulary, in addition to providing the user-visible words of the compiler, implements the main compilation loop.
Once compiled, a word is added to the assoc stored in the
variable. When compilation is complete, this assoc is passed to
word performs the actual task of compiling an individual word. The process proceeds as follows:
• The word calls frontend . If this fails, the error is passed to build-tree . The logic for ignoring certain compile errors generated for inline words and macros is located here. If the error is not ignorable, it is added to the global deoptimize assoc (see compiler-errors ). Compiler errors • If the word contains a breakpoint, compilation ends here. Otherwise, all remaining steps execute until machine code is generated. Any further errors thrown by the compiler are not reported as compile errors, but instead are ordinary exceptions. This is because they indicate bugs in the compiler, not errors in user code. • The word then calls frontend . This produces the final optimized tree IR, and this stage of the compiler is complete. optimize-tree • The word calls backend followed by build-cfg and a few other stages. Finally, it calls optimize-cfg . generate
If compilation fails, the word is stored in the
assoc with a value of
. This causes the VM to compile the word with the non-optimizing compiler.
is handled not by the
vocabulary, but rather
. The optimizing compiler merely provides an implementation of the
This documentation was generated offline from a
load-all image. If you want, you can also
browse the documentation from within the
UI developer tools. See
the Factor website
for more information.
Factor 0.99 x86.64 (2203, heads/master-424edf64aa, Mar 8 2023 13:48:50)