Mercurial > hg > graal-compiler
changeset 7072:5a3e048620d4
fix to avoid emitting a range switch for non-integer keys
fix for reading a value from a metadata object
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Mon, 26 Nov 2012 14:32:48 +0100 |
parents | b7da4418a7c3 |
children | ea39031737cf |
files | graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Mon Nov 26 11:02:50 2012 +0100 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Mon Nov 26 14:32:48 2012 +0100 @@ -149,6 +149,10 @@ if (NumUtil.isInt(newDisplacement)) { displacement = (int) newDisplacement; base = Value.ILLEGAL; + } else { + Value newBase = newVariable(Kind.Long); + emitMove(base, newBase); + base = newBase; } } }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Mon Nov 26 11:02:50 2012 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Mon Nov 26 14:32:48 2012 +0100 @@ -841,8 +841,8 @@ } else { Variable value = load(operand(x.value())); LabelRef defaultTarget = x.defaultSuccessor() == null ? null : getLIRBlock(x.defaultSuccessor()); - if (value.getKind() == Kind.Object) { - // only a few entries + if (value.getKind() != Kind.Int) { + // hopefully only a few entries emitSequentialSwitch(x, value, defaultTarget); } else { assert value.getKind() == Kind.Int;