From: adam Date: Thu, 30 Jun 2005 07:05:01 +0000 (+0000) Subject: massive rewrite of Code.java X-Git-Url: http://git.megacz.com/?p=org.ibex.classgen.git;a=commitdiff_plain;h=131193c8a763d354ae9a8818ffc8059d0e5dfcaf massive rewrite of Code.java darcs-hash:20050630070501-5007d-701e24f59351581fb7568f122ce04a0b2ecbb98f.gz --- diff --git a/src/org/ibex/classgen/Code.java b/src/org/ibex/classgen/Code.java index 22c8fc6..d4c459f 100644 --- a/src/org/ibex/classgen/Code.java +++ b/src/org/ibex/classgen/Code.java @@ -1,74 +1,356 @@ package org.ibex.classgen; -public class Code { - /** - * This should actually be called "ValueProducer", but that - * requires more typing. - * - * A Value is anything that generates an item on the stack. - * Every instruction that causes something new to appear on the - * stack implements Value. Every instruction that uses - * something(s) on the stack will hold a reference to the thing - * (almost always an instruction) that generates the thing(s) it - * removes from the stack. - */ - public interface Value { - // commented out so that the rest of this file compiles - // Instruction[] getUsers(); +/** + * a highly streamlined SSA-form intermediate representation of a + * sequence of JVM instructions; all stack manipulation is factored + * out. + */ +public class JSSA { + + // Constructor ////////////////////////////////////////////////////////////////////////////// + + public JSSA(MethodGen mg) { + Expr[] reg = new Expr[5]; + for(int i=0; i