# HG changeset patch # User Christian Haeubl # Date 1353936768 -3600 # Node ID 5a3e048620d4dbf225d47945b8462df24f847fcf # Parent b7da4418a7c3b89954a9b098cb7b622f984b664a fix to avoid emitting a range switch for non-integer keys fix for reading a value from a metadata object diff -r b7da4418a7c3 -r 5a3e048620d4 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java --- 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; } } } diff -r b7da4418a7c3 -r 5a3e048620d4 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- 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;