PreviousUpNext

15.3.119  src/lib/compiler/back/low/main/main/backend-lowhalf.api

## backend-lowhalf.api

# Compiled by:
#     src/lib/compiler/core.sublib



#  Generation of machine code from a list of nextcode functions 

stipulate
    package err =  error_message;                                                       # error_message                         is from   src/lib/compiler/front/basics/errormsg/error-message.pkg
    package ncf =  nextcode_form;                                                       # nextcode_form                         is from   src/lib/compiler/back/top/nextcode/nextcode-form.pkg
    package pcs =  per_compile_stuff;                                                   # per_compile_stuff                     is from   src/lib/compiler/front/typer-stuff/main/per-compile-stuff.pkg
herein

    # This api is implemented in:
    #
    #     src/lib/compiler/back/low/main/main/backend-lowhalf-g.pkg
    #
    api Backend_Lowhalf {
        #
        include api Backend_Lowhalf_Core;                                               # Backend_Lowhalf_Core                  is from   src/lib/compiler/back/low/main/main/backend-lowhalf-core.api

        package t2m: Translate_Treecode_To_Machcode                                     # Translate_Treecode_To_Machcode        is from   src/lib/compiler/back/low/treecode/translate-treecode-to-machcode.api
                     where
                          mcg == mcg                                                    # "mcg" == "machcode_controlflow_graph".
                     also mcf == mcg::mcf;                                              # "mcf" == "machcode_form" (abstract machine code).

        package ihc: Emit_Treecode_Heapcleaner_Calls                                    # Emit_Treecode_Heapcleaner_Calls       is from   src/lib/compiler/back/low/main/nextcode/emit-treecode-heapcleaner-calls.api
                     where
                          mcg == t2m::mcg                                               # "mcg" == "machcode_controlflow_graph".
                     also tcs == t2m::tcs;                                              # "tcs" == "treecode_stream".

        package crm                                                                     # "crm" == "compiler_register_moves".
              : Compile_Register_Moves                                                  # Compile_Register_Moves                is from   src/lib/compiler/back/low/code/compile-register-moves.api
                where
                    mcf == t2m::mcf;                                                    # "mcf" == "machcode_form" (abstract machine code).

        package mp                                                                      # Typically                                       src/lib/compiler/back/low/main/intel32/machine-properties-intel32.pkg
              : Machine_Properties;                                                     # Machine_Properties                    is from   src/lib/compiler/back/low/main/main/machine-properties.api

        abi_variant
            :
            Null_Or(  String ); # To distinguish between different ABIs
                                # for same CPU/OSKind combination;
                                # prime example: intel-based macs which
                                # are intel32/unix vs. intel-based linux
                                # boxen.

        translate_nextcode_to_execode
          :
          { nextcode_functions:         List( ncf::Function ),                          # Typically the complete set of functions for one sourcefile.

            fun_id__to__max_resource_consumption                                        # Given
                :                                                                       # a
                ncf::Codetemp                                                           # fun_id
                ->                                                                      # return
                { max_possible_heapwords_allocated_before_next_heaplimit_check: Int,            # max words of heap memory allocated before next heaplimit check and
                  max_possible_nextcode_ops_run_before_next_heaplimit_check:    Int             # max nextcode instructions executed before next heaplimit check.
                },
            #
            err:                        err::Plaint_Sink,
            source_name:                String,                                         # Typically a filename, something like "<stdin>" if compiling interactively.
            per_compile_stuff:          pcs::Per_Compile_Stuff( deep_syntax::Declaration )
          }
          ->
          (Void -> Int);
    };
end;


## COPYRIGHT (c) 1999 Lucent Technologies, Bell Labs 
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext