# HG changeset patch # User Christos Kotselidis # Date 1375459527 -7200 # Node ID d2187f88cdd2d68c2467282dd14451fc760150d9 # Parent 8ede7cd7318e2883f5f27e74b746adb9e1428293 Minor refactoring diff -r 8ede7cd7318e -r d2187f88cdd2 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Fri Aug 02 17:00:40 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Fri Aug 02 18:05:27 2013 +0200 @@ -160,18 +160,17 @@ Object fixedValue = FixedValueAnchorNode.getObject(value); verifyOop(fixedObject); verifyOop(fixedValue); - Word oop = (Word) Word.fromObject(fixedObject); - Word field; + Word oop; if (usePrecise) { - field = (Word) Word.fromArray(fixedObject, location); + oop = (Word) Word.fromArray(fixedObject, location); } else { - field = oop; + oop = (Word) Word.fromObject(fixedObject); } int gcCycle = 0; if (trace) { gcCycle = (int) Word.unsigned(HotSpotReplacementsUtil.gcTotalCollectionsAddress()).readLong(0); log(trace, "[%d] G1-Post Thread: %p Object: %p\n", gcCycle, thread.rawValue(), Word.fromObject(fixedObject).rawValue()); - log(trace, "[%d] G1-Post Thread: %p Field: %p\n", gcCycle, thread.rawValue(), field.rawValue()); + log(trace, "[%d] G1-Post Thread: %p Field: %p\n", gcCycle, thread.rawValue(), oop.rawValue()); } Word writtenValue = (Word) Word.fromObject(fixedValue); Word bufferAddress = thread.readWord(g1CardQueueBufferOffset()); @@ -179,11 +178,11 @@ Word indexValue = thread.readWord(g1CardQueueIndexOffset()); // The result of the xor reveals whether the installed pointer crosses heap regions. // In case it does the write barrier has to be issued. - Word xorResult = (field.xor(writtenValue)).unsignedShiftRight(logOfHeapRegionGrainBytes()); + Word xorResult = (oop.xor(writtenValue)).unsignedShiftRight(logOfHeapRegionGrainBytes()); // Calculate the address of the card to be enqueued to the // thread local card queue. - Word cardBase = field.unsignedShiftRight(cardTableShift()); + Word cardBase = oop.unsignedShiftRight(cardTableShift()); long startAddress = cardTableStart(); int displacement = 0; if (((int) startAddress) == startAddress) {