changeset 2825:9ba6a8abe894

Fix Invoke bci problem
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Mon, 30 May 2011 18:01:32 +0200
parents 244921d7cf50
children d54ea877a302
files graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java graal/GraalCompiler/src/com/sun/c1x/ir/Invoke.java rundacapo.sh
diffstat 4 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Mon May 30 16:41:05 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Mon May 30 18:01:32 2011 +0200
@@ -464,11 +464,12 @@
     }
 
     private int getBeforeInvokeBci(Invoke invoke) {
-        int length = 3;
+        /*int length = 3;
         if (invoke.opcode() == Bytecodes.INVOKEINTERFACE) {
             length += 2;
         }
-        return invoke.stateAfter().bci - length;
+        return invoke.stateAfter().bci - length;*/
+        return invoke.bci;
     }
 
     @Override
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Mon May 30 16:41:05 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Mon May 30 18:01:32 2011 +0200
@@ -829,7 +829,7 @@
 
     private void appendInvoke(int opcode, RiMethod target, Value[] args, int cpi, RiConstantPool constantPool) {
         CiKind resultType = returnKind(target);
-        Invoke invoke = new Invoke(opcode, resultType.stackKind(), args, target, target.signature().returnType(compilation.method.holder()), graph);
+        Invoke invoke = new Invoke(opcode, resultType.stackKind(), args, target, target.signature().returnType(compilation.method.holder()), graph, bci());
         Value result = appendWithBCI(invoke);
         handleException(invoke, bci());
         frameState.pushReturn(resultType, result);
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Invoke.java	Mon May 30 16:41:05 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Invoke.java	Mon May 30 18:01:32 2011 +0200
@@ -81,6 +81,7 @@
     public final int opcode;
     public final RiMethod target;
     public final RiType returnType;
+    public final int bci; // XXX needed because we can not compute the bci from the sateBefore bci of this Invoke was optimized from INVOKEINTERFACE to INVOKESPECIAL
 
     /**
      * Constructs a new Invoke instruction.
@@ -92,11 +93,12 @@
      * @param target the target method being called
      * @param stateBefore the state before executing the invocation
      */
-    public Invoke(int opcode, CiKind result, Value[] args, RiMethod target, RiType returnType, Graph graph) {
+    public Invoke(int opcode, CiKind result, Value[] args, RiMethod target, RiType returnType, Graph graph, int bci) {
         super(result, args.length, SUCCESSOR_COUNT, graph);
         this.opcode = opcode;
         this.target = target;
         this.returnType = returnType;
+        this.bci = bci;
 
         this.argumentCount = args.length;
         for (int i = 0; i < args.length; i++) {
--- a/rundacapo.sh	Mon May 30 16:41:05 2011 +0200
+++ b/rundacapo.sh	Mon May 30 18:01:32 2011 +0200
@@ -15,4 +15,4 @@
   echo "DACAPO is not defined. It must point to a Dacapo benchmark directory."
   exit 1;
 fi
-${JDK7}/bin/java -client -d64 -graal -XX:+C1XBailoutIsFatal -XX:+PrintCompilation -C1X:-QuietBailout -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar Harness $*
+${JDK7}/bin/java -client -d64 -graal -XX:-C1XBailoutIsFatal -XX:+PrintCompilation -C1X:+QuietBailout -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar Harness --preserve $*