|
Message
From: cvs at opencores.org<cvs@o...>
Date: Tue Feb 26 00:29:36 CET 2008
Subject: [cvs-checkins] MODIFIED: jop ...
Date: 00/08/02 26:00:29 Modified: jop/java/tools/src/com/jopdesign/libgraph/cfg/statements/stack StackGetField.java StackPush.java Log: fixes for incomplete code loading, added more array handling code Revision Changes Path 1.5 jop/java/tools/src/com/jopdesign/libgraph/cfg/statements/stack/StackGetField.java http://www.opencores.org/cvsweb.shtml/jop/java/tools/src/com/jopdesign/libgraph/cfg/statements/stack/StackGetField.java.diff?r1=1.4&r2=1.5 (In the diff below, changes in quantity of whitespace are not shown.) Index: StackGetField.java =================================================================== RCS file: /cvsroot/stefant/jop/java/tools/src/com/jopdesign/libgraph/cfg/statements/stack/StackGetField.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- StackGetField.java 24 Feb 2008 20:18:23 -0000 1.4 +++ StackGetField.java 25 Feb 2008 23:29:36 -0000 1.5 @@ -41,7 +41,7 @@ } public TypeInfo[] getPushTypes() { - return new TypeInfo[] { getFieldInfo().getType() }; + return new TypeInfo[] { getConstantField().getType() }; } public QuadStatement[] getQuadCode(TypeInfo[] stack, VariableTable varTable) { @@ -63,7 +63,7 @@ } public String getCodeLine() { - return "getfield " + getClassInfo().getClassName() + "." + getFieldInfo().getName(); + return "getfield " + getConstantField().getFQName(); } public ConstantValue[] getConstantValues(ConstantValue[] input) { 1.4 jop/java/tools/src/com/jopdesign/libgraph/cfg/statements/stack/StackPush.java http://www.opencores.org/cvsweb.shtml/jop/java/tools/src/com/jopdesign/libgraph/cfg/statements/stack/StackPush.java.diff?r1=1.3&r2=1.4 (In the diff below, changes in quantity of whitespace are not shown.) Index: StackPush.java =================================================================== RCS file: /cvsroot/stefant/jop/java/tools/src/com/jopdesign/libgraph/cfg/statements/stack/StackPush.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- StackPush.java 24 Feb 2008 20:18:23 -0000 1.3 +++ StackPush.java 25 Feb 2008 23:29:36 -0000 1.4 @@ -34,6 +34,7 @@ private TypeInfo type; private ConstantValue value; + private int poolIndex; public static final byte OP_ACONST_NULL = 0x01; public static final byte OP_ICONST_0 = 0x03; @@ -50,9 +51,18 @@ public static final byte OP_LDC_W = 0x13; public static final byte OP_LDC2_W = 0x14; + public static final int MAX_BYTE = 255; + public StackPush(ConstantValue value) { this.type = value.getType(); this.value = value; + this.poolIndex = 0; + } + + public StackPush(ConstantValue value, int poolIndex) { + this.type = value.getType(); + this.value = value; + this.poolIndex = poolIndex; } public TypeInfo getType() { @@ -96,7 +106,7 @@ } else if ( iValue >= -32768 && iValue <= 32767 ) { return OP_SIPUSH; } else { - return OP_LDC; + return poolIndex <= MAX_BYTE ? OP_LDC : OP_LDC_W; } case TypeInfo.TYPE_LONG: long lValue = value.getLongValue(); @@ -116,7 +126,7 @@ } else if ( fValue == 2.0f ) { return OP_FCONST_2; } else { - return OP_LDC; + return poolIndex <= MAX_BYTE ? OP_LDC : OP_LDC_W; } case TypeInfo.TYPE_DOUBLE: double dValue = value.getDoubleValue();
@@ -132,7 +142,7 @@
if ( txt == null ) {
return OP_ACONST_NULL;
} else {
- return OP_LDC;
+ return poolIndex <= MAX_BYTE ? OP_LDC : OP_LDC_W;
}
}
return -1;
|
 |