changeset 22380:a156caa3116b

LinearScan: adopt visibility.
author Josef Eisl <josef.eisl@jku.at>
date Tue, 28 Jul 2015 17:18:16 +0200
parents 9c5c205f6caf
children d30a4636ded2
files graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/Interval.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScan.java
diffstat 4 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/Interval.java	Tue Jul 28 15:16:58 2015 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/Interval.java	Tue Jul 28 17:18:16 2015 +0200
@@ -568,7 +568,7 @@
         return kind;
     }
 
-    void setKind(LIRKind kind) {
+    public void setKind(LIRKind kind) {
         assert isRegister(operand) || this.kind().equals(LIRKind.Illegal) || this.kind().equals(kind) : "overwriting existing type";
         this.kind = kind;
     }
@@ -738,7 +738,7 @@
     /**
      * Sets the value which is used for re-materialization.
      */
-    void addMaterializationValue(JavaConstant value) {
+    public void addMaterializationValue(JavaConstant value) {
         if (numMaterializationValuesAdded == 0) {
             materializedValue = value;
         } else {
@@ -1025,8 +1025,8 @@
         return prev;
     }
 
-    void addUsePos(int pos, RegisterPriority registerPriority) {
-        assert covers(pos, LIRInstruction.OperandMode.USE) : "use position not covered by live range";
+    public void addUsePos(int pos, RegisterPriority registerPriority) {
+        assert covers(pos, LIRInstruction.OperandMode.USE) : String.format("use position %d not covered by live range of interval %s", pos, this);
 
         // do not add use positions for precolored intervals because they are never used
         if (registerPriority != RegisterPriority.None && isVariable(operand)) {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java	Tue Jul 28 15:16:58 2015 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java	Tue Jul 28 17:18:16 2015 +0200
@@ -256,7 +256,7 @@
      * Gets an object describing the attributes of a given register according to this register
      * configuration.
      */
-    RegisterAttributes attributes(Register reg) {
+    public RegisterAttributes attributes(Register reg) {
         return registerAttributes[reg.number];
     }
 
@@ -442,7 +442,7 @@
         abstract boolean apply(Interval i);
     }
 
-    boolean isProcessed(Value operand) {
+    public boolean isProcessed(Value operand) {
         return !isRegister(operand) || attributes(asRegister(operand)).isAllocatable();
     }
 
@@ -680,7 +680,7 @@
         return new LinearScanAssignLocationsPhase(this);
     }
 
-    protected void printIntervals(String label) {
+    public void printIntervals(String label) {
         if (Debug.isLogEnabled()) {
             try (Indent indent = Debug.logAndIndent("intervals %s", label)) {
                 for (Interval interval : intervals) {
@@ -700,7 +700,7 @@
         Debug.dump(Arrays.copyOf(intervals, intervalsSize), label);
     }
 
-    protected void printLir(String label, @SuppressWarnings("unused") boolean hirValid) {
+    public void printLir(String label, @SuppressWarnings("unused") boolean hirValid) {
         Debug.dump(ir, label);
     }
 
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java	Tue Jul 28 15:16:58 2015 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java	Tue Jul 28 17:18:16 2015 +0200
@@ -84,7 +84,7 @@
      * Numbers all instructions in all blocks. The numbering follows the
      * {@linkplain ComputeBlockOrder linear scan order}.
      */
-    void numberInstructions() {
+    protected void numberInstructions() {
 
         allocator.initIntervals();
 
@@ -450,7 +450,7 @@
         }
     }
 
-    void addUse(AllocatableValue operand, int from, int to, RegisterPriority registerPriority, LIRKind kind) {
+    protected void addUse(AllocatableValue operand, int from, int to, RegisterPriority registerPriority, LIRKind kind) {
         if (!allocator.isProcessed(operand)) {
             return;
         }
@@ -470,7 +470,7 @@
         }
     }
 
-    void addTemp(AllocatableValue operand, int tempPos, RegisterPriority registerPriority, LIRKind kind) {
+    protected void addTemp(AllocatableValue operand, int tempPos, RegisterPriority registerPriority, LIRKind kind) {
         if (!allocator.isProcessed(operand)) {
             return;
         }
@@ -489,7 +489,7 @@
         }
     }
 
-    void addDef(AllocatableValue operand, LIRInstruction op, RegisterPriority registerPriority, LIRKind kind) {
+    protected void addDef(AllocatableValue operand, LIRInstruction op, RegisterPriority registerPriority, LIRKind kind) {
         if (!allocator.isProcessed(operand)) {
             return;
         }
@@ -654,7 +654,7 @@
      * Determines the priority which with an instruction's input operand will be allocated a
      * register.
      */
-    private static RegisterPriority registerPriorityOfInputOperand(EnumSet<OperandFlag> flags) {
+    protected static RegisterPriority registerPriorityOfInputOperand(EnumSet<OperandFlag> flags) {
         if (flags.contains(OperandFlag.STACK)) {
             return RegisterPriority.ShouldHaveRegister;
         }
@@ -811,7 +811,7 @@
      *         reload-locations in case the interval of this instruction is spilled. Currently this
      *         can only be a {@link JavaConstant}.
      */
-    static JavaConstant getMaterializedValue(LIRInstruction op, Value operand, Interval interval) {
+    protected static JavaConstant getMaterializedValue(LIRInstruction op, Value operand, Interval interval) {
         if (op instanceof MoveOp) {
             MoveOp move = (MoveOp) op;
             if (move.getInput() instanceof JavaConstant) {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScan.java	Tue Jul 28 15:16:58 2015 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScan.java	Tue Jul 28 17:18:16 2015 +0200
@@ -110,14 +110,14 @@
     }
 
     @Override
-    protected void printIntervals(String label) {
+    public void printIntervals(String label) {
         if (Debug.isDumpEnabled(TraceRegisterAllocationPhase.TRACE_DUMP_LEVEL)) {
             super.printIntervals(label);
         }
     }
 
     @Override
-    protected void printLir(String label, boolean hirValid) {
+    public void printLir(String label, boolean hirValid) {
         if (Debug.isDumpEnabled(TraceRegisterAllocationPhase.TRACE_DUMP_LEVEL)) {
             Debug.dump(TraceRegisterAllocationPhase.TRACE_DUMP_LEVEL, sortedBlocks(), label);
         }