* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / doc / stack.txt
index 02eee0fa2b6779b4153e674154b936f18a9afcbe..603b87556e8a7a40b3c6590cd11cc87e7b5a5756 100644 (file)
@@ -31,10 +31,10 @@ The following invariants hold at all time for the stack representation:
                           ...
             [slots produced by instruction N]
 
-               CAUTION: In this context `produced` means that a stackelement has been
-                        allocated to represent the output of the instruction. For example
-                                the SWAP instruction produces two stackelements although it does
-                                not change the stack depth.
+        CAUTION: In this context `produced` means that a stackelement has been
+                 allocated to represent the output of the instruction. For example
+                 the SWAP instruction produces two stackelements although it does
+                 not change the stack depth.
 
     5) The instack of a block (if non-NULL) is allocated at a lower address than
        the stack slots produced within the block (if any).
@@ -42,16 +42,22 @@ The following invariants hold at all time for the stack representation:
     6) References can only go to lower memory addresses. That is, for each stack slot sp:
 
             (sp->prev == NULL) or (sp->prev < sp)
+    7) If an instruction produces any stackslots, iptr->dst points to the highest-address 
+       stackslot produced
+       Corollary: if iptr->dst points to curstack or below, the instruction does
+                   not produce any stackslots
+
 
     ATTENTION: The instack of a block and the slots produced within the block
                are *not* guaranteed to be adjacent (see figure below)!
 
     ATTENTION: not every stack slot that is allocated may be reachable
-               by following the pointer in basicblock or instruction!
+               by following the pointers in basicblock or the instructions!
 
-                          NOTE: This is a problem. As far as I know it is only the case
-                                for IINC, which produces a dummy stack slot. We should
-                                        change that.
+               NOTE: This is a problem. As far as I know it is only the case
+                     for IINC, which produces a dummy stack slot. We should
+                     change that.
 
 
 Figure 1: Stack representation of a basic block:
@@ -69,5 +75,5 @@ Figure 1: Stack representation of a basic block:
 
 NOTE: The bptr->stack field will be added for inlining. It is not in CACAO SVN, yet.
 
-# vim: et sts=4 sw=4
+# vim: et sts=4 sw=4 ts=4