X-Git-Url: http://git.megacz.com/?p=org.ibex.classgen.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fclassgen%2FCode.java;h=d4c459f3d48addb30b2dc38f339ccf3ebccfea8f;hp=22c8fc6fef1acbc37eac794b564d32162453ba6e;hb=131193c8a763d354ae9a8818ffc8059d0e5dfcaf;hpb=dd2d5b53ba4a600e20978d1d357bd45eded46aba;ds=sidebyside 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