# HG changeset patch # User Thomas Wuerthinger # Date 1426292900 -3600 # Node ID 3d0116ec99c5d6519d633f232d53b2ef0fac5e08 # Parent 4264619519389fbdd0a4ab144fc522924468aafb Create utilities LocationIdentity#isAny, LocationIdentity#isSingle, LocationIdentity#any, LocationIdentity#overlaps. diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallsProvider.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallsProvider.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallsProvider.java Sat Mar 14 01:28:20 2015 +0100 @@ -37,8 +37,8 @@ /** * Gets the set of memory locations killed by a given foreign call. Returning the special value - * {@link LocationIdentity#ANY_LOCATION} denotes that the call kills all memory locations. - * Returning any empty array denotes that the call does not kill any memory locations. + * {@link LocationIdentity#any()} denotes that the call kills all memory locations. Returning + * any empty array denotes that the call does not kill any memory locations. */ LocationIdentity[] getKilledLocations(ForeignCallDescriptor descriptor); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java Sat Mar 14 01:28:20 2015 +0100 @@ -40,7 +40,7 @@ * analysis of memory accesses. A read from this location cannot be moved or coalesced with * other reads because its interaction with other reads is not known. */ - public static final LocationIdentity ANY_LOCATION = NamedLocationIdentity.mutable("ANY_LOCATION"); + private static final LocationIdentity ANY_LOCATION = NamedLocationIdentity.mutable("ANY_LOCATION"); /** * Denotes the location of a value that is guaranteed to be unchanging. @@ -52,15 +52,37 @@ */ public static final LocationIdentity ARRAY_LENGTH_LOCATION = NamedLocationIdentity.immutable("[].length"); + protected final boolean immutable; + + public static LocationIdentity any() { + return ANY_LOCATION; + } + + protected LocationIdentity(boolean immutable) { + this.immutable = immutable; + } + /** * Denotes a location is unchanging in all cases. Not that this is different than the Java * notion of final which only requires definite assignment. */ - public boolean isImmutable() { - return false; + public final boolean isImmutable() { + return immutable; + } + + public final boolean isMutable() { + return !immutable; } - public boolean isMutable() { - return !isImmutable(); + public final boolean isAny() { + return this == ANY_LOCATION; + } + + public final boolean isSingle() { + return this != ANY_LOCATION; + } + + public final boolean overlaps(LocationIdentity other) { + return isAny() || other.isAny() || this.equals(other); } } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NamedLocationIdentity.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NamedLocationIdentity.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NamedLocationIdentity.java Sat Mar 14 01:28:20 2015 +0100 @@ -48,11 +48,9 @@ protected final String name; - protected final boolean immutable; - private NamedLocationIdentity(String name, boolean immutable) { + super(immutable); this.name = name; - this.immutable = immutable; } /** @@ -109,12 +107,7 @@ @Override public String toString() { - return name + (immutable ? ":immutable" : ":mutable"); - } - - @Override - public boolean isImmutable() { - return immutable; + return name + (isImmutable() ? ":immutable" : ":mutable"); } /** diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java Sat Mar 14 01:28:20 2015 +0100 @@ -59,8 +59,8 @@ RegisterValue exception = rax.asValue(LIRKind.reference(Kind.Object)); RegisterValue exceptionPc = rdx.asValue(LIRKind.value(word)); CallingConvention exceptionCc = new CallingConvention(0, ILLEGAL, exception, exceptionPc); - register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF_NOFP, null, exceptionCc, NOT_REEXECUTABLE, ANY_LOCATION)); - register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF_NOFP, exceptionCc, null, NOT_REEXECUTABLE, ANY_LOCATION)); + register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF_NOFP, null, exceptionCc, NOT_REEXECUTABLE, any())); + register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF_NOFP, exceptionCc, null, NOT_REEXECUTABLE, any())); if (PreferGraalStubs.getValue()) { link(new AMD64DeoptimizationStub(providers, target, config, registerStubCall(DEOPTIMIZATION_HANDLER, REEXECUTABLE, LEAF, NO_LOCATIONS))); @@ -69,7 +69,7 @@ if (config.useCRC32Intrinsics) { // This stub does callee saving - registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, ANY_LOCATION); + registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, any()); } super.initialize(providers, config); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java Sat Mar 14 01:28:20 2015 +0100 @@ -60,8 +60,8 @@ RegisterValue incomingExceptionPc = i1.asValue(LIRKind.value(word)); CallingConvention outgoingExceptionCc = new CallingConvention(0, ILLEGAL, outgoingException, outgoingExceptionPc); CallingConvention incomingExceptionCc = new CallingConvention(0, ILLEGAL, incomingException, incomingExceptionPc); - register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF_NOFP, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, ANY_LOCATION)); - register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF_NOFP, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, ANY_LOCATION)); + register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF_NOFP, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, any())); + register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF_NOFP, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, any())); if (PreferGraalStubs.getValue()) { link(new SPARCDeoptimizationStub(providers, target, registerStubCall(DEOPTIMIZATION_HANDLER, REEXECUTABLE, LEAF, NO_LOCATIONS))); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Sat Mar 14 01:28:20 2015 +0100 @@ -248,7 +248,7 @@ // compiled code entry as HotSpot does not guarantee they are final // values. int methodCompiledEntryOffset = runtime.getConfig().methodCompiledEntryOffset; - ReadNode compiledEntry = graph.add(new ReadNode(metaspaceMethod, graph.unique(new ConstantLocationNode(ANY_LOCATION, methodCompiledEntryOffset)), StampFactory.forKind(wordKind), + ReadNode compiledEntry = graph.add(new ReadNode(metaspaceMethod, graph.unique(new ConstantLocationNode(any(), methodCompiledEntryOffset)), StampFactory.forKind(wordKind), BarrierType.NONE)); loweredCallTarget = graph.add(new HotSpotIndirectCallTargetNode(metaspaceMethod, compiledEntry, parameters, invoke.asNode().stamp(), signature, callTarget.targetMethod(), @@ -359,7 +359,7 @@ for (OSRLocalNode osrLocal : graph.getNodes(OSRLocalNode.TYPE)) { int size = osrLocal.getKind().getSlotCount(); int offset = localsOffset - (osrLocal.index() + size - 1) * 8; - IndexedLocationNode location = graph.unique(new IndexedLocationNode(ANY_LOCATION, offset, ConstantNode.forLong(0, graph), 1)); + IndexedLocationNode location = graph.unique(new IndexedLocationNode(any(), offset, ConstantNode.forLong(0, graph), 1)); ReadNode load = graph.add(new ReadNode(buffer, location, osrLocal.stamp(), BarrierType.NONE)); osrLocal.replaceAndDelete(load); graph.addBeforeFixed(migrationEnd, load); @@ -444,7 +444,7 @@ // We use LocationNode.ANY_LOCATION for the reads that access the vtable // entry as HotSpot does not guarantee that this is a final value. Stamp methodStamp = MethodPointerStamp.method(); - ReadNode metaspaceMethod = graph.add(new ReadNode(hub, graph.unique(new ConstantLocationNode(ANY_LOCATION, vtableEntryOffset)), methodStamp, BarrierType.NONE)); + ReadNode metaspaceMethod = graph.add(new ReadNode(hub, graph.unique(new ConstantLocationNode(any(), vtableEntryOffset)), methodStamp, BarrierType.NONE)); return metaspaceMethod; } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Sat Mar 14 01:28:20 2015 +0100 @@ -151,21 +151,21 @@ registerForeignCall(ARITHMETIC_COS, c.arithmeticCosAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(ARITHMETIC_TAN, c.arithmeticTanAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(ARITHMETIC_POW, c.arithmeticPowAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS); - registerForeignCall(LOAD_AND_CLEAR_EXCEPTION, c.loadAndClearExceptionAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, ANY_LOCATION); + registerForeignCall(LOAD_AND_CLEAR_EXCEPTION, c.loadAndClearExceptionAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, any()); - registerForeignCall(EXCEPTION_HANDLER_FOR_PC, c.exceptionHandlerForPcAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, ANY_LOCATION); - registerForeignCall(EXCEPTION_HANDLER_FOR_RETURN_ADDRESS, c.exceptionHandlerForReturnAddressAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, ANY_LOCATION); - registerForeignCall(FETCH_UNROLL_INFO, c.deoptimizationFetchUnrollInfo, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, ANY_LOCATION); - registerForeignCall(NEW_ARRAY_C, c.newArrayAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, ANY_LOCATION); - registerForeignCall(NEW_INSTANCE_C, c.newInstanceAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, ANY_LOCATION); - registerForeignCall(UNCOMMON_TRAP, c.deoptimizationUncommonTrap, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, NOT_REEXECUTABLE, ANY_LOCATION); + registerForeignCall(EXCEPTION_HANDLER_FOR_PC, c.exceptionHandlerForPcAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, any()); + registerForeignCall(EXCEPTION_HANDLER_FOR_RETURN_ADDRESS, c.exceptionHandlerForReturnAddressAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, any()); + registerForeignCall(FETCH_UNROLL_INFO, c.deoptimizationFetchUnrollInfo, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, any()); + registerForeignCall(NEW_ARRAY_C, c.newArrayAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, any()); + registerForeignCall(NEW_INSTANCE_C, c.newInstanceAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, any()); + registerForeignCall(UNCOMMON_TRAP, c.deoptimizationUncommonTrap, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, NOT_REEXECUTABLE, any()); /* * We cannot use LEAF_SP here because on some architectures we have to align the stack * manually before calling into the VM. See {@link * AMD64HotSpotEnterUnpackFramesStackFrameOp#emitCode}. */ - registerForeignCall(UNPACK_FRAMES, c.deoptimizationUnpackFrames, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, ANY_LOCATION); + registerForeignCall(UNPACK_FRAMES, c.deoptimizationUnpackFrames, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, any()); /* * This message call is registered twice, where the second one must only be used for calls @@ -174,32 +174,32 @@ registerForeignCall(VM_MESSAGE_C, c.vmMessageAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(ASSERTION_VM_MESSAGE_C, c.vmMessageAddress, NativeCall, PRESERVES_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS); - link(new NewInstanceStub(providers, registerStubCall(NEW_INSTANCE, REEXECUTABLE, NOT_LEAF, ANY_LOCATION))); + link(new NewInstanceStub(providers, registerStubCall(NEW_INSTANCE, REEXECUTABLE, NOT_LEAF, any()))); link(new NewArrayStub(providers, registerStubCall(NEW_ARRAY, REEXECUTABLE, NOT_LEAF, INIT_LOCATION))); link(new ExceptionHandlerStub(providers, foreignCalls.get(EXCEPTION_HANDLER))); - link(new UnwindExceptionToCallerStub(providers, registerStubCall(UNWIND_EXCEPTION_TO_CALLER, NOT_REEXECUTABLE, NOT_LEAF, ANY_LOCATION))); + link(new UnwindExceptionToCallerStub(providers, registerStubCall(UNWIND_EXCEPTION_TO_CALLER, NOT_REEXECUTABLE, NOT_LEAF, any()))); link(new VerifyOopStub(providers, registerStubCall(VERIFY_OOP, REEXECUTABLE, LEAF_NOFP, NO_LOCATIONS))); linkForeignCall(providers, IDENTITY_HASHCODE, c.identityHashCodeAddress, PREPEND_THREAD, NOT_LEAF, NOT_REEXECUTABLE, MARK_WORD_LOCATION); - linkForeignCall(providers, REGISTER_FINALIZER, c.registerFinalizerAddress, PREPEND_THREAD, NOT_LEAF, NOT_REEXECUTABLE, ANY_LOCATION); - linkForeignCall(providers, CREATE_NULL_POINTER_EXCEPTION, c.createNullPointerExceptionAddress, PREPEND_THREAD, NOT_LEAF, REEXECUTABLE, ANY_LOCATION); - linkForeignCall(providers, CREATE_OUT_OF_BOUNDS_EXCEPTION, c.createOutOfBoundsExceptionAddress, PREPEND_THREAD, NOT_LEAF, REEXECUTABLE, ANY_LOCATION); - linkForeignCall(providers, MONITORENTER, c.monitorenterAddress, PREPEND_THREAD, NOT_LEAF, NOT_REEXECUTABLE, ANY_LOCATION); - linkForeignCall(providers, MONITOREXIT, c.monitorexitAddress, PREPEND_THREAD, LEAF_SP, NOT_REEXECUTABLE, ANY_LOCATION); + linkForeignCall(providers, REGISTER_FINALIZER, c.registerFinalizerAddress, PREPEND_THREAD, NOT_LEAF, NOT_REEXECUTABLE, any()); + linkForeignCall(providers, CREATE_NULL_POINTER_EXCEPTION, c.createNullPointerExceptionAddress, PREPEND_THREAD, NOT_LEAF, REEXECUTABLE, any()); + linkForeignCall(providers, CREATE_OUT_OF_BOUNDS_EXCEPTION, c.createOutOfBoundsExceptionAddress, PREPEND_THREAD, NOT_LEAF, REEXECUTABLE, any()); + linkForeignCall(providers, MONITORENTER, c.monitorenterAddress, PREPEND_THREAD, NOT_LEAF, NOT_REEXECUTABLE, any()); + linkForeignCall(providers, MONITOREXIT, c.monitorexitAddress, PREPEND_THREAD, LEAF_SP, NOT_REEXECUTABLE, any()); linkForeignCall(providers, NEW_MULTI_ARRAY, c.newMultiArrayAddress, PREPEND_THREAD, NOT_LEAF, REEXECUTABLE, INIT_LOCATION); linkForeignCall(providers, DYNAMIC_NEW_ARRAY, c.dynamicNewArrayAddress, PREPEND_THREAD, NOT_LEAF, REEXECUTABLE, INIT_LOCATION); linkForeignCall(providers, DYNAMIC_NEW_INSTANCE, c.dynamicNewInstanceAddress, PREPEND_THREAD, NOT_LEAF, REEXECUTABLE, INIT_LOCATION); linkForeignCall(providers, LOG_PRINTF, c.logPrintfAddress, PREPEND_THREAD, LEAF, REEXECUTABLE, NO_LOCATIONS); linkForeignCall(providers, LOG_OBJECT, c.logObjectAddress, PREPEND_THREAD, LEAF, REEXECUTABLE, NO_LOCATIONS); linkForeignCall(providers, LOG_PRIMITIVE, c.logPrimitiveAddress, PREPEND_THREAD, LEAF, REEXECUTABLE, NO_LOCATIONS); - linkForeignCall(providers, THREAD_IS_INTERRUPTED, c.threadIsInterruptedAddress, PREPEND_THREAD, NOT_LEAF, NOT_REEXECUTABLE, ANY_LOCATION); + linkForeignCall(providers, THREAD_IS_INTERRUPTED, c.threadIsInterruptedAddress, PREPEND_THREAD, NOT_LEAF, NOT_REEXECUTABLE, any()); linkForeignCall(providers, VM_ERROR, c.vmErrorAddress, PREPEND_THREAD, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); linkForeignCall(providers, OSR_MIGRATION_END, c.osrMigrationEndAddress, DONT_PREPEND_THREAD, LEAF_NOFP, NOT_REEXECUTABLE, NO_LOCATIONS); linkForeignCall(providers, G1WBPRECALL, c.writeBarrierPreAddress, PREPEND_THREAD, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); linkForeignCall(providers, G1WBPOSTCALL, c.writeBarrierPostAddress, PREPEND_THREAD, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); linkForeignCall(providers, VALIDATE_OBJECT, c.validateObject, PREPEND_THREAD, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); - linkForeignCall(providers, TEST_DEOPTIMIZE_CALL_INT, c.testDeoptimizeCallInt, PREPEND_THREAD, NOT_LEAF, NOT_REEXECUTABLE, ANY_LOCATION); + linkForeignCall(providers, TEST_DEOPTIMIZE_CALL_INT, c.testDeoptimizeCallInt, PREPEND_THREAD, NOT_LEAF, NOT_REEXECUTABLE, any()); // sometimes the same function is used for different kinds of arraycopy so check for // duplicates using a map. diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java Sat Mar 14 01:28:20 2015 +0100 @@ -48,14 +48,13 @@ * This value contains all flags as stored in the VM including internal ones. */ private final int modifiers; - private final LocationIdentity locationIdentity = new LocationIdentity() { + private final LocationIdentity locationIdentity = new FieldLocationIdentity(this); - }; - - public static class FieldLocationIdentity { + public static class FieldLocationIdentity extends LocationIdentity { HotSpotResolvedJavaFieldImpl inner; public FieldLocationIdentity(HotSpotResolvedJavaFieldImpl inner) { + super(false); this.inner = inner; } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotWordOperationPlugin.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotWordOperationPlugin.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotWordOperationPlugin.java Sat Mar 14 01:28:20 2015 +0100 @@ -114,7 +114,7 @@ Stamp readStamp = KlassPointerStamp.klass(); LocationNode location; if (args.length == 2) { - location = makeLocation(b, args[1], ANY_LOCATION); + location = makeLocation(b, args[1], any()); } else { location = makeLocation(b, args[1], args[2]); } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -57,7 +57,7 @@ @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } @Override diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EndLockScopeNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EndLockScopeNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EndLockScopeNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -49,7 +49,7 @@ @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } @Override diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/SaveAllRegistersNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/SaveAllRegistersNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/SaveAllRegistersNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -66,6 +66,6 @@ public static native long saveAllRegisters(); public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Sat Mar 14 01:28:20 2015 +0100 @@ -89,7 +89,7 @@ private static void crypt(Object rcvr, byte[] in, int inOffset, byte[] out, int outOffset, boolean encrypt) { Object realReceiver = PiNode.piCastNonNull(rcvr, AESCryptClass); - Object kObject = UnsafeLoadNode.load(realReceiver, kOffset, Kind.Object, LocationIdentity.ANY_LOCATION); + Object kObject = UnsafeLoadNode.load(realReceiver, kOffset, Kind.Object, LocationIdentity.any()); Word kAddr = fromWordBase(Word.fromObject(kObject).add(arrayBaseOffset(Kind.Byte))); Word inAddr = Word.unsigned(GetObjectAddressNode.get(in) + arrayBaseOffset(Kind.Byte) + inOffset); Word outAddr = Word.unsigned(GetObjectAddressNode.get(out) + arrayBaseOffset(Kind.Byte) + outOffset); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java Sat Mar 14 01:28:20 2015 +0100 @@ -70,7 +70,7 @@ @MethodSubstitution(isStatic = false) static int encrypt(Object rcvr, byte[] in, int inOffset, int inLength, byte[] out, int outOffset) { Object realReceiver = PiNode.piCastNonNull(rcvr, cipherBlockChainingClass); - Object embeddedCipher = UnsafeLoadNode.load(realReceiver, embeddedCipherOffset, Kind.Object, LocationIdentity.ANY_LOCATION); + Object embeddedCipher = UnsafeLoadNode.load(realReceiver, embeddedCipherOffset, Kind.Object, LocationIdentity.any()); if (getAESCryptClass().isInstance(embeddedCipher)) { Object aesCipher = PiNode.piCastNonNull(embeddedCipher, AESCryptSubstitutions.AESCryptClass); crypt(realReceiver, in, inOffset, inLength, out, outOffset, aesCipher, true); @@ -83,7 +83,7 @@ @MethodSubstitution(isStatic = false) static int decrypt(Object rcvr, byte[] in, int inOffset, int inLength, byte[] out, int outOffset) { Object realReceiver = PiNode.piCastNonNull(rcvr, cipherBlockChainingClass); - Object embeddedCipher = UnsafeLoadNode.load(realReceiver, embeddedCipherOffset, Kind.Object, LocationIdentity.ANY_LOCATION); + Object embeddedCipher = UnsafeLoadNode.load(realReceiver, embeddedCipherOffset, Kind.Object, LocationIdentity.any()); if (in != out && getAESCryptClass().isInstance(embeddedCipher)) { Object aesCipher = PiNode.piCastNonNull(embeddedCipher, AESCryptSubstitutions.AESCryptClass); crypt(realReceiver, in, inOffset, inLength, out, outOffset, aesCipher, false); @@ -95,8 +95,8 @@ private static void crypt(Object rcvr, byte[] in, int inOffset, int inLength, byte[] out, int outOffset, Object embeddedCipher, boolean encrypt) { Object realReceiver = PiNode.piCastNonNull(rcvr, cipherBlockChainingClass); - Object kObject = UnsafeLoadNode.load(embeddedCipher, AESCryptSubstitutions.kOffset, Kind.Object, LocationIdentity.ANY_LOCATION); - Object rObject = UnsafeLoadNode.load(realReceiver, rOffset, Kind.Object, LocationIdentity.ANY_LOCATION); + Object kObject = UnsafeLoadNode.load(embeddedCipher, AESCryptSubstitutions.kOffset, Kind.Object, LocationIdentity.any()); + Object rObject = UnsafeLoadNode.load(realReceiver, rOffset, Kind.Object, LocationIdentity.any()); Word kAddr = Word.fromWordBase(Word.fromObject(kObject).add(arrayBaseOffset(Kind.Byte))); Word rAddr = Word.fromWordBase(Word.fromObject(rObject).add(arrayBaseOffset(Kind.Byte))); Word inAddr = Word.unsigned(GetObjectAddressNode.get(in) + arrayBaseOffset(Kind.Byte) + inOffset); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Sat Mar 14 01:28:20 2015 +0100 @@ -569,7 +569,7 @@ public static Word loadWordFromObject(Object object, int offset) { ReplacementsUtil.staticAssert(offset != hubOffset(), "Use loadHubIntrinsic instead of loadWordFromObject"); - return loadWordFromObjectIntrinsic(object, offset, getWordKind(), LocationIdentity.ANY_LOCATION); + return loadWordFromObjectIntrinsic(object, offset, getWordKind(), LocationIdentity.any()); } public static Word loadWordFromObject(Object object, int offset, LocationIdentity identity) { diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ThreadSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ThreadSubstitutions.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ThreadSubstitutions.java Sat Mar 14 01:28:20 2015 +0100 @@ -45,7 +45,7 @@ Object thread = javaThread.readObject(threadObjectOffset(), JAVA_THREAD_THREAD_OBJECT_LOCATION); if (thisObject == thread) { Word osThread = javaThread.readWord(osThreadOffset(), JAVA_THREAD_OSTHREAD_LOCATION); - boolean interrupted = osThread.readInt(osThreadInterruptedOffset(), ANY_LOCATION) != 0; + boolean interrupted = osThread.readInt(osThreadInterruptedOffset(), any()) != 0; if (!interrupted || !clearInterrupted) { return interrupted; } diff -r 426461951938 -r 3d0116ec99c5 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 Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Sat Mar 14 01:28:20 2015 +0100 @@ -483,7 +483,7 @@ public static void validateObject(Object parent, Object child) { if (verifyOops() && child != null && !validateOop(VALIDATE_OBJECT, parent, child)) { log(true, "Verification ERROR, Parent: %p Child: %p\n", Word.fromObject(parent).rawValue(), Word.fromObject(child).rawValue()); - DirectObjectStoreNode.storeObject(null, 0, 0, null, LocationIdentity.ANY_LOCATION, Kind.Object); + DirectObjectStoreNode.storeObject(null, 0, 0, null, LocationIdentity.any(), Kind.Object); } } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -141,7 +141,7 @@ if (elementKind != null) { return NamedLocationIdentity.getArrayLocation(elementKind); } - return ANY_LOCATION; + return any(); } @NodeIntrinsic diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -119,7 +119,7 @@ if (elementKind != null) { return NamedLocationIdentity.getArrayLocation(elementKind); } - return ANY_LOCATION; + return any(); } @NodeIntrinsic diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java Sat Mar 14 01:28:20 2015 +0100 @@ -243,19 +243,19 @@ Unsigned destNonVectorEnd = destStart.add(nonVectorBytes); while (destOffset.belowThan(destNonVectorEnd)) { - ObjectAccess.writeByte(dest, destOffset, ObjectAccess.readByte(src, srcOffset, ANY_LOCATION), ANY_LOCATION); + ObjectAccess.writeByte(dest, destOffset, ObjectAccess.readByte(src, srcOffset, any()), any()); destOffset = destOffset.add(1); srcOffset = srcOffset.add(1); } // Unsigned destVectorEnd = destEnd.subtract(destEnd.unsignedRemainder(8)); while (destOffset.belowThan(destVectorEnd)) { - ObjectAccess.writeWord(dest, destOffset, ObjectAccess.readWord(src, srcOffset, ANY_LOCATION), ANY_LOCATION); + ObjectAccess.writeWord(dest, destOffset, ObjectAccess.readWord(src, srcOffset, any()), any()); destOffset = destOffset.add(wordSize()); srcOffset = srcOffset.add(wordSize()); } // Do the last bytes each when it is required to have absolute alignment. while (!supportsUnalignedMemoryAccess && destOffset.belowThan(destEnd)) { - ObjectAccess.writeByte(dest, destOffset, ObjectAccess.readByte(src, srcOffset, ANY_LOCATION), ANY_LOCATION); + ObjectAccess.writeByte(dest, destOffset, ObjectAccess.readByte(src, srcOffset, any()), any()); destOffset = destOffset.add(1); srcOffset = srcOffset.add(1); } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Sat Mar 14 01:28:20 2015 +0100 @@ -1135,7 +1135,7 @@ invoke = createInvoke(callTarget, resultType); } else { invoke = createInvokeWithException(callTarget, resultType); - AbstractBeginNode beginNode = currentGraph.add(new KillingBeginNode(LocationIdentity.ANY_LOCATION)); + AbstractBeginNode beginNode = currentGraph.add(new KillingBeginNode(LocationIdentity.any())); invoke.setNext(beginNode); lastInstr = beginNode; } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -107,7 +107,7 @@ @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } @Override diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -154,7 +154,7 @@ @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } @Override diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryMapNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryMapNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryMapNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -76,7 +76,7 @@ } else { int index = locationIdentities.indexOf(locationIdentity); if (index == -1) { - index = locationIdentities.indexOf(ANY_LOCATION); + index = locationIdentities.indexOf(any()); } assert index != -1; return (MemoryNode) nodes.get(index); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StartNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StartNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StartNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -44,6 +44,6 @@ @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/Block.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/Block.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/Block.java Sat Mar 14 01:28:20 2015 +0100 @@ -219,7 +219,7 @@ result.add(identity); } } - if (result.isKillAll()) { + if (result.isAny()) { break; } } @@ -240,11 +240,11 @@ for (Block b : this.getPredecessors()) { if (b != stopBlock && (!this.isLoopHeader() || b.getLoopDepth() < this.getLoopDepth())) { dominatorResult.addAll(b.getKillLocations()); - if (dominatorResult.isKillAll()) { + if (dominatorResult.isAny()) { break; } b.calcKillLocationsBetweenThisAndTarget(dominatorResult, stopBlock); - if (dominatorResult.isKillAll()) { + if (dominatorResult.isAny()) { break; } } @@ -256,7 +256,7 @@ private void calcKillLocationsBetweenThisAndTarget(LocationSet result, Block stopBlock) { assert AbstractControlFlowGraph.dominates(stopBlock, this); - if (stopBlock == this || result.isKillAll()) { + if (stopBlock == this || result.isAny()) { // We reached the stop block => nothing to do. return; } else { @@ -267,7 +267,7 @@ // from the dominator onwards. calcKillLocationsBetweenThisAndTarget(result, this.getDominator()); result.addAll(this.getDominator().getKillLocations()); - if (result.isKillAll()) { + if (result.isAny()) { return; } this.getDominator().calcKillLocationsBetweenThisAndTarget(result, stopBlock); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/HIRLoop.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/HIRLoop.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/HIRLoop.java Sat Mar 14 01:28:20 2015 +0100 @@ -45,14 +45,14 @@ for (Block b : this.getBlocks()) { if (b.getLoop() == this) { killLocations.addAll(b.getKillLocations()); - if (killLocations.isKillAll()) { + if (killLocations.isAny()) { break; } } } } for (Loop child : this.getChildren()) { - if (killLocations.isKillAll()) { + if (killLocations.isAny()) { break; } killLocations.addAll(((HIRLoop) child).getKillLocations()); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/LocationSet.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/LocationSet.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/LocationSet.java Sat Mar 14 01:28:20 2015 +0100 @@ -47,21 +47,24 @@ } } - public boolean isKillNone() { + public boolean isEmpty() { return firstLocation == null; } - public boolean isKillAll() { - return LocationIdentity.ANY_LOCATION.equals(firstLocation); + public boolean isAny() { + return firstLocation != null && firstLocation.isAny(); } public void add(LocationIdentity location) { - if (this.isKillAll()) { + if (this.isAny()) { return; - } else if (LocationIdentity.ANY_LOCATION.equals(location)) { + } else if (location.isAny()) { firstLocation = location; list = null; + } else if (location.isImmutable()) { + return; } else { + assert location.isMutable() && location.isSingle(); if (firstLocation == null) { firstLocation = location; } else if (location.equals(firstLocation)) { @@ -92,10 +95,9 @@ } public boolean contains(LocationIdentity locationIdentity) { - assert locationIdentity != null; - assert !locationIdentity.equals(LocationIdentity.ANY_LOCATION); + assert locationIdentity.isSingle(); assert locationIdentity.isMutable(); - if (LocationIdentity.ANY_LOCATION.equals(firstLocation)) { + if (LocationIdentity.any().equals(firstLocation)) { return true; } if (locationIdentity.equals(firstLocation)) { @@ -125,10 +127,10 @@ @Override public String toString() { - if (this.isKillAll()) { - return "KILLALL"; - } else if (this.isKillNone()) { - return "KILLNONE"; + if (this.isAny()) { + return "ANY"; + } else if (this.isEmpty()) { + return "EMPTY"; } else { List copyAsList = getCopyAsList(); return Arrays.toString(copyAsList.toArray(new LocationIdentity[0])); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BytecodeExceptionNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BytecodeExceptionNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BytecodeExceptionNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -59,7 +59,7 @@ } public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } public void lower(LoweringTool tool) { diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -56,6 +55,6 @@ * an attached write barrier with pre-semantics can not also float. */ public boolean canFloat() { - return !location().getLocationIdentity().equals(LocationIdentity.ANY_LOCATION) && getBarrierType() == BarrierType.NONE; + return location().getLocationIdentity().isSingle() && getBarrierType() == BarrierType.NONE; } } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -45,7 +45,7 @@ @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } @Override diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MemoryCheckpoint.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MemoryCheckpoint.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MemoryCheckpoint.java Sat Mar 14 01:28:20 2015 +0100 @@ -39,7 +39,7 @@ /** * This method is used to determine which memory location is killed by this node. Returning - * the special value {@link LocationIdentity#ANY_LOCATION} will kill all memory locations. + * the special value {@link LocationIdentity#any()} will kill all memory locations. * * @return the identity of the location killed by this node. */ @@ -51,7 +51,7 @@ /** * This method is used to determine which set of memory locations is killed by this node. - * Returning the special value {@link LocationIdentity#ANY_LOCATION} will kill all memory + * Returning the special value {@link LocationIdentity#any()} will kill all memory * locations. * * @return the identities of all locations killed by this node. diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -66,7 +66,7 @@ @Override public Node canonical(CanonicalizerTool tool) { - if (this.getLocationIdentity().equals(LocationIdentity.ANY_LOCATION) && offset().isConstant()) { + if (this.getLocationIdentity().isAny() && offset().isConstant()) { long constantOffset = offset().asJavaConstant().asLong(); // Try to canonicalize to a field access. @@ -82,7 +82,7 @@ } } } - if (this.getLocationIdentity().equals(LocationIdentity.ANY_LOCATION)) { + if (this.getLocationIdentity().isAny()) { ResolvedJavaType receiverType = StampTool.typeOrNull(object()); // Try to build a better location identity. if (receiverType != null && receiverType.isArray()) { diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -44,7 +44,7 @@ @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } @Override diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -43,7 +43,7 @@ @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } @Override diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -58,7 +58,7 @@ @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } @Override diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Sat Mar 14 01:28:20 2015 +0100 @@ -56,7 +56,7 @@ public MemoryMapImpl(StartNode start) { lastMemorySnapshot = CollectionsFactory.newMap(); - lastMemorySnapshot.put(ANY_LOCATION, start); + lastMemorySnapshot.put(any(), start); } public MemoryMapImpl() { @@ -71,7 +71,7 @@ } else { lastLocationAccess = lastMemorySnapshot.get(locationIdentity); if (lastLocationAccess == null) { - lastLocationAccess = lastMemorySnapshot.get(ANY_LOCATION); + lastLocationAccess = lastMemorySnapshot.get(any()); assert lastLocationAccess != null; } return lastLocationAccess; @@ -280,7 +280,7 @@ private static void processAccess(MemoryAccess access, MemoryMapImpl state) { LocationIdentity locationIdentity = access.getLocationIdentity(); - if (!locationIdentity.equals(LocationIdentity.ANY_LOCATION)) { + if (!locationIdentity.equals(LocationIdentity.any())) { MemoryNode lastLocationAccess = state.getLastLocationAccess(locationIdentity); access.setLastLocationAccess(lastLocationAccess); } @@ -297,7 +297,7 @@ } private static void processIdentity(LocationIdentity identity, MemoryCheckpoint checkpoint, MemoryMapImpl state) { - if (identity.equals(ANY_LOCATION)) { + if (identity.isAny()) { state.lastMemorySnapshot.clear(); } state.lastMemorySnapshot.put(identity, checkpoint); @@ -345,7 +345,7 @@ @Override protected Map processLoop(LoopBeginNode loop, MemoryMapImpl initialState) { Set modifiedLocations = modifiedInLoops.get(loop); - if (modifiedLocations.contains(ANY_LOCATION)) { + if (modifiedLocations.contains(any())) { // create phis for all locations if ANY is modified in the loop modifiedLocations = CollectionsFactory.newSet(modifiedLocations); modifiedLocations.addAll(initialState.lastMemorySnapshot.keySet()); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Sat Mar 14 01:28:20 2015 +0100 @@ -248,19 +248,19 @@ } private static void fillKillSet(LocationSet killed, List subList) { - if (!killed.isKillAll()) { + if (!killed.isAny()) { for (Node n : subList) { // Check if this node kills a node in the watch list. if (n instanceof MemoryCheckpoint.Single) { LocationIdentity identity = ((MemoryCheckpoint.Single) n).getLocationIdentity(); killed.add(identity); - if (killed.isKillAll()) { + if (killed.isAny()) { return; } } else if (n instanceof MemoryCheckpoint.Multi) { for (LocationIdentity identity : ((MemoryCheckpoint.Multi) n).getLocationIdentities()) { killed.add(identity); - if (killed.isKillAll()) { + if (killed.isAny()) { return; } } @@ -283,7 +283,7 @@ ArrayList watchList = null; if (watchListMap != null) { watchList = watchListMap.get(b); - assert watchList == null || !b.getKillLocations().isKillNone(); + assert watchList == null || !b.getKillLocations().isEmpty(); } AbstractBeginNode beginNode = b.getBeginNode(); if (beginNode instanceof LoopExitNode) { @@ -348,7 +348,7 @@ private static void checkWatchList(ArrayList watchList, LocationIdentity identity, Block b, ArrayList result, NodeMap nodeMap, NodeBitMap unprocessed) { assert identity.isMutable(); - if (LocationIdentity.ANY_LOCATION.equals(identity)) { + if (identity.isAny()) { for (FloatingReadNode r : watchList) { if (unprocessed.isMarked(r)) { sortIntoList(r, b, result, nodeMap, unprocessed, null); @@ -360,9 +360,9 @@ while (index < watchList.size()) { FloatingReadNode r = watchList.get(index); LocationIdentity locationIdentity = r.getLocationIdentity(); - assert !LocationIdentity.FINAL_LOCATION.equals(locationIdentity); + assert locationIdentity.isMutable(); if (unprocessed.isMarked(r)) { - if (LocationIdentity.ANY_LOCATION.equals(identity) || LocationIdentity.ANY_LOCATION.equals(locationIdentity) || identity.equals(locationIdentity)) { + if (identity.overlaps(locationIdentity)) { sortIntoList(r, b, result, nodeMap, unprocessed, null); } else { ++index; diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java Sat Mar 14 01:28:20 2015 +0100 @@ -70,7 +70,7 @@ @Test public void testRead3() { for (Kind kind : KINDS) { - assertRead(parseEager("read" + kind.name() + "3", AllowAssumptions.YES), kind, true, LocationIdentity.ANY_LOCATION); + assertRead(parseEager("read" + kind.name() + "3", AllowAssumptions.YES), kind, true, LocationIdentity.any()); } } @@ -91,7 +91,7 @@ @Test public void testWrite3() { for (Kind kind : KINDS) { - assertWrite(parseEager("write" + kind.name() + "3", AllowAssumptions.YES), true, LocationIdentity.ANY_LOCATION); + assertWrite(parseEager("write" + kind.name() + "3", AllowAssumptions.YES), true, LocationIdentity.any()); } } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java Sat Mar 14 01:28:20 2015 +0100 @@ -79,7 +79,7 @@ @Test public void testRead3() { for (Kind kind : KINDS) { - assertRead(parseEager("read" + kind.name() + "3", AllowAssumptions.YES), kind, true, LocationIdentity.ANY_LOCATION); + assertRead(parseEager("read" + kind.name() + "3", AllowAssumptions.YES), kind, true, LocationIdentity.any()); } } @@ -100,7 +100,7 @@ @Test public void testWrite3() { for (Kind kind : KINDS) { - assertWrite(parseEager("write" + kind.name() + "3", AllowAssumptions.YES), true, LocationIdentity.ANY_LOCATION); + assertWrite(parseEager("write" + kind.name() + "3", AllowAssumptions.YES), true, LocationIdentity.any()); } } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Sat Mar 14 01:28:20 2015 +0100 @@ -1027,8 +1027,8 @@ if (replacee instanceof MemoryCheckpoint.Single) { // check if some node in snippet graph also kills the same location LocationIdentity locationIdentity = ((MemoryCheckpoint.Single) replacee).getLocationIdentity(); - if (locationIdentity.equals(ANY_LOCATION)) { - assert !(memoryMap.getLastLocationAccess(ANY_LOCATION) instanceof MemoryAnchorNode) : replacee + " kills ANY_LOCATION, but snippet does not"; + if (locationIdentity.isAny()) { + assert !(memoryMap.getLastLocationAccess(any()) instanceof MemoryAnchorNode) : replacee + " kills ANY_LOCATION, but snippet does not"; } assert kills.contains(locationIdentity) : replacee + " kills " + locationIdentity + ", but snippet doesn't contain a kill to this location"; return true; @@ -1038,12 +1038,12 @@ Debug.log("WARNING: %s is not a MemoryCheckpoint, but the snippet graph contains kills (%s). You might want %s to be a MemoryCheckpoint", replacee, kills, replacee); // remove ANY_LOCATION if it's just a kill by the start node - if (memoryMap.getLastLocationAccess(ANY_LOCATION) instanceof MemoryAnchorNode) { - kills.remove(ANY_LOCATION); + if (memoryMap.getLastLocationAccess(any()) instanceof MemoryAnchorNode) { + kills.remove(any()); } // node can only lower to a ANY_LOCATION kill if the replacee also kills ANY_LOCATION - assert !kills.contains(ANY_LOCATION) : "snippet graph contains a kill to ANY_LOCATION, but replacee (" + replacee + ") doesn't kill ANY_LOCATION. kills: " + kills; + assert !kills.contains(any()) : "snippet graph contains a kill to ANY_LOCATION, but replacee (" + replacee + ") doesn't kill ANY_LOCATION. kills: " + kills; /* * kills to other locations than ANY_LOCATION can be still inserted if there aren't any diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java Sat Mar 14 01:28:20 2015 +0100 @@ -108,7 +108,7 @@ Class javaClass = kind == Kind.Object ? Object.class : kind.toJavaClass(); r.register5("compareAndSwap" + kind.name(), Receiver.class, Object.class, long.class, javaClass, javaClass, new InvocationPlugin() { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, ValueNode ignoredUnsafe, ValueNode object, ValueNode offset, ValueNode expected, ValueNode x) { - b.push(Kind.Boolean.getStackKind(), b.append(new CompareAndSwapNode(object, offset, expected, x, kind, LocationIdentity.ANY_LOCATION))); + b.push(Kind.Boolean.getStackKind(), b.append(new CompareAndSwapNode(object, offset, expected, x, kind, LocationIdentity.any()))); return true; } }); @@ -116,14 +116,14 @@ if (getAndSetEnabled(arch)) { r.register4("getAndSet" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new InvocationPlugin() { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, ValueNode ignoredUnsafe, ValueNode object, ValueNode offset, ValueNode value) { - b.push(kind.getStackKind(), b.append(new AtomicReadAndWriteNode(object, offset, value, kind, LocationIdentity.ANY_LOCATION))); + b.push(kind.getStackKind(), b.append(new AtomicReadAndWriteNode(object, offset, value, kind, LocationIdentity.any()))); return true; } }); if (kind != Kind.Object) { r.register4("getAndAdd" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new InvocationPlugin() { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, ValueNode ignoredUnsafe, ValueNode object, ValueNode offset, ValueNode delta) { - b.push(kind.getStackKind(), b.append(new AtomicReadAndAddNode(object, offset, delta, LocationIdentity.ANY_LOCATION))); + b.push(kind.getStackKind(), b.append(new AtomicReadAndAddNode(object, offset, delta, LocationIdentity.any()))); return true; } }); @@ -397,7 +397,7 @@ for (Class c : new Class[]{Node.class, NodeList.class}) { r.register2("get" + c.getSimpleName() + "Unsafe", Node.class, long.class, new InvocationPlugin() { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, ValueNode node, ValueNode offset) { - ValueNode value = b.append(new UnsafeLoadNode(node, offset, Kind.Object, LocationIdentity.ANY_LOCATION)); + ValueNode value = b.append(new UnsafeLoadNode(node, offset, Kind.Object, LocationIdentity.any())); boolean exactType = false; boolean nonNull = false; b.push(Kind.Object, b.append(new PiNode(value, metaAccess.lookupJavaType(c), exactType, nonNull))); @@ -406,7 +406,7 @@ }); r.register3("put" + c.getSimpleName() + "Unsafe", Node.class, long.class, c, new InvocationPlugin() { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, ValueNode node, ValueNode offset, ValueNode value) { - b.append(new UnsafeStoreNode(node, offset, value, Kind.Object, LocationIdentity.ANY_LOCATION)); + b.append(new UnsafeStoreNode(node, offset, value, Kind.Object, LocationIdentity.any())); return true; } }); @@ -489,7 +489,7 @@ if (isVolatile) { b.append(new MembarNode(JMM_PRE_VOLATILE_READ)); } - b.push(returnKind.getStackKind(), b.append(new UnsafeLoadNode(object, offset, returnKind, LocationIdentity.ANY_LOCATION))); + b.push(returnKind.getStackKind(), b.append(new UnsafeLoadNode(object, offset, returnKind, LocationIdentity.any()))); if (isVolatile) { b.append(new MembarNode(JMM_POST_VOLATILE_READ)); } @@ -516,7 +516,7 @@ if (isVolatile) { b.append(new MembarNode(JMM_PRE_VOLATILE_WRITE)); } - b.append(new UnsafeStoreNode(object, offset, value, kind, LocationIdentity.ANY_LOCATION)); + b.append(new UnsafeStoreNode(object, offset, value, kind, LocationIdentity.any())); if (isVolatile) { b.append(new MembarNode(JMM_PRE_VOLATILE_WRITE)); } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/WordOperationPlugin.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/WordOperationPlugin.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/WordOperationPlugin.java Sat Mar 14 01:28:20 2015 +0100 @@ -102,7 +102,7 @@ Kind readKind = wordTypes.asKind(wordMethod.getSignature().getReturnType(wordMethod.getDeclaringClass())); LocationNode location; if (args.length == 2) { - location = makeLocation(b, args[1], ANY_LOCATION); + location = makeLocation(b, args[1], any()); } else { location = makeLocation(b, args[1], args[2]); } @@ -112,7 +112,7 @@ case READ_HEAP: { assert args.length == 3; Kind readKind = wordTypes.asKind(wordMethod.getSignature().getReturnType(wordMethod.getDeclaringClass())); - LocationNode location = makeLocation(b, args[1], ANY_LOCATION); + LocationNode location = makeLocation(b, args[1], any()); BarrierType barrierType = snippetReflection.asObject(BarrierType.class, args[2].asJavaConstant()); b.push(returnStackKind, readOp(b, readKind, args[0], location, barrierType, true)); break; @@ -125,7 +125,7 @@ Kind writeKind = wordTypes.asKind(wordMethod.getSignature().getParameterType(wordMethod.isStatic() ? 2 : 1, wordMethod.getDeclaringClass())); LocationNode location; if (args.length == 3) { - location = makeLocation(b, args[1], LocationIdentity.ANY_LOCATION); + location = makeLocation(b, args[1], LocationIdentity.any()); } else { location = makeLocation(b, args[1], args[3]); } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroStateSplitNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroStateSplitNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroStateSplitNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -62,7 +62,7 @@ } public LocationIdentity getLocationIdentity() { - return LocationIdentity.ANY_LOCATION; + return LocationIdentity.any(); } protected void replaceSnippetInvokes(StructuredGraph snippetGraph) { diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java Sat Mar 14 01:28:20 2015 +0100 @@ -53,6 +53,7 @@ } private ObjectLocationIdentity(JavaConstant object) { + super(false); this.object = object; } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadMacroNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadMacroNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadMacroNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -60,7 +60,7 @@ ValueNode conditionArgument = arguments.get(CONDITION_ARGUMENT_INDEX); LocationIdentity locationIdentity; if (locationArgument.isNullConstant()) { - locationIdentity = LocationIdentity.ANY_LOCATION; + locationIdentity = LocationIdentity.any(); } else { locationIdentity = ObjectLocationIdentity.create(locationArgument.asJavaConstant()); } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeStoreMacroNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeStoreMacroNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeStoreMacroNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -57,7 +57,7 @@ ValueNode valueArgument = arguments.get(VALUE_ARGUMENT_INDEX); LocationIdentity locationIdentity; if (locationArgument.isNullConstant()) { - locationIdentity = LocationIdentity.ANY_LOCATION; + locationIdentity = LocationIdentity.any(); } else { locationIdentity = ObjectLocationIdentity.create(locationArgument.asJavaConstant()); } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java Sat Mar 14 01:28:20 2015 +0100 @@ -337,7 +337,7 @@ if (location.isConstant()) { LocationIdentity locationIdentity; if (location.isNullConstant()) { - locationIdentity = LocationIdentity.ANY_LOCATION; + locationIdentity = LocationIdentity.any(); } else { locationIdentity = ObjectLocationIdentity.create(location.asJavaConstant()); } @@ -363,7 +363,7 @@ if (locationArgument.isConstant()) { LocationIdentity locationIdentity; if (locationArgument.isNullConstant()) { - locationIdentity = LocationIdentity.ANY_LOCATION; + locationIdentity = LocationIdentity.any(); } else { locationIdentity = ObjectLocationIdentity.create(locationArgument.asJavaConstant()); } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java Sat Mar 14 01:28:20 2015 +0100 @@ -101,13 +101,15 @@ state.addReadCache(object, store.field().getLocationIdentity(), value, this); return result; } else { - processIdentity(state, ANY_LOCATION); + processIdentity(state, any()); } return false; } private boolean processLoadField(LoadFieldNode load, PEReadEliminationBlockState state, GraphEffectList effects) { - if (!load.isVolatile()) { + if (load.isVolatile()) { + processIdentity(state, any()); + } else { ValueNode object = GraphUtil.unproxify(load.object()); ValueNode cachedValue = state.getReadCache(object, load.field().getLocationIdentity(), this); if (cachedValue != null) { @@ -117,14 +119,12 @@ } else { state.addReadCache(object, load.field().getLocationIdentity(), load, this); } - } else { - processIdentity(state, ANY_LOCATION); } return false; } private static void processIdentity(PEReadEliminationBlockState state, LocationIdentity identity) { - if (identity.equals(ANY_LOCATION)) { + if (identity.isAny()) { state.killReadCache(); } else { state.killReadCache(identity); diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Sat Mar 14 01:28:20 2015 +0100 @@ -57,7 +57,7 @@ if (node instanceof AccessFieldNode) { AccessFieldNode access = (AccessFieldNode) node; if (access.isVolatile()) { - processIdentity(state, ANY_LOCATION); + processIdentity(state, any()); } else { ValueNode object = GraphUtil.unproxify(access.object()); LoadCacheEntry identifier = new LoadCacheEntry(object, access.field().getLocationIdentity()); @@ -119,7 +119,7 @@ } else if (node instanceof UnsafeAccessNode) { if (node instanceof UnsafeLoadNode) { UnsafeLoadNode load = (UnsafeLoadNode) node; - if (load.offset().isConstant() && !load.getLocationIdentity().equals(LocationIdentity.ANY_LOCATION)) { + if (load.offset().isConstant() && !load.getLocationIdentity().equals(LocationIdentity.any())) { ValueNode object = GraphUtil.unproxify(load.object()); UnsafeLoadCacheEntry identifier = new UnsafeLoadCacheEntry(object, load.offset(), load.getLocationIdentity()); ValueNode cachedValue = state.getCacheEntry(identifier); @@ -134,7 +134,7 @@ } else { assert node instanceof UnsafeStoreNode; UnsafeStoreNode write = (UnsafeStoreNode) node; - if (write.offset().isConstant() && !write.getLocationIdentity().equals(LocationIdentity.ANY_LOCATION)) { + if (write.offset().isConstant() && !write.getLocationIdentity().equals(LocationIdentity.any())) { ValueNode object = GraphUtil.unproxify(write.object()); UnsafeLoadCacheEntry identifier = new UnsafeLoadCacheEntry(object, write.offset(), write.getLocationIdentity()); ValueNode cachedValue = state.getCacheEntry(identifier); @@ -162,7 +162,7 @@ } private static void processIdentity(ReadEliminationBlockState state, LocationIdentity identity) { - if (identity.equals(ANY_LOCATION)) { + if (identity.isAny()) { state.killReadCache(); return; } diff -r 426461951938 -r 3d0116ec99c5 graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java Sat Mar 14 01:09:21 2015 +0100 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java Sat Mar 14 01:28:20 2015 +0100 @@ -74,7 +74,7 @@ return identity; } // We do not know our actual location identity yet, so be conservative. - return ANY_LOCATION; + return any(); } @Override