|
Message
From: cvs at opencores.org<cvs@o...>
Date: Tue Feb 26 22:41:45 CET 2008
Subject: [cvs-checkins] MODIFIED: jop ...
Date: 00/08/02 26:22:41 Modified: jop/java/tools/src/com/jopdesign/libgraph/cfg/bcel BcelStmtFactory.java Log: added small hack to create correct opcode for push depending on constantpool Revision Changes Path 1.5 jop/java/tools/src/com/jopdesign/libgraph/cfg/bcel/BcelStmtFactory.java http://www.opencores.org/cvsweb.shtml/jop/java/tools/src/com/jopdesign/libgraph/cfg/bcel/BcelStmtFactory.java.diff?r1=1.4&r2=1.5 (In the diff below, changes in quantity of whitespace are not shown.) Index: BcelStmtFactory.java =================================================================== RCS file: /cvsroot/stefant/jop/java/tools/src/com/jopdesign/libgraph/cfg/bcel/BcelStmtFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- BcelStmtFactory.java 25 Feb 2008 23:29:34 -0000 1.4 +++ BcelStmtFactory.java 26 Feb 2008 21:41:45 -0000 1.5 @@ -770,7 +770,10 @@ } else if ( iValue >= -32768 && iValue <= 32767 ) { is = new SIPUSH((short)iValue); } else { - is = new LDC( cp.addConstant(value) ); + int index = cp.addConstant(value); + // TODO not a very nice hack, make somewhat generic?? + push.setPoolIndex(index); + is = new LDC(index); } break; case TypeInfo.TYPE_LONG: @@ -780,7 +783,9 @@ } else if ( lValue == 1 ) { is = InstructionConstants.LCONST_1; } else { - is = new LDC2_W( cp.addConstant(value) ); + int index = cp.addConstant(value); + push.setPoolIndex(index); + is = new LDC2_W(index); } break; case TypeInfo.TYPE_FLOAT: @@ -792,7 +797,9 @@ } else if ( fValue == 2.0f ) { is = InstructionConstants.FCONST_2; } else { - is = new LDC( cp.addConstant(value) ); + int index = cp.addConstant(value); + push.setPoolIndex(index); + is = new LDC(index); } break; case TypeInfo.TYPE_DOUBLE: @@ -802,7 +809,9 @@ } else if ( dValue == 1.0 ) { is = InstructionConstants.DCONST_1; } else { - is = new LDC2_W( cp.addConstant(value) ); + int index = cp.addConstant(value); + push.setPoolIndex(index); + is = new LDC2_W(index); } break; case TypeInfo.TYPE_REFERENCE:
|
 |