# HG changeset patch # User Gilles Duboscq # Date 1306771292 -7200 # Node ID 9ba6a8abe894d1ae2159079f38c09182dfaf1add # Parent 244921d7cf50ab76cc81ac4626207ccefa845156 Fix Invoke bci problem diff -r 244921d7cf50 -r 9ba6a8abe894 graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java --- 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 diff -r 244921d7cf50 -r 9ba6a8abe894 graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java --- 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); diff -r 244921d7cf50 -r 9ba6a8abe894 graal/GraalCompiler/src/com/sun/c1x/ir/Invoke.java --- 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++) { diff -r 244921d7cf50 -r 9ba6a8abe894 rundacapo.sh --- 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 $*