harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r774354 - in /harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm: Instruction.java Operand.java SimpleInstruction.java
Date Wed, 13 May 2009 13:29:22 GMT
Author: sjanuary
Date: Wed May 13 13:29:22 2009
New Revision: 774354

URL: http://svn.apache.org/viewvc?rev=774354&view=rev
Log:
Apply patch for HARMONY-6104 ([dvrlm][testing][vmtt] VMTT renders multianewarray incorrectly)

Modified:
    harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Instruction.java
    harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Operand.java
    harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/SimpleInstruction.java

Modified: harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Instruction.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Instruction.java?rev=774354&r1=774353&r2=774354&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Instruction.java
(original)
+++ harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Instruction.java
Wed May 13 13:29:22 2009
@@ -31,7 +31,7 @@
  */
 
 public abstract class Instruction {
-	
+
 	protected int opcode = -1;
 	protected String mnemonic = null;
 	protected Vector operands = new Vector();
@@ -39,11 +39,11 @@
 	public int getOpcode() {
 		return opcode;
 	}
-	
+
 	public String getMnemonic() {
 		return mnemonic;
 	}
-	
+
 	public Operand operandAt(int i)
 		throws ArrayIndexOutOfBoundsException {
 		return (Operand) operands.elementAt(i);
@@ -52,19 +52,19 @@
 	public int getOperandsCount() {
 		return operands.size();
 	}
-	
+
 	public void setOpcode(int c) {
 		opcode = c;
 	}
-	
+
 	public void setMnemonic(String m) {
 		mnemonic = m;
 	}
-	
+
 	public void addOperand(Operand op) {
 		operands.add(op);
 	}
-	
+
 	public void setOperands(Operand[] ops) {
 		if (ops == null) {
 			throw new NullPointerException();
@@ -74,12 +74,16 @@
 			operands.add(ops[i]);
 		}
 	}
-	
+
 	public abstract int read(DataInputStream stream, int cp)
 		throws IOException, EOFException;
-	
+
 	public abstract void parse(StreamTokenizer st, DataOutputStream dos)
 	    throws IOException, CodeFileFormatException;
 
     public abstract String toString();
+
+    public String operandCommentString() {
+    	return "";
+    }
 }

Modified: harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Operand.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Operand.java?rev=774354&r1=774353&r2=774354&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Operand.java
(original)
+++ harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/Operand.java
Wed May 13 13:29:22 2009
@@ -71,8 +71,20 @@
 		        return "#" + (operand_value.byteValue() & 0xFF);
 		    }
 		    //return "#" + str;
-		    return "#" + str + "  // " + Utils.refToValue(DefaultCodeFileGenerator.classFile, "#"
+ str); 
+		    return "#" + str; 
 		}
 		return str; 
 	}
+	
+	public String operandCommentString() {
+		String str = operand_value.toString(); 
+		if (operand_type == OT_REF) {
+		    if (getSize() == 1) {
+		        return "";
+		    }
+		    //return comment
+		    return "  // " + Utils.refToValue(DefaultCodeFileGenerator.classFile, "#" + str); 
+		}
+		return ""; 
+	}
 }

Modified: harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/SimpleInstruction.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/SimpleInstruction.java?rev=774354&r1=774353&r2=774354&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/SimpleInstruction.java
(original)
+++ harmony/enhanced/buildtest/trunk/tests/tools/vmtt/src/org/apache/harmony/vmtt/disasm/SimpleInstruction.java
Wed May 13 13:29:22 2009
@@ -132,6 +132,9 @@
 		for (int i = 0; i < operands.size(); i++) {
 			str.append(" " + operandAt(i).toString());
 		}
+		for (int i= 0; i < operands.size(); i++) {
+			str.append(" " + operandAt(i).operandCommentString());
+		}
 		return str.toString();
 	}
 }



Mime
View raw message