Skip to content

Commit b76058d

Browse files
committed
[GR-43100] Increase coverage in org.graalvm.compiler.lir.
PullRequest: graal/13401
2 parents 8f171d2 + e202150 commit b76058d

27 files changed

+26
-1185
lines changed

compiler/src/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

compiler/src/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java

Lines changed: 0 additions & 48 deletions
This file was deleted.

compiler/src/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotConstantRetrievalOp.java

Lines changed: 0 additions & 125 deletions
This file was deleted.

compiler/src/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it

compiler/src/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
2828
import java.lang.annotation.Retention;
2929
import java.lang.annotation.RetentionPolicy;
3030
import java.lang.annotation.Target;
31-
import java.util.EnumSet;
3231

3332
import org.graalvm.compiler.lir.LIRInstruction.OperandFlag;
3433
import org.graalvm.compiler.lir.LIRInstruction.OperandMode;
@@ -66,32 +65,6 @@ public CompositeValue(ValueKind<?> kind) {
6665
*/
6766
public abstract CompositeValue forEachComponent(LIRInstruction inst, OperandMode mode, InstructionValueProcedure proc);
6867

69-
/**
70-
* A helper method to visit {@link Value}[] ensuring that a copy of the array is made if it's
71-
* needed.
72-
*
73-
* @param inst
74-
* @param values
75-
* @param mode
76-
* @param proc
77-
* @param flags
78-
* @return the original {@code values} array or a copy if values changed
79-
*/
80-
protected Value[] visitValueArray(LIRInstruction inst, Value[] values, OperandMode mode, InstructionValueProcedure proc, EnumSet<OperandFlag> flags) {
81-
Value[] newValues = null;
82-
for (int i = 0; i < values.length; i++) {
83-
Value value = values[i];
84-
Value newValue = proc.doValue(inst, value, mode, flags);
85-
if (!value.identityEquals(newValue)) {
86-
if (newValues == null) {
87-
newValues = values.clone();
88-
}
89-
newValues[i] = value;
90-
}
91-
}
92-
return newValues != null ? newValues : values;
93-
}
94-
9568
protected abstract void visitEachComponent(LIRInstruction inst, OperandMode mode, InstructionValueConsumer proc);
9669

9770
@Override

compiler/src/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -207,21 +207,6 @@ public String toString() {
207207
return str.toString();
208208
}
209209

210-
Values getValues(OperandMode mode) {
211-
switch (mode) {
212-
case USE:
213-
return uses;
214-
case ALIVE:
215-
return alives;
216-
case TEMP:
217-
return temps;
218-
case DEF:
219-
return defs;
220-
default:
221-
throw GraalError.shouldNotReachHere("unknown OperandMode: " + mode);
222-
}
223-
}
224-
225210
final String getOpcode(LIRInstruction obj) {
226211
if (opcodeConstant != null) {
227212
return opcodeConstant;

compiler/src/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -162,29 +162,4 @@ private static List<Register> collectRegisters(Object[] values, List<Register> r
162162
}
163163
return registers;
164164
}
165-
166-
/**
167-
* Subtract sets of registers (x - y).
168-
*
169-
* @param x a set of register to subtract from.
170-
* @param y a set of registers to subtract.
171-
* @return resulting set of registers (x - y).
172-
*/
173-
public static Value[] subtractRegisters(Value[] x, Value[] y) {
174-
ArrayList<Value> result = new ArrayList<>(x.length);
175-
for (Value i : x) {
176-
boolean append = true;
177-
for (Value j : y) {
178-
if (sameRegister(i, j)) {
179-
append = false;
180-
break;
181-
}
182-
}
183-
if (append) {
184-
result.add(i);
185-
}
186-
}
187-
Value[] resultArray = new Value[result.size()];
188-
return result.toArray(resultArray);
189-
}
190165
}

compiler/src/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -40,8 +40,6 @@ public class Variable extends AllocatableValue {
4040
*/
4141
public final int index;
4242

43-
private String name;
44-
4543
/**
4644
* Creates a new variable.
4745
*
@@ -54,21 +52,9 @@ public Variable(ValueKind<?> kind, int index) {
5452
this.index = index;
5553
}
5654

57-
public void setName(String name) {
58-
this.name = name;
59-
}
60-
61-
public String getName() {
62-
return name;
63-
}
64-
6555
@Override
6656
public String toString() {
67-
if (name != null) {
68-
return name;
69-
} else {
70-
return "v" + index + getKindSuffix();
71-
}
57+
return "v" + index + getKindSuffix();
7258
}
7359

7460
@Override

0 commit comments

Comments
 (0)