src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java Tue Mar 12 12:12:01 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java Tue Mar 12 19:17:42 2019 +0100
@@ -176,7 +176,7 @@
ValueConsumer useConsumer = (operand, mode, flags) -> {
if (isVariable(operand)) {
- int operandNum = allocator.operandNumber(operand);
+ int operandNum = getOperandNumber(operand);
if (!liveKillScratch.get(operandNum)) {
liveGenScratch.set(operandNum);
if (debug.isLogEnabled()) {
@@ -194,7 +194,7 @@
};
ValueConsumer stateConsumer = (operand, mode, flags) -> {
if (LinearScan.isVariableOrRegister(operand)) {
- int operandNum = allocator.operandNumber(operand);
+ int operandNum = getOperandNumber(operand);
if (!liveKillScratch.get(operandNum)) {
liveGenScratch.set(operandNum);
if (debug.isLogEnabled()) {
@@ -205,7 +205,7 @@
};
ValueConsumer defConsumer = (operand, mode, flags) -> {
if (isVariable(operand)) {
- int varNum = allocator.operandNumber(operand);
+ int varNum = getOperandNumber(operand);
liveKillScratch.set(varNum);
if (debug.isLogEnabled()) {
debug.log("liveKill for operand %d(%s)", varNum, operand);
@@ -268,7 +268,7 @@
*/
if (isRegister(operand)) {
if (allocator.isProcessed(operand)) {
- liveKill.set(allocator.operandNumber(operand));
+ liveKill.set(getOperandNumber(operand));
}
}
}
@@ -281,11 +281,15 @@
*/
if (isRegister(operand) && block != allocator.getLIR().getControlFlowGraph().getStartBlock()) {
if (allocator.isProcessed(operand)) {
- assert liveKill.get(allocator.operandNumber(operand)) : "using fixed register " + asRegister(operand) + " that is not defined in this block " + block;
+ assert liveKill.get(getOperandNumber(operand)) : "using fixed register " + asRegister(operand) + " that is not defined in this block " + block;
}
}
}
+ protected int getOperandNumber(Value operand) {
+ return allocator.operandNumber(operand);
+ }
+
/**
* Performs a backward dataflow analysis to compute global live sets (i.e.
* {@link BlockData#liveIn} and {@link BlockData#liveOut}) for each block.