PreviousUpNext

15.4.306  src/lib/compiler/back/low/main/nextcode/nextcode-ramregions.pkg

## nextcode-ramregions.pkg

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


stipulate
    package rkj =  registerkinds_junk;                                          # registerkinds_junk            is from   src/lib/compiler/back/low/code/registerkinds-junk.pkg
herein

    package   nextcode_ramregions
    : (weak)  Nextcode_Ramregions                                               # Nextcode_Ramregions           is from   src/lib/compiler/back/low/main/nextcode/nextcode-ramregions.api
    {
        package pt= points_to;                                                  # points_to                     is from   src/lib/compiler/back/low/aliasing/points-to.pkg

        Ramregion = pt::Ramregion;

        memory_cell             = pt::TOP { id=>rkj::make_ram_register 128, name=>"rw",                 mutable => TRUE  };
        readonly_cell           = pt::TOP { id=>rkj::make_ram_register 129, name=>"ro",                 mutable => FALSE };
        stack_cell              = pt::TOP { id=>rkj::make_ram_register 130, name=>"stack",              mutable => TRUE  };
        spill_cell              = pt::TOP { id=>rkj::make_ram_register 131, name=>"spill",              mutable => TRUE  };
        float_cell              = pt::TOP { id=>rkj::make_ram_register 132, name=>"float",              mutable => FALSE };
        heap_changelog_cell     = pt::TOP { id=>rkj::make_ram_register 133, name=>"heap_changelog",     mutable => TRUE  };             # This list tracks writes into the heap, for later use by the heapcleaner ("garbage collector").
                                                                                                                                        # See (for example) log_boxed_update_to_heap_changelog in
                                                                                                                                        #     src/lib/compiler/back/low/main/main/translate-nextcode-to-treecode-g.pkg.compile

        memory          = REF         memory_cell;                              # XXX BUGGO FIXME icky thread-hostile global mutable state.
        readonly        = REF       readonly_cell;                              # XXX BUGGO FIXME icky thread-hostile global mutable state.
        stack           = REF          stack_cell;                              # XXX BUGGO FIXME icky thread-hostile global mutable state.
        spill           = REF          spill_cell;                              # XXX BUGGO FIXME icky thread-hostile global mutable state.
        float           = REF          float_cell;                              # XXX BUGGO FIXME icky thread-hostile global mutable state.
        heap_changelog  = REF heap_changelog_cell;                              # XXX BUGGO FIXME icky thread-hostile global mutable state.

        fun reset ()
            =
            {   memory          :=    memory_cell;
                readonly        :=  readonly_cell;
                stack           :=     stack_cell;
                spill           :=     spill_cell;
                float           :=     float_cell;
                heap_changelog  := heap_changelog_cell;
            };

        my    ramregion_to_string
        = pt::ramregion_to_string;
    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext