diff graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2640:9e30cf6dcf96

More frame state fixes. All jtt tests passing now again.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 11 May 2011 14:02:08 +0200
parents 8e96b2b3a866
children 63633fb05914
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Wed May 11 13:41:35 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Wed May 11 14:02:08 2011 +0200
@@ -469,6 +469,24 @@
         for (int i = 0; i < argumentCount; i++) {
             Value arg = invoke.argument(i);
             if (arg != null) {
+                //builder.push(arg.kind, arg);
+            }
+        }
+        return builder.create(invoke.bci());
+    }
+
+    protected FrameState stateBeforeInvokeWithArguments(Invoke invoke) {
+
+        FrameState stateAfter = invoke.stateAfter();
+        FrameStateBuilder builder = new FrameStateBuilder(compilation.method, invoke.graph());
+        builder.initializeFrom(stateAfter);
+        if (invoke.kind != CiKind.Void) {
+            builder.pop(invoke.kind);
+        }
+        int argumentCount = invoke.argumentCount(); // invoke.arguments() iterable?
+        for (int i = 0; i < argumentCount; i++) {
+            Value arg = invoke.argument(i);
+            if (arg != null) {
                 builder.push(arg.kind, arg);
             }
         }
@@ -478,7 +496,8 @@
     @Override
     public void visitInvoke(Invoke x) {
         RiMethod target = x.target();
-        LIRDebugInfo info = stateFor(x, stateBeforeInvoke(x));
+        LIRDebugInfo info = stateFor(x, stateBeforeInvokeWithArguments(x));
+        LIRDebugInfo info2 = stateFor(x, stateBeforeInvoke(x));
 
         XirSnippet snippet = null;
 
@@ -522,11 +541,11 @@
         if (destinationAddress instanceof CiConstant) {
             // Direct call
             assert ((CiConstant) destinationAddress).isDefaultValue() : "destination address should be zero";
-            lir.callDirect(target, resultOperand, argList, info, snippet.marks, pointerSlots);
+            lir.callDirect(target, resultOperand, argList, info2, snippet.marks, pointerSlots);
         } else {
             // Indirect call
             argList.add(destinationAddress);
-            lir.callIndirect(target, resultOperand, argList, info, snippet.marks, pointerSlots);
+            lir.callIndirect(target, resultOperand, argList, info2, snippet.marks, pointerSlots);
         }
 
         if (resultOperand.isLegal()) {