Mercurial > hg > truffle
diff graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java @ 15910:79a0d9065849
Support direct comparison of compressed pointers.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Mon, 26 May 2014 16:13:58 +0200 |
parents | e43591136d9f |
children | af0e42dad358 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon May 26 16:09:53 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon May 26 16:13:58 2014 +0200 @@ -643,6 +643,26 @@ } @Override + protected void emitCompareOp(PlatformKind cmpKind, Variable left, Value right) { + if (right instanceof HotSpotConstant) { + append(new AMD64HotSpotCompare.HotSpotCompareConstantOp(left, (Constant) right)); + } else if (cmpKind == NarrowOopStamp.NarrowOop) { + append(new AMD64HotSpotCompare.HotSpotCompareNarrowOp(left, asAllocatable(right))); + } else { + super.emitCompareOp(cmpKind, left, right); + } + } + + @Override + protected void emitCompareMemoryConOp(Kind kind, AMD64AddressValue address, Constant value, LIRFrameState state) { + if (value instanceof HotSpotConstant) { + append(new AMD64HotSpotCompare.HotSpotCompareMemoryConstantOp(kind, address, value, state)); + } else { + super.emitCompareMemoryConOp(kind, address, value, state); + } + } + + @Override public boolean canInlineConstant(Constant c) { if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) { return true;