# HG changeset patch # User Stefan Anzinger # Date 1418769389 -3600 # Node ID 28e46ea20c93654797e550c3be35cd69e23b8f08 # Parent a4fbcdce06c8691a3be6750bca3fdc7c8ae1641d [SPARC] Attempt to fix the NullPointerException problem diff -r a4fbcdce06c8 -r 28e46ea20c93 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Mon Dec 15 19:32:12 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Tue Dec 16 23:36:29 2014 +0100 @@ -313,8 +313,7 @@ for (int i = instructions.size() - 1; i >= 0; i--) { LIRInstruction inst = instructions.get(i); boolean adjacent = delayTransferPosition - i == 1; - - if ((!adjacent && inst.hasState()) || inst.destroysCallerSavedRegisters() || leavesRegisterWindow(inst)) { + if (!adjacent || inst.destroysCallerSavedRegisters() || leavesRegisterWindow(inst)) { delayedTransfer = null; } if (inst instanceof SPARCDelayedControlTransfer) { @@ -327,11 +326,12 @@ // We have found a non overlapping LIR instruction which can be delayed ((SPARCTailDelayedLIRInstruction) inst).setDelayedControlTransfer(delayedTransfer); delayedTransfer = null; - if (!adjacent) { - // If not adjacent, we make it adjacent - instructions.remove(i); - instructions.add(delayTransferPosition - 1, inst); - } + // Removed the moving as it causes problems (Nullpointer exceptions) + // if (!adjacent) { + // // If not adjacent, we make it adjacent + // instructions.remove(i); + // instructions.add(delayTransferPosition - 1, inst); + // } } } }