Files
mercury/java/runtime
Peter Wang 8eb879e701 Make :- initialise' and :- finalise' declarations work in Java grades.
Branches: main

Make `:- initialise' and `:- finalise' declarations work in Java grades.
Initialisation predicates are simply called from static initialisation blocks.
Finalisation predicates work by registering methods (objects) with the
JavaInternal runtime class.  After main/2 terminates each of the registered
methods is called.

compiler/make_hlds_passes.m:
        Make add_pass_3_initialise, add_pass_3_finalise generate predicates
        for backends other than C.

compiler/mlds_to_java.m:
        Generate code to register finalisation predicates with the runtime.

        Make the generated code that calls main/2 call run the registered
        finalisers as well.

java/runtime/JavaInternal.java:
        Add code to register and call finalisers when main/2 terminates.
2009-06-22 03:31:30 +00:00
..