Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Revision 1116
ViewVC logotype

Revision 1116


Jump to revision: Previous Next
Author: george
Date: Tue Mar 5 23:17:18 2002 UTC (17 years, 4 months ago)
Log Message:
In order to support the block placement optimization, the first
cluster that is generated (called the linkage cluster) contains a jump
to the entry point for the compilation unit. The linkage cluster
contains only one 'function', so block placement will have no effect on
the linkage cluster itself, but all the other clusters have full
freedom in the manner in which they reorder blocks or functions.

On the x86 the typical linkage code that is generated is:
   ----------------------
	.align 2
   L0:
        addl    $L1-L0, 72(%esp)
        jmp     L0


        .align  2
   L1:
   ----------------------

72(%esp) is the memory location for the stdlink register. This
must contain the address of the CPS function being called. In the
above example, it contains the address of  L0; before
calling L1 (the real entry point for the compilation unit), it
must contain the address for L1, and hence

	addl $L1-L0, 72(%esp)

I have tested this on all architectures except the hppa.The increase
in code size is of course negligible.

Changed paths:

Path Details
Directorysml/trunk/HISTORY modified , text changed
Directorysml/trunk/src/MLRISC/Tools/MDL/mdl-gen-asm.sml modified , text changed
Directorysml/trunk/src/MLRISC/alpha/emit/alphaAsm.sml modified , text changed
Directorysml/trunk/src/MLRISC/hppa/emit/hppaAsm.sml modified , text changed
Directorysml/trunk/src/MLRISC/ppc/emit/ppcAsm.sml modified , text changed
Directorysml/trunk/src/MLRISC/sparc/emit/sparcAsm.sml modified , text changed
Directorysml/trunk/src/MLRISC/x86/emit/x86Asm.sml modified , text changed
Directorysml/trunk/src/compiler/CodeGen/main/mlriscGen.sml modified , text changed

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0