initial support for branching: phi() function, track stack/locals for every pc-position
authoradam <adam@megacz.com>
Mon, 4 Jul 2005 22:24:54 +0000 (22:24 +0000)
committeradam <adam@megacz.com>
Mon, 4 Jul 2005 22:24:54 +0000 (22:24 +0000)
commit4b586655926ec3807715ede09e642f050c336f79
tree23e77f761fa0275c0b748bc5040d1f74f9ff48be
parent9271b834f0f1ca988f0374cad6a8cc0cce274ee0
initial support for branching: phi() function, track stack/locals for every pc-position

added in preliminary support for branching.  It consisted of:

  - we have to track the state of the stack and localvars separately
    for each instruction-position

  - I introduced a phi() function that "merges" two expressions

  - whenever you branch _to_ an instruction, you have to "map" the
    merge() function over the target stack, passing the source stack
    as an argument (and likewise for locals).

Note that Phis are mutable (see the javadoc comment at the head of
"class Phi"), and you can't "collapse" nested Phi's, even though it's
tempting.

darcs-hash:20050704222454-5007d-64bd5ec518540efe8c9cc47421ae002777bcc687.gz
src/org/ibex/classgen/JSSA.java