comparison graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java @ 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 7d815d842ee0
children e23980f4a890
comparison
equal deleted inserted replaced
7071:b7da4418a7c3 7072:5a3e048620d4
839 if (keyCount == 0) { 839 if (keyCount == 0) {
840 emitJump(getLIRBlock(x.defaultSuccessor()), null); 840 emitJump(getLIRBlock(x.defaultSuccessor()), null);
841 } else { 841 } else {
842 Variable value = load(operand(x.value())); 842 Variable value = load(operand(x.value()));
843 LabelRef defaultTarget = x.defaultSuccessor() == null ? null : getLIRBlock(x.defaultSuccessor()); 843 LabelRef defaultTarget = x.defaultSuccessor() == null ? null : getLIRBlock(x.defaultSuccessor());
844 if (value.getKind() == Kind.Object) { 844 if (value.getKind() != Kind.Int) {
845 // only a few entries 845 // hopefully only a few entries
846 emitSequentialSwitch(x, value, defaultTarget); 846 emitSequentialSwitch(x, value, defaultTarget);
847 } else { 847 } else {
848 assert value.getKind() == Kind.Int; 848 assert value.getKind() == Kind.Int;
849 long valueRange = x.keyAt(keyCount - 1).asLong() - x.keyAt(0).asLong() + 1; 849 long valueRange = x.keyAt(keyCount - 1).asLong() - x.keyAt(0).asLong() + 1;
850 int switchRangeCount = switchRangeCount(x); 850 int switchRangeCount = switchRangeCount(x);