Mercurial > hg > graal-compiler
changeset 21246:b2b3c514a391
MoveResolver: don't call check from constructor.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Tue, 05 May 2015 16:24:39 +0200 |
parents | a2430e146460 |
children | 6a00c1217310 |
files | 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/MoveResolver.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScan.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSAMoveResolver.java |
diffstat | 4 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Thu Apr 30 15:39:11 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Tue May 05 16:24:39 2015 +0200 @@ -202,7 +202,9 @@ } protected MoveResolver createMoveResolver() { - return new MoveResolver(this); + MoveResolver moveResolver = new MoveResolver(this); + assert moveResolver.checkEmpty(); + return moveResolver; } public static boolean isVariableOrRegister(Value value) {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/MoveResolver.java Thu Apr 30 15:39:11 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/MoveResolver.java Tue May 05 16:24:39 2015 +0200 @@ -90,7 +90,6 @@ this.insertIdx = -1; this.insertionBuffer = new LIRInsertionBuffer(); this.registerBlocked = new int[allocator.registers.length]; - assert checkEmpty(); } boolean checkEmpty() {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScan.java Thu Apr 30 15:39:11 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScan.java Tue May 05 16:24:39 2015 +0200 @@ -54,7 +54,9 @@ @Override protected MoveResolver createMoveResolver() { - return new SSAMoveResolver(this); + SSAMoveResolver moveResolver = new SSAMoveResolver(this); + assert moveResolver.checkEmpty(); + return moveResolver; } @Override
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSAMoveResolver.java Thu Apr 30 15:39:11 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSAMoveResolver.java Tue May 05 16:24:39 2015 +0200 @@ -32,7 +32,7 @@ final class SSAMoveResolver extends MoveResolver { - private int[] stackBlocked = null; + private int[] stackBlocked; SSAMoveResolver(LinearScan allocator) { super(allocator); @@ -41,10 +41,8 @@ @Override boolean checkEmpty() { - if (stackBlocked != null) { - for (int i = 0; i < stackBlocked.length; i++) { - assert stackBlocked[i] == 0 : "stack map must be empty before and after processing"; - } + for (int i = 0; i < stackBlocked.length; i++) { + assert stackBlocked[i] == 0 : "stack map must be empty before and after processing"; } return super.checkEmpty(); }