# HG changeset patch # User Christos Kotselidis # Date 1370862278 -7200 # Node ID 8369c5780c7733afce47e5835f5107c7e6502964 # Parent 70ffc60dbce76186eedd416a0e7eb3f85ab8c38b Refactoring diff -r 70ffc60dbce7 -r 8369c5780c77 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon Jun 10 12:40:36 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon Jun 10 13:04:38 2013 +0200 @@ -461,7 +461,6 @@ RegisterValue raxRes = AMD64.rax.asValue(kind); emitMove(raxRes, expected); if (runtime().config.useCompressedOops && node.compress()) { - assert kind == Kind.Object; Variable scratch = newVariable(Kind.Long); append(new CompareAndSwapCompressedOp(raxRes, address, raxRes, newValue, scratch, runtime().config.narrowOopBase, runtime().config.narrowOopShift, runtime().config.logMinObjAlignment)); } else { diff -r 70ffc60dbce7 -r 8369c5780c77 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Mon Jun 10 12:40:36 2013 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Mon Jun 10 13:04:38 2013 +0200 @@ -423,6 +423,7 @@ this.address = address; this.cmpValue = cmpValue; this.newValue = newValue; + assert cmpValue.getKind() == Kind.Object; } @Override @@ -643,23 +644,16 @@ protected static void compareAndSwapCompressed(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AllocatableValue result, AMD64AddressValue address, AllocatableValue cmpValue, AllocatableValue newValue, AllocatableValue scratch, long narrowOopBase, int narrowOopShift, int logMinObjAlignment) { assert asRegister(cmpValue) == AMD64.rax && asRegister(result) == AMD64.rax; - - switch (cmpValue.getKind()) { - case Object: - final Register scratchRegister = asRegister(scratch); - final Register cmpRegister = asRegister(cmpValue); - final Register newRegister = asRegister(newValue); - encodeOop(masm, cmpRegister, narrowOopBase, narrowOopShift, logMinObjAlignment); - masm.movq(scratchRegister, newRegister); - encodeOop(masm, scratchRegister, narrowOopBase, narrowOopShift, logMinObjAlignment); - if (tasm.target.isMP) { - masm.lock(); - } - masm.cmpxchgl(scratchRegister, address.toAddress()); - break; - default: - throw GraalInternalError.shouldNotReachHere(); + final Register scratchRegister = asRegister(scratch); + final Register cmpRegister = asRegister(cmpValue); + final Register newRegister = asRegister(newValue); + encodeOop(masm, cmpRegister, narrowOopBase, narrowOopShift, logMinObjAlignment); + masm.movq(scratchRegister, newRegister); + encodeOop(masm, scratchRegister, narrowOopBase, narrowOopShift, logMinObjAlignment); + if (tasm.target.isMP) { + masm.lock(); } + masm.cmpxchgl(scratchRegister, address.toAddress()); } private static void encodeOop(AMD64MacroAssembler masm, Register scratchRegister, long narrowOopBase, int narrowOopShift, int logMinObjAlignment) {