changeset 6476:64d6e2343a68

removed CallPositionListener, another XIR remnant
author Doug Simon <doug.simon@oracle.com>
date Mon, 01 Oct 2012 22:38:44 +0200
parents 67b94a9fba57
children d93bff9fecb6
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64DirectCallOp.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64IndirectCallOp.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java
diffstat 6 files changed, 13 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Mon Oct 01 22:10:47 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Mon Oct 01 22:38:44 2012 +0200
@@ -40,7 +40,6 @@
 import com.oracle.graal.lir.StandardOp.JumpOp;
 import com.oracle.graal.lir.StandardOp.LabelOp;
 import com.oracle.graal.lir.StandardOp.ParametersOp;
-import com.oracle.graal.lir.asm.TargetMethodAssembler.CallPositionListener;
 import com.oracle.graal.lir.cfg.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.PhiNode.PhiType;
@@ -725,7 +724,7 @@
 
     protected abstract void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, LIRFrameState callState);
 
-    protected abstract void emitCall(Object targetMethod, Value result, List<Value> arguments, Value targetAddress, LIRFrameState info, CallPositionListener ecl);
+    protected abstract void emitCall(Object targetMethod, Value result, List<Value> arguments, Value targetAddress, LIRFrameState info);
 
     private static Value toStackKind(Value value) {
         if (value.getKind().stackKind() != value.getKind()) {
@@ -777,7 +776,7 @@
         }
         List<Value> argumentList = Arrays.asList(argLocations);
 
-        emitCall(target, cc.getReturn(), argumentList, Constant.forLong(0), info, null);
+        emitCall(target, cc.getReturn(), argumentList, Constant.forLong(0), info);
 
         if (isLegal(cc.getReturn())) {
             return emitMove(cc.getReturn());
@@ -821,7 +820,7 @@
             info = state();
         }
 
-        emitCall(x.call(), resultOperand, argList, Constant.forLong(0), info, null);
+        emitCall(x.call(), resultOperand, argList, Constant.forLong(0), info);
 
         if (isLegal(resultOperand)) {
             setResult(x, emitMove(resultOperand));
@@ -973,7 +972,7 @@
         }
         List<Value> argumentList = Arrays.asList(argLocations);
 
-        emitCall(runtimeCall, cc.getReturn(), argumentList, Constant.forLong(0), info, null);
+        emitCall(runtimeCall, cc.getReturn(), argumentList, Constant.forLong(0), info);
 
         return cc.getReturn();
     }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Mon Oct 01 22:10:47 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Mon Oct 01 22:38:44 2012 +0200
@@ -64,7 +64,6 @@
 import com.oracle.graal.lir.amd64.AMD64Move.NullCheckOp;
 import com.oracle.graal.lir.amd64.AMD64Move.SpillMoveOp;
 import com.oracle.graal.lir.amd64.AMD64Move.StoreOp;
-import com.oracle.graal.lir.asm.TargetMethodAssembler.CallPositionListener;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.calc.*;
 import com.oracle.graal.nodes.extended.*;
@@ -547,7 +546,7 @@
 
     @Override
     protected void emitDirectCall(DirectCallTargetNode callTarget, Value result, Value[] parameters, LIRFrameState callState) {
-        append(new DirectCallOp(callTarget.target(), result, parameters, callState, null));
+        append(new DirectCallOp(callTarget.target(), result, parameters, callState));
     }
 
     @Override
@@ -555,15 +554,15 @@
         // The current register allocator cannot handle variables at call sites, need a fixed register.
         Value targetAddress = AMD64.rax.asValue();
         emitMove(operand(callTarget.computedAddress()), targetAddress);
-        append(new IndirectCallOp(callTarget.target(), result, parameters, targetAddress, callState, null));
+        append(new IndirectCallOp(callTarget.target(), result, parameters, targetAddress, callState));
     }
 
     @Override
-    protected void emitCall(Object targetMethod, Value result, List<Value> arguments, Value targetAddress, LIRFrameState info, CallPositionListener cpl) {
+    protected void emitCall(Object targetMethod, Value result, List<Value> arguments, Value targetAddress, LIRFrameState info) {
         if (isConstant(targetAddress)) {
-            append(new DirectCallOp(targetMethod, result, arguments.toArray(new Value[arguments.size()]), info, cpl));
+            append(new DirectCallOp(targetMethod, result, arguments.toArray(new Value[arguments.size()]), info));
         } else {
-            append(new IndirectCallOp(targetMethod, result, arguments.toArray(new Value[arguments.size()]), targetAddress, info, cpl));
+            append(new IndirectCallOp(targetMethod, result, arguments.toArray(new Value[arguments.size()]), targetAddress, info));
         }
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64DirectCallOp.java	Mon Oct 01 22:10:47 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64DirectCallOp.java	Mon Oct 01 22:38:44 2012 +0200
@@ -59,7 +59,7 @@
     private final InvokeKind invokeKind;
 
     AMD64DirectCallOp(Object targetMethod, Value result, Value[] parameters, LIRFrameState state, InvokeKind invokeKind, LIR lir) {
-        super(targetMethod, result, parameters, state, null);
+        super(targetMethod, result, parameters, state);
         this.invokeKind = invokeKind;
 
         if (invokeKind == Static || invokeKind == Special) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64IndirectCallOp.java	Mon Oct 01 22:10:47 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64IndirectCallOp.java	Mon Oct 01 22:38:44 2012 +0200
@@ -52,7 +52,7 @@
     @Use({REG}) protected Value methodOop;
 
     AMD64IndirectCallOp(Object targetMethod, Value result, Value[] parameters, Value methodOop, Value targetAddress, LIRFrameState state) {
-        super(targetMethod, result, parameters, targetAddress, state, null);
+        super(targetMethod, result, parameters, targetAddress, state);
         this.methodOop = methodOop;
     }
 
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java	Mon Oct 01 22:10:47 2012 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java	Mon Oct 01 22:38:44 2012 +0200
@@ -30,7 +30,6 @@
 import com.oracle.graal.lir.*;
 import com.oracle.graal.lir.LIRInstruction.Opcode;
 import com.oracle.graal.lir.asm.*;
-import com.oracle.graal.lir.asm.TargetMethodAssembler.CallPositionListener;
 import com.oracle.max.asm.target.amd64.*;
 
 public class AMD64Call {
@@ -42,29 +41,17 @@
         @State protected LIRFrameState state;
 
         protected final Object targetMethod;
-        protected final CallPositionListener callPositionListener;
 
-        public DirectCallOp(Object targetMethod, Value result, Value[] parameters, LIRFrameState state, CallPositionListener callPositionListener) {
+        public DirectCallOp(Object targetMethod, Value result, Value[] parameters, LIRFrameState state) {
             this.targetMethod = targetMethod;
             this.result = result;
             this.parameters = parameters;
             this.state = state;
-            this.callPositionListener = callPositionListener;
         }
 
         @Override
         public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            if (callPositionListener != null) {
-                callPositionListener.beforeCall(tasm);
-            }
-
             emitAlignmentForDirectCall(tasm, masm);
-
-            if (callPositionListener != null) {
-                int pos = masm.codeBuffer.position();
-                callPositionListener.atCall(tasm);
-                assert pos == masm.codeBuffer.position() : "call position listener inserted code before an aligned call";
-            }
             directCall(tasm, masm, targetMethod, state);
         }
 
@@ -86,23 +73,17 @@
         @State protected LIRFrameState state;
 
         protected final Object targetMethod;
-        protected final CallPositionListener callPositionListener;
 
-        public IndirectCallOp(Object targetMethod, Value result, Value[] parameters, Value targetAddress, LIRFrameState state, CallPositionListener callPositionListener) {
+        public IndirectCallOp(Object targetMethod, Value result, Value[] parameters, Value targetAddress, LIRFrameState state) {
             this.targetMethod = targetMethod;
             this.result = result;
             this.parameters = parameters;
             this.targetAddress = targetAddress;
             this.state = state;
-            this.callPositionListener = callPositionListener;
         }
 
         @Override
         public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            if (callPositionListener != null) {
-                callPositionListener.beforeCall(tasm);
-                callPositionListener.atCall(tasm);
-            }
             indirectCall(tasm, masm, asRegister(targetAddress), targetMethod, state);
         }
 
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Mon Oct 01 22:10:47 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Mon Oct 01 22:38:44 2012 +0200
@@ -36,25 +36,6 @@
 
 public class TargetMethodAssembler {
 
-    /**
-     * A client interested in knowing the position(s) associated with a call instruction.
-     */
-    public interface CallPositionListener {
-        /**
-         * Notifies this listener that the code buffer is at the position before any alignment
-         * instructions are emitted for a call. This listener can safely emit instructions into
-         * the code buffer as the alignment has not yet been computed.
-         */
-        void beforeCall(TargetMethodAssembler tasm);
-
-        /**
-         * Notifies this listener that the code buffer is at the position after alignment
-         * instruction have been emitted but before the call instruction has been emitted.
-         * This listener must not emit instructions at this position.
-         */
-        void atCall(TargetMethodAssembler tasm);
-    }
-
     private static class ExceptionInfo {
         public final int codeOffset;
         public final LabelRef exceptionEdge;