PreviousUpNext

15.4.298  src/lib/compiler/back/low/main/nextcode/late-constant.pkg

## late-constant.pkg -- constants unknown until late in the compilation process,
##                      used to specialize lowhalf and the code generators.
#
#     "[The backend lowhalf] allows the client to inject into the
#      instruction stream abstract constants that are resolved only
#      at the end of the compilation phase. These constants can be
#      used wherever an integer literal is expected. Typical usages
#      are stack frame offsets for spill locations which are only
#      known after register allocation, and garbage collection and
#       exception maps which are resolved only when all address
#      calculation has been performed."
#                                           -- http://www.cs.nyu.edu/leunga/MLRISC/Doc/html/constants.html

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

stipulate
    package lem =  lowhalf_error_message;               # lowhalf_error_message         is from   src/lib/compiler/back/low/control/lowhalf-error-message.pkg
herein

    package late_constant {                             # Late_Constant                 is from   src/lib/compiler/back/low/code/late-constant.api
        #
        Late_Constant = Int; 

        fun late_constant_to_string  n
            =
            "";


        fun late_constant_to_int  n
            =
            lem::impossible ("Constant");


        fun late_constant_to_hashcode  n
            =
            0u0;

        fun same_late_constant
              (
                x:  Late_Constant,
                y:  Late_Constant
              )
            =
            FALSE;
    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext