changeset 18187:9619ba4daf4c

Rename Constant to JavaConstant.
author Roland Schatz <roland.schatz@oracle.com>
date Thu, 30 Oct 2014 12:21:07 +0100
parents ef357effbda7
children 8652481a1110
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SpeculationLog.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/ConstantTest.java graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestConstantReflectionProvider.java graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestMetaAccessProvider.java graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaField.java graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TypeUniverse.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantReflectionProvider.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaConstant.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NullConstant.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PlatformKind.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PrimitiveConstant.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaField.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodHandleAccessProvider.java graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/SimpleAssemblerTest.java graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAssembler.java graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/BoxingEliminationTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CompareCanonicalizerTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FlowSensitiveReductionTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EATestBase.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PEAReadEliminationTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/UnsafeEATest.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeLIRBuilder.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCompare.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64RawNativeCallNode.java graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotAssembler.java graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotNodeLIRBuilder.java graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotSafepointOp.java graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/ReplacingStreams.java graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/InstalledCodeExecuteHelperTest.java graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledRuntimeStub.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCompressedNullConstant.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantReflectionProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaAccessProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstant.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodHandleAccessProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSpeculationLog.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/RawNativeCallNodeFactory.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassCastNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetClassLoader0Node.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetComponentTypeNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetModifiersNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetSuperclassNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsArrayNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsInstanceNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsInterfaceNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsPrimitiveNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CompositeValueClassSubstitutions.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotNodeClassSubstitutions.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MethodHandleNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectGetClassNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemIdentityHashCodeNode.java graal/com.oracle.graal.java.decompiler/src/com/oracle/graal/java/decompiler/lines/DecompilerSyntaxLine.java graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ZapRegistersOp.java graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILMove.java graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXArithmetic.java graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXCompare.java graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXControlFlow.java graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXMemOp.java graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXMove.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/DefUseTree.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java graal/com.oracle.graal.loop/src/com/oracle/graal/loop/BasicInductionVariable.java graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedOffsetInductionVariable.java graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedScaledInductionVariable.java graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariables.java graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/NegateNodeCanonicalizationTest.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DynamicDeoptimizeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AddNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerTestNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/MulNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ReinterpretNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnaryArithmeticNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedDivNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRemNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BranchProbabilityNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IntegerSwitchNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastDynamicNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewInstanceNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfDynamicNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredCompareAndSwapNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/VirtualizerTool.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java graal/com.oracle.graal.replacements.hsail/src/com/oracle/graal/replacements/hsail/HSAILMathIntrinsicsNode.java graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ArraysSubstitutionsTest.java graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/BitOpNodesTest.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/AssertionNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicArrayCopyNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitCountNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanForwardNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanReverseNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DeferredPiNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/LoadSnippetVarargParameterNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MathIntrinsicNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/PureFunctionMacroNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReverseBytesNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluatorCanonicalizer.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/AssumptionNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/BailoutNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/LoadIndexedFinalNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerAddExactNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerMulExactNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerSubExactNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadFinalNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadMacroNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeStoreMacroNode.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/UnsafeTypeCastMacroNode.java graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java src/share/vm/classfile/systemDictionary.hpp src/share/vm/classfile/vmSymbols.hpp src/share/vm/graal/graalCodeInstaller.cpp src/share/vm/graal/graalJavaAccess.hpp
diffstat 267 files changed, 1574 insertions(+), 1572 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -82,12 +82,13 @@
      * Determines if a {@link DataPatch} should be created for a given primitive constant that is
      * part of a {@link CompilationResult}. A data patch is always created for an object constant.
      */
-    boolean needsDataPatch(Constant constant);
+    boolean needsDataPatch(JavaConstant constant);
 
     /**
-     * Create a {@link Data} item for a {@link Constant}, that can be used in a {@link DataPatch}.
+     * Create a {@link Data} item for a {@link JavaConstant}, that can be used in a
+     * {@link DataPatch}.
      */
-    Data createDataItem(Constant constant);
+    Data createDataItem(JavaConstant constant);
 
     /**
      * Gets a description of the target architecture.
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java	Thu Oct 30 12:21:07 2014 +0100
@@ -206,7 +206,7 @@
     /**
      * Represents a code site that references some data. The associated data can be either a
      * {@link DataSectionReference reference} to the data section, or it may be an inlined
-     * {@link Constant} that needs to be patched.
+     * {@link JavaConstant} that needs to be patched.
      */
     public static final class DataPatch extends Site {
 
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SpeculationLog.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SpeculationLog.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,5 +66,5 @@
         speculations.add(reason);
     }
 
-    public abstract Constant speculate(Object reason);
+    public abstract JavaConstant speculate(Object reason);
 }
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,12 +52,12 @@
 
     public static boolean isConstant(Value value) {
         assert value != null;
-        return value instanceof Constant;
+        return value instanceof JavaConstant;
     }
 
-    public static Constant asConstant(Value value) {
+    public static JavaConstant asConstant(Value value) {
         assert value != null;
-        return (Constant) value;
+        return (JavaConstant) value;
     }
 
     public static boolean isAllocatableValue(Value value) {
--- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/ConstantTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/ConstantTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,38 +30,38 @@
 
     @Test
     public void testNegativeZero() {
-        Assert.assertTrue("Constant for 0.0f must be different from -0.0f", Constant.FLOAT_0 != Constant.forFloat(-0.0F));
-        Assert.assertTrue("Constant for 0.0d must be different from -0.0d", Constant.DOUBLE_0 != Constant.forDouble(-0.0d));
+        Assert.assertTrue("Constant for 0.0f must be different from -0.0f", JavaConstant.FLOAT_0 != JavaConstant.forFloat(-0.0F));
+        Assert.assertTrue("Constant for 0.0d must be different from -0.0d", JavaConstant.DOUBLE_0 != JavaConstant.forDouble(-0.0d));
     }
 
     @Test
     public void testNullIsNull() {
-        Assert.assertTrue(Constant.NULL_OBJECT.isNull());
+        Assert.assertTrue(JavaConstant.NULL_OBJECT.isNull());
     }
 
     @Test
     public void testOne() {
         for (Kind kind : Kind.values()) {
             if (kind.isNumericInteger() || kind.isNumericFloat()) {
-                Assert.assertTrue(Constant.one(kind).getKind() == kind);
+                Assert.assertTrue(JavaConstant.one(kind).getKind() == kind);
             }
         }
-        Assert.assertEquals(1, Constant.one(Kind.Int).asInt());
-        Assert.assertEquals(1L, Constant.one(Kind.Long).asLong());
-        Assert.assertEquals(1, Constant.one(Kind.Byte).asInt());
-        Assert.assertEquals(1, Constant.one(Kind.Short).asInt());
-        Assert.assertEquals(1, Constant.one(Kind.Char).asInt());
-        Assert.assertTrue(1F == Constant.one(Kind.Float).asFloat());
-        Assert.assertTrue(1D == Constant.one(Kind.Double).asDouble());
+        Assert.assertEquals(1, JavaConstant.one(Kind.Int).asInt());
+        Assert.assertEquals(1L, JavaConstant.one(Kind.Long).asLong());
+        Assert.assertEquals(1, JavaConstant.one(Kind.Byte).asInt());
+        Assert.assertEquals(1, JavaConstant.one(Kind.Short).asInt());
+        Assert.assertEquals(1, JavaConstant.one(Kind.Char).asInt());
+        Assert.assertTrue(1F == JavaConstant.one(Kind.Float).asFloat());
+        Assert.assertTrue(1D == JavaConstant.one(Kind.Double).asDouble());
     }
 
     @Test(expected = IllegalArgumentException.class)
     public void testIllegalOne() {
-        Constant.one(Kind.Illegal);
+        JavaConstant.one(Kind.Illegal);
     }
 
     @Test(expected = IllegalArgumentException.class)
     public void testVoidOne() {
-        Constant.one(Kind.Void);
+        JavaConstant.one(Kind.Void);
     }
 }
--- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestConstantReflectionProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestConstantReflectionProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,8 +39,8 @@
 
     @Test
     public void constantEqualsTest() {
-        for (Constant c1 : constants) {
-            for (Constant c2 : constants) {
+        for (JavaConstant c1 : constants) {
+            for (JavaConstant c2 : constants) {
                 // test symmetry
                 assertEquals(constantReflection.constantEquals(c1, c2), constantReflection.constantEquals(c2, c1));
                 if (c1.getKind() != Kind.Object && c2.getKind() != Kind.Object) {
@@ -52,7 +52,7 @@
 
     @Test
     public void readArrayLengthTest() {
-        for (Constant c : constants) {
+        for (JavaConstant c : constants) {
             Integer actual = constantReflection.readArrayLength(c);
             if (c.getKind() != Kind.Object || c.isNull() || !snippetReflection.asObject(c).getClass().isArray()) {
                 assertNull(actual);
@@ -66,44 +66,44 @@
 
     @Test
     public void boxTest() {
-        for (Constant c : constants) {
-            Constant boxed = constantReflection.boxPrimitive(c);
+        for (JavaConstant c : constants) {
+            JavaConstant boxed = constantReflection.boxPrimitive(c);
             if (c.getKind().isPrimitive()) {
                 assertTrue(boxed.getKind().isObject());
                 assertFalse(boxed.isNull());
             }
         }
 
-        assertEquals(Long.valueOf(42), snippetReflection.asObject(constantReflection.boxPrimitive(Constant.forLong(42))));
-        assertEquals(Integer.valueOf(666), snippetReflection.asObject(constantReflection.boxPrimitive(Constant.forInt(666))));
-        assertEquals(Byte.valueOf((byte) 123), snippetReflection.asObject(constantReflection.boxPrimitive(Constant.forByte((byte) 123))));
-        assertSame(Boolean.TRUE, snippetReflection.asObject(constantReflection.boxPrimitive(Constant.forBoolean(true))));
+        assertEquals(Long.valueOf(42), snippetReflection.asObject(constantReflection.boxPrimitive(JavaConstant.forLong(42))));
+        assertEquals(Integer.valueOf(666), snippetReflection.asObject(constantReflection.boxPrimitive(JavaConstant.forInt(666))));
+        assertEquals(Byte.valueOf((byte) 123), snippetReflection.asObject(constantReflection.boxPrimitive(JavaConstant.forByte((byte) 123))));
+        assertSame(Boolean.TRUE, snippetReflection.asObject(constantReflection.boxPrimitive(JavaConstant.forBoolean(true))));
 
-        assertNull(constantReflection.boxPrimitive(Constant.NULL_OBJECT));
+        assertNull(constantReflection.boxPrimitive(JavaConstant.NULL_OBJECT));
         assertNull(constantReflection.boxPrimitive(snippetReflection.forObject("abc")));
     }
 
     @Test
     public void unboxTest() {
-        for (Constant c : constants) {
-            Constant unboxed = constantReflection.unboxPrimitive(c);
+        for (JavaConstant c : constants) {
+            JavaConstant unboxed = constantReflection.unboxPrimitive(c);
             if (unboxed != null) {
                 assertFalse(unboxed.getKind().isObject());
             }
         }
 
-        assertEquals(Constant.forLong(42), constantReflection.unboxPrimitive(snippetReflection.forObject(Long.valueOf(42))));
-        assertEquals(Constant.forInt(666), constantReflection.unboxPrimitive(snippetReflection.forObject(Integer.valueOf(666))));
-        assertEquals(Constant.forByte((byte) 123), constantReflection.unboxPrimitive(snippetReflection.forObject(Byte.valueOf((byte) 123))));
-        assertSame(Constant.forBoolean(true), constantReflection.unboxPrimitive(snippetReflection.forObject(Boolean.TRUE)));
+        assertEquals(JavaConstant.forLong(42), constantReflection.unboxPrimitive(snippetReflection.forObject(Long.valueOf(42))));
+        assertEquals(JavaConstant.forInt(666), constantReflection.unboxPrimitive(snippetReflection.forObject(Integer.valueOf(666))));
+        assertEquals(JavaConstant.forByte((byte) 123), constantReflection.unboxPrimitive(snippetReflection.forObject(Byte.valueOf((byte) 123))));
+        assertSame(JavaConstant.forBoolean(true), constantReflection.unboxPrimitive(snippetReflection.forObject(Boolean.TRUE)));
 
-        assertNull(constantReflection.unboxPrimitive(Constant.NULL_OBJECT));
+        assertNull(constantReflection.unboxPrimitive(JavaConstant.NULL_OBJECT));
         assertNull(constantReflection.unboxPrimitive(snippetReflection.forObject("abc")));
     }
 
     @Test
     public void testAsJavaType() {
-        for (Constant c : constants) {
+        for (JavaConstant c : constants) {
             ResolvedJavaType type = constantReflection.asJavaType(c);
 
             Object o = snippetReflection.asBoxedValue(c);
--- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestMetaAccessProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestMetaAccessProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -79,7 +79,7 @@
 
     @Test
     public void lookupJavaTypeConstantTest() {
-        for (Constant c : constants) {
+        for (JavaConstant c : constants) {
             if (c.getKind() == Kind.Object && !c.isNull()) {
                 Object o = snippetReflection.asObject(c);
                 ResolvedJavaType type = metaAccess.lookupJavaType(c);
--- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaField.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaField.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,13 +95,13 @@
 
         ResolvedJavaField field = metaAccess.lookupJavaField(getClass().getDeclaredField("stringField"));
         for (Object receiver : new Object[]{this, null, new String()}) {
-            Constant value = field.readConstantValue(snippetReflection.forObject(receiver));
+            JavaConstant value = field.readConstantValue(snippetReflection.forObject(receiver));
             assertNull(value);
         }
 
         ResolvedJavaField constField = metaAccess.lookupJavaField(getClass().getDeclaredField("constantStringField"));
         for (Object receiver : new Object[]{this, null, new String()}) {
-            Constant value = constField.readConstantValue(snippetReflection.forObject(receiver));
+            JavaConstant value = constField.readConstantValue(snippetReflection.forObject(receiver));
             if (value != null) {
                 Object expected = "constantField";
                 assertTrue(snippetReflection.asObject(value) == expected);
--- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -121,7 +121,7 @@
 
     @Test
     public void isInstanceTest() {
-        for (Constant c : constants) {
+        for (JavaConstant c : constants) {
             if (c.getKind() == Kind.Object && !c.isNull()) {
                 Object o = snippetReflection.asObject(c);
                 Class<? extends Object> cls = o.getClass();
--- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TypeUniverse.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TypeUniverse.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
     public final SnippetReflectionProvider snippetReflection;
     public final Collection<Class<?>> classes = new HashSet<>();
     public final Map<Class<?>, Class<?>> arrayClasses = new HashMap<>();
-    public final List<Constant> constants = new ArrayList<>();
+    public final List<JavaConstant> constants = new ArrayList<>();
 
     public TypeUniverse() {
         Providers providers = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getProviders();
@@ -77,11 +77,11 @@
         for (Class<?> c : initialClasses) {
             addClass(c);
         }
-        for (Field f : Constant.class.getDeclaredFields()) {
+        for (Field f : JavaConstant.class.getDeclaredFields()) {
             int mods = f.getModifiers();
-            if (f.getType() == Constant.class && Modifier.isPublic(mods) && Modifier.isStatic(mods) && Modifier.isFinal(mods)) {
+            if (f.getType() == JavaConstant.class && Modifier.isPublic(mods) && Modifier.isStatic(mods) && Modifier.isFinal(mods)) {
                 try {
-                    Constant c = (Constant) f.get(null);
+                    JavaConstant c = (JavaConstant) f.get(null);
                     if (c != null) {
                         constants.add(c);
                     }
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java	Thu Oct 30 11:18:48 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,455 +0,0 @@
-/*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.api.meta;
-
-/**
- * Represents a constant (boxed) value, such as an integer, floating point number, or object
- * reference, within the compiler and across the compiler/runtime interface. Exports a set of
- * {@code Constant} instances that represent frequently used constant values, such as
- * {@link #NULL_OBJECT}.
- */
-public abstract class Constant extends Value {
-
-    private static final long serialVersionUID = -6355452536852663986L;
-
-    /*
-     * Using a larger cache for integers leads to only a slight increase in cache hit ratio which is
-     * not enough to justify the impact on startup time.
-     */
-    public static final Constant NULL_OBJECT = new NullConstant();
-    public static final Constant INT_MINUS_1 = new PrimitiveConstant(Kind.Int, -1);
-    public static final Constant INT_0 = new PrimitiveConstant(Kind.Int, 0);
-    public static final Constant INT_1 = new PrimitiveConstant(Kind.Int, 1);
-    public static final Constant INT_2 = new PrimitiveConstant(Kind.Int, 2);
-    public static final Constant LONG_0 = new PrimitiveConstant(Kind.Long, 0L);
-    public static final Constant LONG_1 = new PrimitiveConstant(Kind.Long, 1L);
-    public static final Constant FLOAT_0 = new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(0.0F));
-    public static final Constant FLOAT_1 = new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(1.0F));
-    public static final Constant DOUBLE_0 = new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(0.0D));
-    public static final Constant DOUBLE_1 = new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(1.0D));
-    public static final Constant TRUE = new PrimitiveConstant(Kind.Boolean, 1L);
-    public static final Constant FALSE = new PrimitiveConstant(Kind.Boolean, 0L);
-
-    protected Constant(LIRKind kind) {
-        super(kind);
-    }
-
-    /**
-     * Checks whether this constant is null.
-     *
-     * @return {@code true} if this constant is the null constant
-     */
-    public abstract boolean isNull();
-
-    /**
-     * Checks whether this constant is non-null.
-     *
-     * @return {@code true} if this constant is a primitive, or an object constant that is not null
-     */
-    public final boolean isNonNull() {
-        return !isNull();
-    }
-
-    /**
-     * Checks whether this constant is the default value for its kind (null, 0, 0.0, false).
-     *
-     * @return {@code true} if this constant is the default value for its kind
-     */
-    public abstract boolean isDefaultForKind();
-
-    /**
-     * Returns the value of this constant as a boxed Java value.
-     *
-     * @return the value of this constant
-     */
-    public abstract Object asBoxedPrimitive();
-
-    /**
-     * Returns the primitive int value this constant represents. The constant must have a
-     * {@link Kind#getStackKind()} of {@link Kind#Int}.
-     *
-     * @return the constant value
-     */
-    public abstract int asInt();
-
-    /**
-     * Returns the primitive boolean value this constant represents. The constant must have kind
-     * {@link Kind#Boolean}.
-     *
-     * @return the constant value
-     */
-    public abstract boolean asBoolean();
-
-    /**
-     * Returns the primitive long value this constant represents. The constant must have kind
-     * {@link Kind#Long}, a {@link Kind#getStackKind()} of {@link Kind#Int}.
-     *
-     * @return the constant value
-     */
-    public abstract long asLong();
-
-    /**
-     * Returns the primitive float value this constant represents. The constant must have kind
-     * {@link Kind#Float}.
-     *
-     * @return the constant value
-     */
-    public abstract float asFloat();
-
-    /**
-     * Returns the primitive double value this constant represents. The constant must have kind
-     * {@link Kind#Double}.
-     *
-     * @return the constant value
-     */
-    public abstract double asDouble();
-
-    public String toValueString() {
-        if (getKind() == Kind.Illegal) {
-            return "illegal";
-        } else {
-            return getKind().format(asBoxedPrimitive());
-        }
-    }
-
-    @Override
-    public String toString() {
-        if (getKind() == Kind.Illegal) {
-            return "illegal";
-        } else {
-            return getKind().getJavaName() + "[" + toValueString() + "]";
-        }
-    }
-
-    /**
-     * Creates a boxed double constant.
-     *
-     * @param d the double value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static Constant forDouble(double d) {
-        if (Double.compare(0.0D, d) == 0) {
-            return DOUBLE_0;
-        }
-        if (Double.compare(d, 1.0D) == 0) {
-            return DOUBLE_1;
-        }
-        return new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(d));
-    }
-
-    /**
-     * Creates a boxed float constant.
-     *
-     * @param f the float value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static Constant forFloat(float f) {
-        if (Float.compare(f, 0.0F) == 0) {
-            return FLOAT_0;
-        }
-        if (Float.compare(f, 1.0F) == 0) {
-            return FLOAT_1;
-        }
-        return new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(f));
-    }
-
-    /**
-     * Creates a boxed long constant.
-     *
-     * @param i the long value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static Constant forLong(long i) {
-        if (i == 0) {
-            return LONG_0;
-        } else if (i == 1) {
-            return LONG_1;
-        } else {
-            return new PrimitiveConstant(Kind.Long, i);
-        }
-    }
-
-    /**
-     * Creates a boxed integer constant.
-     *
-     * @param i the integer value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static Constant forInt(int i) {
-        switch (i) {
-            case -1:
-                return INT_MINUS_1;
-            case 0:
-                return INT_0;
-            case 1:
-                return INT_1;
-            case 2:
-                return INT_2;
-            default:
-                return new PrimitiveConstant(Kind.Int, i);
-        }
-    }
-
-    /**
-     * Creates a boxed byte constant.
-     *
-     * @param i the byte value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static Constant forByte(byte i) {
-        return new PrimitiveConstant(Kind.Byte, i);
-    }
-
-    /**
-     * Creates a boxed boolean constant.
-     *
-     * @param i the boolean value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static Constant forBoolean(boolean i) {
-        return i ? TRUE : FALSE;
-    }
-
-    /**
-     * Creates a boxed char constant.
-     *
-     * @param i the char value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static Constant forChar(char i) {
-        return new PrimitiveConstant(Kind.Char, i);
-    }
-
-    /**
-     * Creates a boxed short constant.
-     *
-     * @param i the short value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static Constant forShort(short i) {
-        return new PrimitiveConstant(Kind.Short, i);
-    }
-
-    /**
-     * Creates a {@link Constant} from a primitive integer of a certain kind.
-     */
-    public static Constant forIntegerKind(Kind kind, long i) {
-        switch (kind) {
-            case Byte:
-                return new PrimitiveConstant(kind, (byte) i);
-            case Short:
-                return new PrimitiveConstant(kind, (short) i);
-            case Char:
-                return new PrimitiveConstant(kind, (char) i);
-            case Int:
-                return new PrimitiveConstant(kind, (int) i);
-            case Long:
-                return new PrimitiveConstant(kind, i);
-            default:
-                throw new IllegalArgumentException("not an integer kind: " + kind);
-        }
-    }
-
-    /**
-     * Creates a {@link Constant} from a primitive integer of a certain width.
-     */
-    public static Constant forPrimitiveInt(int bits, long i) {
-        assert bits <= 64;
-        switch (bits) {
-            case 1:
-                return forBoolean(i != 0);
-            case 8:
-                return forByte((byte) i);
-            case 16:
-                return forShort((short) i);
-            case 32:
-                return forInt((int) i);
-            case 64:
-                return forLong(i);
-            default:
-                throw new IllegalArgumentException("unsupported integer width: " + bits);
-        }
-    }
-
-    /**
-     * Creates a boxed constant for the given boxed primitive value.
-     *
-     * @param value the Java boxed value
-     * @return the primitive constant holding the {@code value}
-     */
-    public static Constant forBoxedPrimitive(Object value) {
-        if (value instanceof Boolean) {
-            return forBoolean((Boolean) value);
-        } else if (value instanceof Byte) {
-            return forByte((Byte) value);
-        } else if (value instanceof Character) {
-            return forChar((Character) value);
-        } else if (value instanceof Short) {
-            return forShort((Short) value);
-        } else if (value instanceof Integer) {
-            return forInt((Integer) value);
-        } else if (value instanceof Long) {
-            return forLong((Long) value);
-        } else if (value instanceof Float) {
-            return forFloat((Float) value);
-        } else if (value instanceof Double) {
-            return forDouble((Double) value);
-        } else {
-            return null;
-        }
-    }
-
-    public static Constant forIllegal() {
-        return new PrimitiveConstant(Kind.Illegal, 0);
-    }
-
-    /**
-     * Returns a constant with the default value for the given kind.
-     */
-    public static Constant defaultForKind(Kind kind) {
-        switch (kind) {
-            case Boolean:
-                return FALSE;
-            case Byte:
-                return forByte((byte) 0);
-            case Char:
-                return forChar((char) 0);
-            case Short:
-                return forShort((short) 0);
-            case Int:
-                return INT_0;
-            case Double:
-                return DOUBLE_0;
-            case Float:
-                return FLOAT_0;
-            case Long:
-                return LONG_0;
-            case Object:
-                return NULL_OBJECT;
-            default:
-                throw new IllegalArgumentException(kind.toString());
-        }
-    }
-
-    /**
-     * Returns the zero value for a given numeric kind.
-     */
-    public static Constant zero(Kind kind) {
-        switch (kind) {
-            case Boolean:
-                return FALSE;
-            case Byte:
-                return forByte((byte) 0);
-            case Char:
-                return forChar((char) 0);
-            case Double:
-                return DOUBLE_0;
-            case Float:
-                return FLOAT_0;
-            case Int:
-                return INT_0;
-            case Long:
-                return LONG_0;
-            case Short:
-                return forShort((short) 0);
-            default:
-                throw new IllegalArgumentException(kind.toString());
-        }
-    }
-
-    /**
-     * Returns the one value for a given numeric kind.
-     */
-    public static Constant one(Kind kind) {
-        switch (kind) {
-            case Boolean:
-                return TRUE;
-            case Byte:
-                return forByte((byte) 1);
-            case Char:
-                return forChar((char) 1);
-            case Double:
-                return DOUBLE_1;
-            case Float:
-                return FLOAT_1;
-            case Int:
-                return INT_1;
-            case Long:
-                return LONG_1;
-            case Short:
-                return forShort((short) 1);
-            default:
-                throw new IllegalArgumentException(kind.toString());
-        }
-    }
-
-    /**
-     * Adds two numeric constants.
-     */
-    public static Constant add(Constant x, Constant y) {
-        assert x.getKind() == y.getKind();
-        switch (x.getKind()) {
-            case Byte:
-                return forByte((byte) (x.asInt() + y.asInt()));
-            case Char:
-                return forChar((char) (x.asInt() + y.asInt()));
-            case Double:
-                return forDouble(x.asDouble() + y.asDouble());
-            case Float:
-                return forFloat(x.asFloat() + y.asFloat());
-            case Int:
-                return forInt(x.asInt() + y.asInt());
-            case Long:
-                return forLong(x.asLong() + y.asLong());
-            case Short:
-                return forShort((short) (x.asInt() + y.asInt()));
-            default:
-                throw new IllegalArgumentException(x.getKind().toString());
-        }
-    }
-
-    /**
-     * Multiplies two numeric constants.
-     */
-    public static Constant mul(Constant x, Constant y) {
-        assert x.getKind() == y.getKind();
-        switch (x.getKind()) {
-            case Byte:
-                return forByte((byte) (x.asInt() * y.asInt()));
-            case Char:
-                return forChar((char) (x.asInt() * y.asInt()));
-            case Double:
-                return forDouble(x.asDouble() * y.asDouble());
-            case Float:
-                return forFloat(x.asFloat() * y.asFloat());
-            case Int:
-                return forInt(x.asInt() * y.asInt());
-            case Long:
-                return forLong(x.asLong() * y.asLong());
-            case Short:
-                return forShort((short) (x.asInt() * y.asInt()));
-            default:
-                throw new IllegalArgumentException(x.getKind().toString());
-        }
-    }
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -117,5 +117,5 @@
      *            {@code -1}
      * @return the appendix if it exists and is resolved or {@code null}
      */
-    Constant lookupAppendix(int cpi, int opcode);
+    JavaConstant lookupAppendix(int cpi, int opcode);
 }
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantReflectionProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantReflectionProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -23,8 +23,8 @@
 package com.oracle.graal.api.meta;
 
 /**
- * Reflection operations on values represented as {@linkplain Constant constants}. All methods in
- * this interface require the VM to access the actual object encapsulated in {@link Kind#Object
+ * Reflection operations on values represented as {@linkplain JavaConstant constants}. All methods
+ * in this interface require the VM to access the actual object encapsulated in {@link Kind#Object
  * object} constants. This access is not always possible, depending on kind of VM and the state that
  * the VM is in. Therefore, all methods can return {@code null} at any time, to indicate that the
  * result is not available at this point. The caller is responsible to check for {@code null}
@@ -38,20 +38,20 @@
      * {@link Boolean#FALSE false} if they are different. Returns {@code null} if the constants
      * cannot be compared at this point.
      */
-    Boolean constantEquals(Constant x, Constant y);
+    Boolean constantEquals(JavaConstant x, JavaConstant y);
 
     /**
      * Returns the length of the array constant. Returns {@code null} if the constant is not an
      * array, or if the array length is not available at this point.
      */
-    Integer readArrayLength(Constant array);
+    Integer readArrayLength(JavaConstant array);
 
     /**
      * Reads a value from the given array at the given index. Returns {@code null} if the constant
      * is not an array, if the index is out of bounds, or if the value is not available at this
      * point.
      */
-    Constant readArrayElement(Constant array, int index);
+    JavaConstant readArrayElement(JavaConstant array, int index);
 
     /**
      * Reads a value of this kind using a base address and a displacement. No bounds checking or
@@ -59,21 +59,21 @@
      *
      * @param base the base address from which the value is read.
      * @param displacement the displacement within the object in bytes
-     * @return the read value encapsulated in a {@link Constant} object, or {@code null} if the
+     * @return the read value encapsulated in a {@link JavaConstant} object, or {@code null} if the
      *         value cannot be read.
      */
-    Constant readUnsafeConstant(Kind kind, Constant base, long displacement);
+    JavaConstant readUnsafeConstant(Kind kind, JavaConstant base, long displacement);
 
     /**
      * Reads a primitive value using a base address and a displacement.
      *
-     * @param kind the {@link Kind} of the returned {@link Constant} object
+     * @param kind the {@link Kind} of the returned {@link JavaConstant} object
      * @param base the base address from which the value is read
      * @param displacement the displacement within the object in bytes
      * @param bits the number of bits to read from memory
-     * @return the read value encapsulated in a {@link Constant} object of {@link Kind} kind
+     * @return the read value encapsulated in a {@link JavaConstant} object of {@link Kind} kind
      */
-    Constant readRawConstant(Kind kind, Constant base, long displacement, int bits);
+    JavaConstant readRawConstant(Kind kind, JavaConstant base, long displacement, int bits);
 
     /**
      * Converts the given {@link Kind#isPrimitive() primitive} constant to a boxed
@@ -81,7 +81,7 @@
      * if the source is is not a primitive constant, or the boxed value is not available at this
      * point.
      */
-    Constant boxPrimitive(Constant source);
+    JavaConstant boxPrimitive(JavaConstant source);
 
     /**
      * Converts the given {@link Kind#Object object} constant to a {@link Kind#isPrimitive()
@@ -89,12 +89,12 @@
      * is is not an object constant that can be unboxed, or the unboxed value is not available at
      * this point.
      */
-    Constant unboxPrimitive(Constant source);
+    JavaConstant unboxPrimitive(JavaConstant source);
 
     /**
      * Returns the {@link ResolvedJavaType} for a {@link Class} object (or any other object regarded
      * as a class by the VM) encapsulated in the given constant. Returns {@code null} if the
      * constant does not encapsulate a class, or if the type is not available at this point.
      */
-    ResolvedJavaType asJavaType(Constant constant);
+    ResolvedJavaType asJavaType(JavaConstant constant);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaConstant.java	Thu Oct 30 12:21:07 2014 +0100
@@ -0,0 +1,455 @@
+/*
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.api.meta;
+
+/**
+ * Represents a constant (boxed) value, such as an integer, floating point number, or object
+ * reference, within the compiler and across the compiler/runtime interface. Exports a set of
+ * {@code Constant} instances that represent frequently used constant values, such as
+ * {@link #NULL_OBJECT}.
+ */
+public abstract class JavaConstant extends Value {
+
+    private static final long serialVersionUID = -6355452536852663986L;
+
+    /*
+     * Using a larger cache for integers leads to only a slight increase in cache hit ratio which is
+     * not enough to justify the impact on startup time.
+     */
+    public static final JavaConstant NULL_OBJECT = new NullConstant();
+    public static final JavaConstant INT_MINUS_1 = new PrimitiveConstant(Kind.Int, -1);
+    public static final JavaConstant INT_0 = new PrimitiveConstant(Kind.Int, 0);
+    public static final JavaConstant INT_1 = new PrimitiveConstant(Kind.Int, 1);
+    public static final JavaConstant INT_2 = new PrimitiveConstant(Kind.Int, 2);
+    public static final JavaConstant LONG_0 = new PrimitiveConstant(Kind.Long, 0L);
+    public static final JavaConstant LONG_1 = new PrimitiveConstant(Kind.Long, 1L);
+    public static final JavaConstant FLOAT_0 = new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(0.0F));
+    public static final JavaConstant FLOAT_1 = new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(1.0F));
+    public static final JavaConstant DOUBLE_0 = new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(0.0D));
+    public static final JavaConstant DOUBLE_1 = new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(1.0D));
+    public static final JavaConstant TRUE = new PrimitiveConstant(Kind.Boolean, 1L);
+    public static final JavaConstant FALSE = new PrimitiveConstant(Kind.Boolean, 0L);
+
+    protected JavaConstant(LIRKind kind) {
+        super(kind);
+    }
+
+    /**
+     * Checks whether this constant is null.
+     *
+     * @return {@code true} if this constant is the null constant
+     */
+    public abstract boolean isNull();
+
+    /**
+     * Checks whether this constant is non-null.
+     *
+     * @return {@code true} if this constant is a primitive, or an object constant that is not null
+     */
+    public final boolean isNonNull() {
+        return !isNull();
+    }
+
+    /**
+     * Checks whether this constant is the default value for its kind (null, 0, 0.0, false).
+     *
+     * @return {@code true} if this constant is the default value for its kind
+     */
+    public abstract boolean isDefaultForKind();
+
+    /**
+     * Returns the value of this constant as a boxed Java value.
+     *
+     * @return the value of this constant
+     */
+    public abstract Object asBoxedPrimitive();
+
+    /**
+     * Returns the primitive int value this constant represents. The constant must have a
+     * {@link Kind#getStackKind()} of {@link Kind#Int}.
+     *
+     * @return the constant value
+     */
+    public abstract int asInt();
+
+    /**
+     * Returns the primitive boolean value this constant represents. The constant must have kind
+     * {@link Kind#Boolean}.
+     *
+     * @return the constant value
+     */
+    public abstract boolean asBoolean();
+
+    /**
+     * Returns the primitive long value this constant represents. The constant must have kind
+     * {@link Kind#Long}, a {@link Kind#getStackKind()} of {@link Kind#Int}.
+     *
+     * @return the constant value
+     */
+    public abstract long asLong();
+
+    /**
+     * Returns the primitive float value this constant represents. The constant must have kind
+     * {@link Kind#Float}.
+     *
+     * @return the constant value
+     */
+    public abstract float asFloat();
+
+    /**
+     * Returns the primitive double value this constant represents. The constant must have kind
+     * {@link Kind#Double}.
+     *
+     * @return the constant value
+     */
+    public abstract double asDouble();
+
+    public String toValueString() {
+        if (getKind() == Kind.Illegal) {
+            return "illegal";
+        } else {
+            return getKind().format(asBoxedPrimitive());
+        }
+    }
+
+    @Override
+    public String toString() {
+        if (getKind() == Kind.Illegal) {
+            return "illegal";
+        } else {
+            return getKind().getJavaName() + "[" + toValueString() + "]";
+        }
+    }
+
+    /**
+     * Creates a boxed double constant.
+     *
+     * @param d the double value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static JavaConstant forDouble(double d) {
+        if (Double.compare(0.0D, d) == 0) {
+            return DOUBLE_0;
+        }
+        if (Double.compare(d, 1.0D) == 0) {
+            return DOUBLE_1;
+        }
+        return new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(d));
+    }
+
+    /**
+     * Creates a boxed float constant.
+     *
+     * @param f the float value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static JavaConstant forFloat(float f) {
+        if (Float.compare(f, 0.0F) == 0) {
+            return FLOAT_0;
+        }
+        if (Float.compare(f, 1.0F) == 0) {
+            return FLOAT_1;
+        }
+        return new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(f));
+    }
+
+    /**
+     * Creates a boxed long constant.
+     *
+     * @param i the long value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static JavaConstant forLong(long i) {
+        if (i == 0) {
+            return LONG_0;
+        } else if (i == 1) {
+            return LONG_1;
+        } else {
+            return new PrimitiveConstant(Kind.Long, i);
+        }
+    }
+
+    /**
+     * Creates a boxed integer constant.
+     *
+     * @param i the integer value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static JavaConstant forInt(int i) {
+        switch (i) {
+            case -1:
+                return INT_MINUS_1;
+            case 0:
+                return INT_0;
+            case 1:
+                return INT_1;
+            case 2:
+                return INT_2;
+            default:
+                return new PrimitiveConstant(Kind.Int, i);
+        }
+    }
+
+    /**
+     * Creates a boxed byte constant.
+     *
+     * @param i the byte value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static JavaConstant forByte(byte i) {
+        return new PrimitiveConstant(Kind.Byte, i);
+    }
+
+    /**
+     * Creates a boxed boolean constant.
+     *
+     * @param i the boolean value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static JavaConstant forBoolean(boolean i) {
+        return i ? TRUE : FALSE;
+    }
+
+    /**
+     * Creates a boxed char constant.
+     *
+     * @param i the char value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static JavaConstant forChar(char i) {
+        return new PrimitiveConstant(Kind.Char, i);
+    }
+
+    /**
+     * Creates a boxed short constant.
+     *
+     * @param i the short value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static JavaConstant forShort(short i) {
+        return new PrimitiveConstant(Kind.Short, i);
+    }
+
+    /**
+     * Creates a {@link JavaConstant} from a primitive integer of a certain kind.
+     */
+    public static JavaConstant forIntegerKind(Kind kind, long i) {
+        switch (kind) {
+            case Byte:
+                return new PrimitiveConstant(kind, (byte) i);
+            case Short:
+                return new PrimitiveConstant(kind, (short) i);
+            case Char:
+                return new PrimitiveConstant(kind, (char) i);
+            case Int:
+                return new PrimitiveConstant(kind, (int) i);
+            case Long:
+                return new PrimitiveConstant(kind, i);
+            default:
+                throw new IllegalArgumentException("not an integer kind: " + kind);
+        }
+    }
+
+    /**
+     * Creates a {@link JavaConstant} from a primitive integer of a certain width.
+     */
+    public static JavaConstant forPrimitiveInt(int bits, long i) {
+        assert bits <= 64;
+        switch (bits) {
+            case 1:
+                return forBoolean(i != 0);
+            case 8:
+                return forByte((byte) i);
+            case 16:
+                return forShort((short) i);
+            case 32:
+                return forInt((int) i);
+            case 64:
+                return forLong(i);
+            default:
+                throw new IllegalArgumentException("unsupported integer width: " + bits);
+        }
+    }
+
+    /**
+     * Creates a boxed constant for the given boxed primitive value.
+     *
+     * @param value the Java boxed value
+     * @return the primitive constant holding the {@code value}
+     */
+    public static JavaConstant forBoxedPrimitive(Object value) {
+        if (value instanceof Boolean) {
+            return forBoolean((Boolean) value);
+        } else if (value instanceof Byte) {
+            return forByte((Byte) value);
+        } else if (value instanceof Character) {
+            return forChar((Character) value);
+        } else if (value instanceof Short) {
+            return forShort((Short) value);
+        } else if (value instanceof Integer) {
+            return forInt((Integer) value);
+        } else if (value instanceof Long) {
+            return forLong((Long) value);
+        } else if (value instanceof Float) {
+            return forFloat((Float) value);
+        } else if (value instanceof Double) {
+            return forDouble((Double) value);
+        } else {
+            return null;
+        }
+    }
+
+    public static JavaConstant forIllegal() {
+        return new PrimitiveConstant(Kind.Illegal, 0);
+    }
+
+    /**
+     * Returns a constant with the default value for the given kind.
+     */
+    public static JavaConstant defaultForKind(Kind kind) {
+        switch (kind) {
+            case Boolean:
+                return FALSE;
+            case Byte:
+                return forByte((byte) 0);
+            case Char:
+                return forChar((char) 0);
+            case Short:
+                return forShort((short) 0);
+            case Int:
+                return INT_0;
+            case Double:
+                return DOUBLE_0;
+            case Float:
+                return FLOAT_0;
+            case Long:
+                return LONG_0;
+            case Object:
+                return NULL_OBJECT;
+            default:
+                throw new IllegalArgumentException(kind.toString());
+        }
+    }
+
+    /**
+     * Returns the zero value for a given numeric kind.
+     */
+    public static JavaConstant zero(Kind kind) {
+        switch (kind) {
+            case Boolean:
+                return FALSE;
+            case Byte:
+                return forByte((byte) 0);
+            case Char:
+                return forChar((char) 0);
+            case Double:
+                return DOUBLE_0;
+            case Float:
+                return FLOAT_0;
+            case Int:
+                return INT_0;
+            case Long:
+                return LONG_0;
+            case Short:
+                return forShort((short) 0);
+            default:
+                throw new IllegalArgumentException(kind.toString());
+        }
+    }
+
+    /**
+     * Returns the one value for a given numeric kind.
+     */
+    public static JavaConstant one(Kind kind) {
+        switch (kind) {
+            case Boolean:
+                return TRUE;
+            case Byte:
+                return forByte((byte) 1);
+            case Char:
+                return forChar((char) 1);
+            case Double:
+                return DOUBLE_1;
+            case Float:
+                return FLOAT_1;
+            case Int:
+                return INT_1;
+            case Long:
+                return LONG_1;
+            case Short:
+                return forShort((short) 1);
+            default:
+                throw new IllegalArgumentException(kind.toString());
+        }
+    }
+
+    /**
+     * Adds two numeric constants.
+     */
+    public static JavaConstant add(JavaConstant x, JavaConstant y) {
+        assert x.getKind() == y.getKind();
+        switch (x.getKind()) {
+            case Byte:
+                return forByte((byte) (x.asInt() + y.asInt()));
+            case Char:
+                return forChar((char) (x.asInt() + y.asInt()));
+            case Double:
+                return forDouble(x.asDouble() + y.asDouble());
+            case Float:
+                return forFloat(x.asFloat() + y.asFloat());
+            case Int:
+                return forInt(x.asInt() + y.asInt());
+            case Long:
+                return forLong(x.asLong() + y.asLong());
+            case Short:
+                return forShort((short) (x.asInt() + y.asInt()));
+            default:
+                throw new IllegalArgumentException(x.getKind().toString());
+        }
+    }
+
+    /**
+     * Multiplies two numeric constants.
+     */
+    public static JavaConstant mul(JavaConstant x, JavaConstant y) {
+        assert x.getKind() == y.getKind();
+        switch (x.getKind()) {
+            case Byte:
+                return forByte((byte) (x.asInt() * y.asInt()));
+            case Char:
+                return forChar((char) (x.asInt() * y.asInt()));
+            case Double:
+                return forDouble(x.asDouble() * y.asDouble());
+            case Float:
+                return forFloat(x.asFloat() * y.asFloat());
+            case Int:
+                return forInt(x.asInt() * y.asInt());
+            case Long:
+                return forLong(x.asLong() * y.asLong());
+            case Short:
+                return forShort((short) (x.asInt() * y.asInt()));
+            default:
+                throw new IllegalArgumentException(x.getKind().toString());
+        }
+    }
+}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -437,20 +437,20 @@
         }
     }
 
-    public Constant getDefaultValue() {
+    public JavaConstant getDefaultValue() {
         switch (this) {
             case Boolean:
-                return Constant.FALSE;
+                return JavaConstant.FALSE;
             case Int:
-                return Constant.INT_0;
+                return JavaConstant.INT_0;
             case Long:
-                return Constant.LONG_0;
+                return JavaConstant.LONG_0;
             case Float:
-                return Constant.FLOAT_0;
+                return JavaConstant.FLOAT_0;
             case Double:
-                return Constant.DOUBLE_0;
+                return JavaConstant.DOUBLE_0;
             case Object:
-                return Constant.NULL_OBJECT;
+                return JavaConstant.NULL_OBJECT;
             case Byte:
             case Char:
             case Short:
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,11 +67,11 @@
     ResolvedJavaField lookupJavaField(Field reflectionField);
 
     /**
-     * Returns the resolved Java type of the given {@link Constant} object.
+     * Returns the resolved Java type of the given {@link JavaConstant} object.
      *
      * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()}
      */
-    ResolvedJavaType lookupJavaType(Constant constant);
+    ResolvedJavaType lookupJavaType(JavaConstant constant);
 
     /**
      * Returns the number of bytes occupied by this constant value or constant object.
@@ -79,7 +79,7 @@
      * @param constant the constant whose bytes should be measured
      * @return the number of bytes occupied by this constant
      */
-    long getMemorySize(Constant constant);
+    long getMemorySize(JavaConstant constant);
 
     /**
      * Parses a <a
@@ -98,11 +98,11 @@
      *
      * @return the encoded value as an integer
      */
-    Constant encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason, int debugId);
+    JavaConstant encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason, int debugId);
 
-    DeoptimizationReason decodeDeoptReason(Constant constant);
+    DeoptimizationReason decodeDeoptReason(JavaConstant constant);
 
-    DeoptimizationAction decodeDeoptAction(Constant constant);
+    DeoptimizationAction decodeDeoptAction(JavaConstant constant);
 
-    int decodeDebugId(Constant constant);
+    int decodeDebugId(JavaConstant constant);
 }
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,9 +49,9 @@
      * @param printTopN print total size and instance count of the top n classes is desired
      * @return the number of bytes occupied by this constant
      */
-    public static long getMemorySizeRecursive(MetaAccessProvider access, ConstantReflectionProvider constantReflection, Constant constant, PrintStream out, int printTopN) {
-        Set<Constant> marked = new HashSet<>();
-        Stack<Constant> stack = new Stack<>();
+    public static long getMemorySizeRecursive(MetaAccessProvider access, ConstantReflectionProvider constantReflection, JavaConstant constant, PrintStream out, int printTopN) {
+        Set<JavaConstant> marked = new HashSet<>();
+        Stack<JavaConstant> stack = new Stack<>();
         if (constant.getKind() == Kind.Object && constant.isNonNull()) {
             marked.add(constant);
         }
@@ -59,7 +59,7 @@
         stack.push(constant);
         long sum = 0;
         while (!stack.isEmpty()) {
-            Constant c = stack.pop();
+            JavaConstant c = stack.pop();
             long memorySize = access.getMemorySize(constant);
             sum += memorySize;
             if (c.getKind() == Kind.Object && c.isNonNull()) {
@@ -75,7 +75,7 @@
                     if (!type.getComponentType().isPrimitive()) {
                         int length = constantReflection.readArrayLength(c);
                         for (int i = 0; i < length; i++) {
-                            Constant value = constantReflection.readArrayElement(c, i);
+                            JavaConstant value = constantReflection.readArrayElement(c, i);
                             pushConstant(marked, stack, value);
                         }
                     }
@@ -83,7 +83,7 @@
                     ResolvedJavaField[] instanceFields = type.getInstanceFields(true);
                     for (ResolvedJavaField f : instanceFields) {
                         if (f.getKind() == Kind.Object) {
-                            Constant value = f.readValue(c);
+                            JavaConstant value = f.readValue(c);
                             pushConstant(marked, stack, value);
                         }
                     }
@@ -120,7 +120,7 @@
         return sum;
     }
 
-    private static void pushConstant(Set<Constant> marked, Stack<Constant> stack, Constant value) {
+    private static void pushConstant(Set<JavaConstant> marked, Stack<JavaConstant> stack, JavaConstant value) {
         if (value.isNonNull()) {
             if (!marked.contains(value)) {
                 marked.add(value);
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NullConstant.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NullConstant.java	Thu Oct 30 12:21:07 2014 +0100
@@ -23,9 +23,9 @@
 package com.oracle.graal.api.meta;
 
 /**
- * The implementation type of the {@link Constant#NULL_OBJECT null constant}.
+ * The implementation type of the {@link JavaConstant#NULL_OBJECT null constant}.
  */
-final class NullConstant extends Constant {
+final class NullConstant extends JavaConstant {
 
     private static final long serialVersionUID = 8906209595800783961L;
 
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PlatformKind.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PlatformKind.java	Thu Oct 30 12:21:07 2014 +0100
@@ -29,7 +29,7 @@
 
     String name();
 
-    Constant getDefaultValue();
+    JavaConstant getDefaultValue();
 
     default int getVectorLength() {
         return 1;
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PrimitiveConstant.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PrimitiveConstant.java	Thu Oct 30 12:21:07 2014 +0100
@@ -26,7 +26,7 @@
  * Represents a primitive constant value, such as an integer or floating point number, within the
  * compiler and across the compiler/runtime interface.
  */
-public class PrimitiveConstant extends Constant {
+public class PrimitiveConstant extends JavaConstant {
 
     private static final long serialVersionUID = 8787949721295655376L;
 
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaField.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaField.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,19 +60,19 @@
      * @return the constant value of this field or {@code null} if this field is not considered
      *         constant by the runtime
      */
-    Constant readConstantValue(Constant receiver);
+    JavaConstant readConstantValue(JavaConstant receiver);
 
     /**
      * Gets the current value of this field for a given object, if available. There is no guarantee
      * that the same value will be returned by this method for a field unless the field is
-     * considered to be {@linkplain #readConstantValue(Constant) constant} by the runtime.
+     * considered to be {@linkplain #readConstantValue(JavaConstant) constant} by the runtime.
      *
      * @param receiver object from which this field's value is to be read. This value is ignored if
      *            this field is static.
      * @return the value of this field or {@code null} if the value is not available (e.g., because
      *         the field holder is not yet initialized).
      */
-    Constant readValue(Constant receiver);
+    JavaConstant readValue(JavaConstant receiver);
 
     /**
      * Returns the {@link ResolvedJavaType} object representing the class or interface that declares
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -204,7 +204,7 @@
      * @return The value returned by the method invocation, or {@code null} if the return type is
      *         {@code void}.
      */
-    Constant invoke(Constant receiver, Constant[] arguments);
+    JavaConstant invoke(JavaConstant receiver, JavaConstant[] arguments);
 
     /**
      * Uses the constructor represented by this object to create and initialize a new instance of
@@ -214,14 +214,14 @@
      * @param arguments The arguments for the constructor.
      * @return The newly created and initialized object.
      */
-    Constant newInstance(Constant[] arguments);
+    JavaConstant newInstance(JavaConstant[] arguments);
 
     /**
      * Gets the encoding of (that is, a constant representing the value of) this method.
      *
      * @return a constant representing a reference to this method
      */
-    Constant getEncoding();
+    JavaConstant getEncoding();
 
     /**
      * Checks if this method is present in the virtual table for subtypes of the specified
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
      * @param r the part of this type
      * @return a constant representing a reference to the specified part of this type
      */
-    Constant getEncoding(Representation r);
+    JavaConstant getEncoding(Representation r);
 
     /**
      * Checks whether this type has a finalizer method.
@@ -154,7 +154,7 @@
      * @param obj the object to test
      * @return {@code true} if the object is an instance of this type
      */
-    boolean isInstance(Constant obj);
+    boolean isInstance(JavaConstant obj);
 
     /**
      * Returns this type if it is an exact type otherwise returns null. This type is exact if it is
@@ -343,7 +343,7 @@
      * Creates a new array with this type as the component type and the specified length. This
      * method is similar to {@link Array#newInstance(Class, int)}.
      */
-    Constant newArray(int length);
+    JavaConstant newArray(int length);
 
     /**
      * Returns true if this type represents and interface and it should be trusted even in places
--- a/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodHandleAccessProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodHandleAccessProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -66,7 +66,7 @@
      * interpreter overhead. If the parameter forceBytecodeGeneration is set to true, the VM should
      * try to generate bytecodes before this method returns.
      */
-    ResolvedJavaMethod resolveInvokeBasicTarget(Constant methodHandle, boolean forceBytecodeGeneration);
+    ResolvedJavaMethod resolveInvokeBasicTarget(JavaConstant methodHandle, boolean forceBytecodeGeneration);
 
     /**
      * Resolves the invocation target for an invocation of a {@code MethodHandle.linkTo*} method
@@ -74,5 +74,5 @@
      * {@code linkTo*} method. Returns {@code null} if the invocation target is not available at
      * this time.
      */
-    ResolvedJavaMethod resolveLinkToTarget(Constant memberName);
+    ResolvedJavaMethod resolveLinkToTarget(JavaConstant memberName);
 }
--- a/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -25,9 +25,9 @@
 import com.oracle.graal.api.meta.*;
 
 /**
- * Reflection operations on values represented as {@linkplain Constant constants} for the processing
- * of snippets. Snippets need a direct access to the value of object constants, which is not allowed
- * in other parts of Graal to enforce compiler-VM separation.
+ * Reflection operations on values represented as {@linkplain JavaConstant constants} for the
+ * processing of snippets. Snippets need a direct access to the value of object constants, which is
+ * not allowed in other parts of Graal to enforce compiler-VM separation.
  * <p>
  * This interface must not be used in Graal code that is not related to snippet processing.
  */
@@ -39,7 +39,7 @@
      * @param object the object value to box
      * @return a constant containing {@code object}
      */
-    Constant forObject(Object object);
+    JavaConstant forObject(Object object);
 
     /**
      * Returns the object reference the given constant represents. The constant must have kind
@@ -48,7 +48,7 @@
      * @param constant the to access
      * @return the object value of the constant
      */
-    Object asObject(Constant constant);
+    Object asObject(JavaConstant constant);
 
     /**
      * Creates a boxed constant for the given kind from an Object. The object needs to be of the
@@ -58,7 +58,7 @@
      * @param value the Java boxed value: a {@link Byte} instance for {@link Kind#Byte}, etc.
      * @return the boxed copy of {@code value}
      */
-    Constant forBoxed(Kind kind, Object value);
+    JavaConstant forBoxed(Kind kind, Object value);
 
     /**
      * Returns the value of this constant as a boxed Java value.
@@ -66,5 +66,5 @@
      * @param constant the constant to box
      * @return the value of the constant
      */
-    Object asBoxedValue(Constant constant);
+    Object asBoxedValue(JavaConstant constant);
 }
--- a/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/SimpleAssemblerTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/SimpleAssemblerTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -67,7 +67,7 @@
             public byte[] generateCode(CompilationResult compResult, TargetDescription target, RegisterConfig registerConfig, CallingConvention cc) {
                 AMD64MacroAssembler asm = new AMD64MacroAssembler(target, registerConfig);
                 Register ret = registerConfig.getReturnRegister(Kind.Double);
-                Data data = new Data(8, 8, DataBuilder.primitive((PrimitiveConstant) Constant.forDouble(84.72)));
+                Data data = new Data(8, 8, DataBuilder.primitive((PrimitiveConstant) JavaConstant.forDouble(84.72)));
                 DataSectionReference ref = compResult.getDataSection().insertData(data);
                 compResult.recordDataPatch(asm.position(), ref);
                 asm.movdbl(ret, asm.getPlaceholder());
--- a/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,7 +86,7 @@
      * @param a the destination register
      * @param src the Object Constant being moved
      */
-    public abstract void mov(Register a, Constant src);
+    public abstract void mov(Register a, JavaConstant src);
 
     private static String getBitTypeFromKind(Kind kind) {
         switch (kind) {
@@ -373,7 +373,7 @@
         if (!isConstant(src)) {
             return HSAIL.mapRegister(src);
         } else {
-            Constant consrc = asConstant(src);
+            JavaConstant consrc = asConstant(src);
             switch (src.getKind()) {
                 case Boolean:
                 case Int:
@@ -503,13 +503,13 @@
         assert (!isConstant(result));
         if (base == 0) {
             // we don't have to test for null if shl is the only operation
-            emitForceUnsignedKind("shl", Kind.Long, result, result, Constant.forInt(shift));
+            emitForceUnsignedKind("shl", Kind.Long, result, result, JavaConstant.forInt(shift));
         } else if (shift == 0) {
             // only use add if result is not starting as null (test only if testForNull is true)
-            emitWithOptionalTestForNull(testForNull, "add", result, result, Constant.forLong(base));
+            emitWithOptionalTestForNull(testForNull, "add", result, result, JavaConstant.forLong(base));
         } else {
             // only use mad if result is not starting as null (test only if testForNull is true)
-            emitWithOptionalTestForNull(testForNull, "mad", result, result, Constant.forInt(1 << shift), Constant.forLong(base));
+            emitWithOptionalTestForNull(testForNull, "mad", result, result, JavaConstant.forInt(1 << shift), JavaConstant.forLong(base));
         }
     }
 
@@ -530,11 +530,11 @@
         assert (!isConstant(result));
         if (base != 0) {
             // only use sub if result is not starting as null (test only if testForNull is true)
-            emitWithOptionalTestForNull(testForNull, "sub", result, result, Constant.forLong(base));
+            emitWithOptionalTestForNull(testForNull, "sub", result, result, JavaConstant.forLong(base));
         }
         if (shift != 0) {
             // note that the shr can still be done even if the result is null
-            emitForceUnsignedKind("shr", Kind.Long, result, result, Constant.forInt(shift));
+            emitForceUnsignedKind("shr", Kind.Long, result, result, JavaConstant.forInt(shift));
         }
     }
 
@@ -550,11 +550,11 @@
      */
     private void emitWithOptionalTestForNull(boolean testForNull, String mnemonic, Value result, Value... sources) {
         if (testForNull) {
-            emitCompare(Kind.Long, result, Constant.forLong(0), "eq", false, true);
+            emitCompare(Kind.Long, result, JavaConstant.forLong(0), "eq", false, true);
         }
         emitForceUnsigned(mnemonic, result, sources);
         if (testForNull) {
-            emitConditionalMove(result, Constant.forLong(0), result, 64);
+            emitConditionalMove(result, JavaConstant.forLong(0), result, 64);
         }
     }
 
@@ -638,7 +638,7 @@
         // emitString(String.format("maxwaveid_u32 %s;", HSAIL.mapRegister(dest)));
         int hardCodedMaxWaveId = 36;
         emitComment("// Hard-coded maxwaveid=" + hardCodedMaxWaveId + " until it works");
-        emitMov(Kind.Int, dest, Constant.forInt(hardCodedMaxWaveId));
+        emitMov(Kind.Int, dest, JavaConstant.forInt(hardCodedMaxWaveId));
     }
 
     public void emitMultiplyByWavesize(Value dest) {
--- a/graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAssembler.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAssembler.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -177,7 +177,7 @@
         }
 
         public String emitConstant(Value v, boolean comma) {
-            Constant constant = (Constant) v;
+            JavaConstant constant = (JavaConstant) v;
             String str = null;
 
             switch (v.getKind().getTypeChar()) {
@@ -288,7 +288,7 @@
         }
 
         public String emitConstant(Value v) {
-            Constant constant = (Constant) v;
+            JavaConstant constant = (JavaConstant) v;
 
             switch (v.getKind().getTypeChar()) {
                 case 'i':
@@ -368,8 +368,8 @@
 
         public String emitAddress(Value var, Value val) {
             assert var instanceof Variable;
-            assert val instanceof Constant;
-            Constant constant = (Constant) val;
+            assert val instanceof JavaConstant;
+            JavaConstant constant = (JavaConstant) val;
             return ("[" + ((space == PTXStateSpace.Parameter) ? emitParameter((Variable) var) : emitRegister((Variable) var, false)) + " + " + constant.toValueString() + "]");
         }
 
@@ -651,7 +651,7 @@
         }
 
         public String emitConstant(Value v) {
-            Constant constant = (Constant) v;
+            JavaConstant constant = (JavaConstant) v;
 
             switch (v.getKind().getTypeChar()) {
                 case 'i':
--- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2286,11 +2286,11 @@
         return isSimm(imm, 11);
     }
 
-    public static boolean isSimm11(Constant constant) {
+    public static boolean isSimm11(JavaConstant constant) {
         return constant.isNull() || isSimm11(constant.asLong());
     }
 
-    public static boolean isSimm5(Constant constant) {
+    public static boolean isSimm5(JavaConstant constant) {
         return constant.isNull() || isSimm(constant.asLong(), 5);
     }
 
--- a/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java	Thu Oct 30 12:21:07 2014 +0100
@@ -595,7 +595,7 @@
     }
 
     @Override
-    protected Value appendConstant(Constant constant) {
+    protected Value appendConstant(JavaConstant constant) {
         return gen.emitLoadConstant(constant.getLIRKind(), constant);
     }
 
@@ -665,7 +665,7 @@
         Debug.log("moveConstantsToVariables: framestate before: %s", frameState);
         for (int i = 0; i < frameState.stackSize(); i++) {
             Value src = frameState.stackAt(i);
-            if (src instanceof Constant) {
+            if (src instanceof JavaConstant) {
                 AllocatableValue dst = gen.newVariable(src.getLIRKind());
                 gen.emitMove(dst, src);
                 frameState.storeStack(i, dst);
@@ -674,7 +674,7 @@
         }
         for (int i = 0; i < frameState.localsSize(); i++) {
             Value src = frameState.localAt(i);
-            if (src instanceof Constant) {
+            if (src instanceof JavaConstant) {
                 AllocatableValue dst = gen.newVariable(src.getLIRKind());
                 gen.emitMove(dst, src);
                 frameState.storeLocal(i, dst);
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java	Thu Oct 30 12:21:07 2014 +0100
@@ -93,7 +93,7 @@
     }
 
     @Override
-    public boolean canInlineConstant(Constant c) {
+    public boolean canInlineConstant(JavaConstant c) {
         switch (c.getKind()) {
             case Long:
                 return NumUtil.isInt(c.asLong()) && !getCodeCache().needsDataPatch(c);
@@ -152,9 +152,9 @@
                 /* Scale value that architecture cannot handle, so scale manually. */
                 Value longIndex = index.getKind() == Kind.Long ? index : emitSignExtend(index, 32, 64);
                 if (CodeUtil.isPowerOf2(scale)) {
-                    indexRegister = emitShl(longIndex, Constant.forLong(CodeUtil.log2(scale)));
+                    indexRegister = emitShl(longIndex, JavaConstant.forLong(CodeUtil.log2(scale)));
                 } else {
-                    indexRegister = emitMul(longIndex, Constant.forLong(scale));
+                    indexRegister = emitMul(longIndex, JavaConstant.forLong(scale));
                 }
                 scaleEnum = Scale.Times1;
 
@@ -171,7 +171,7 @@
             displacementInt = (int) finalDisp;
         } else {
             displacementInt = 0;
-            AllocatableValue displacementRegister = load(Constant.forLong(finalDisp));
+            AllocatableValue displacementRegister = load(JavaConstant.forLong(finalDisp));
             if (baseRegister.equals(Value.ILLEGAL)) {
                 baseRegister = displacementRegister;
             } else if (indexRegister.equals(Value.ILLEGAL)) {
@@ -315,13 +315,13 @@
             emitCompareRegMemoryOp(cmpKind, left, b, state);
             mirrored = false;
         } else {
-            emitCompareMemoryConOp(cmpKind, b, (Constant) a, state);
+            emitCompareMemoryConOp(cmpKind, b, (JavaConstant) a, state);
             mirrored = true;
         }
         return mirrored;
     }
 
-    protected void emitCompareMemoryConOp(Kind kind, AMD64AddressValue address, Constant value, LIRFrameState state) {
+    protected void emitCompareMemoryConOp(Kind kind, AMD64AddressValue address, JavaConstant value, LIRFrameState state) {
         assert kind.getStackKind() == value.getKind().getStackKind();
         switch (kind) {
             case Byte:
@@ -416,10 +416,10 @@
                 append(new Unary1Op(LNEG, result, input));
                 break;
             case Float:
-                append(new BinaryRegConst(FXOR, result, input, Constant.forFloat(Float.intBitsToFloat(0x80000000))));
+                append(new BinaryRegConst(FXOR, result, input, JavaConstant.forFloat(Float.intBitsToFloat(0x80000000))));
                 break;
             case Double:
-                append(new BinaryRegConst(DXOR, result, input, Constant.forDouble(Double.longBitsToDouble(0x8000000000000000L))));
+                append(new BinaryRegConst(DXOR, result, input, JavaConstant.forDouble(Double.longBitsToDouble(0x8000000000000000L))));
                 break;
             default:
                 throw GraalInternalError.shouldNotReachHere();
@@ -454,7 +454,7 @@
         }
     }
 
-    private Variable emitBinaryConst(AMD64Arithmetic op, boolean commutative, AllocatableValue a, Constant b) {
+    private Variable emitBinaryConst(AMD64Arithmetic op, boolean commutative, AllocatableValue a, JavaConstant b) {
         switch (op) {
             case IADD:
             case LADD:
@@ -937,13 +937,13 @@
             assert inputVal.getKind() == Kind.Long;
             Variable result = newVariable(LIRKind.derive(inputVal).changeType(Kind.Long));
             long mask = CodeUtil.mask(fromBits);
-            append(new BinaryRegConst(AMD64Arithmetic.LAND, result, asAllocatable(inputVal), Constant.forLong(mask)));
+            append(new BinaryRegConst(AMD64Arithmetic.LAND, result, asAllocatable(inputVal), JavaConstant.forLong(mask)));
             return result;
         } else {
             assert inputVal.getKind().getStackKind() == Kind.Int;
             Variable result = newVariable(LIRKind.derive(inputVal).changeType(Kind.Int));
             int mask = (int) CodeUtil.mask(fromBits);
-            append(new BinaryRegConst(AMD64Arithmetic.IAND, result, asAllocatable(inputVal), Constant.forInt(mask)));
+            append(new BinaryRegConst(AMD64Arithmetic.IAND, result, asAllocatable(inputVal), JavaConstant.forInt(mask)));
             if (toBits > 32) {
                 Variable longResult = newVariable(LIRKind.derive(inputVal).changeType(Kind.Long));
                 emitMove(longResult, result);
@@ -1006,7 +1006,7 @@
     @Override
     public Value emitMathAbs(Value input) {
         Variable result = newVariable(LIRKind.derive(input));
-        append(new BinaryRegConst(DAND, result, asAllocatable(input), Constant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL))));
+        append(new BinaryRegConst(DAND, result, asAllocatable(input), JavaConstant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL))));
         return result;
     }
 
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java	Thu Oct 30 12:21:07 2014 +0100
@@ -110,7 +110,7 @@
         Kind kind = getMemoryKind(access);
 
         if (value.isConstant()) {
-            Constant constant = value.asConstant();
+            JavaConstant constant = value.asJavaConstant();
             if (kind == Kind.Long && !NumUtil.isInt(constant.asLong())) {
                 // Only imm32 as long
                 return null;
@@ -145,7 +145,7 @@
                 double trueLabelProbability = ifNode.probability(ifNode.trueSuccessor());
                 Value other;
                 if (value.isConstant()) {
-                    other = value.asConstant();
+                    other = value.asJavaConstant();
                 } else {
                     other = operand(value);
                 }
@@ -165,7 +165,7 @@
             if (kind != kind.getStackKind()) {
                 return null;
             }
-            Constant constant = value.asConstant();
+            JavaConstant constant = value.asJavaConstant();
             if (kind == Kind.Long && !NumUtil.isInt(constant.asLong())) {
                 // Only imm32 as long
                 return null;
@@ -355,7 +355,7 @@
 
     @MatchRule("(Or (LeftShift=lshift value Constant) (UnsignedRightShift=rshift value Constant))")
     public ComplexMatchResult rotateLeftConstant(LeftShiftNode lshift, UnsignedRightShiftNode rshift) {
-        if ((lshift.getShiftAmountMask() & (lshift.getY().asConstant().asInt() + rshift.getY().asConstant().asInt())) == 0) {
+        if ((lshift.getShiftAmountMask() & (lshift.getY().asJavaConstant().asInt() + rshift.getY().asJavaConstant().asInt())) == 0) {
             return builder -> getLIRGeneratorTool().emitRol(operand(lshift.getX()), operand(lshift.getY()));
         }
         return null;
@@ -363,7 +363,7 @@
 
     @MatchRule("(Or (LeftShift value (Sub Constant=delta shiftAmount)) (UnsignedRightShift value shiftAmount))")
     public ComplexMatchResult rotateRightVariable(ValueNode value, ConstantNode delta, ValueNode shiftAmount) {
-        if (delta.asConstant().asLong() == 0 || delta.asConstant().asLong() == 32) {
+        if (delta.asJavaConstant().asLong() == 0 || delta.asJavaConstant().asLong() == 32) {
             return builder -> getLIRGeneratorTool().emitRor(operand(value), operand(shiftAmount));
         }
         return null;
@@ -371,7 +371,7 @@
 
     @MatchRule("(Or (LeftShift value shiftAmount) (UnsignedRightShift value (Sub Constant=delta shiftAmount)))")
     public ComplexMatchResult rotateLeftVariable(ValueNode value, ValueNode shiftAmount, ConstantNode delta) {
-        if (delta.asConstant().asLong() == 0 || delta.asConstant().asLong() == 32) {
+        if (delta.asJavaConstant().asLong() == 0 || delta.asJavaConstant().asLong() == 32) {
             return builder -> getLIRGeneratorTool().emitRol(operand(value), operand(shiftAmount));
         }
         return null;
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java	Thu Oct 30 12:21:07 2014 +0100
@@ -321,7 +321,7 @@
      * @return {@link Boolean#TRUE} if the comparison is known to be true, {@link Boolean#FALSE} if
      *         the comparison is known to be false
      */
-    public boolean foldCondition(Constant lt, Constant rt, ConstantReflectionProvider constantReflection) {
+    public boolean foldCondition(JavaConstant lt, JavaConstant rt, ConstantReflectionProvider constantReflection) {
         assert !lt.getKind().isNumericFloat() && !rt.getKind().isNumericFloat();
         return foldCondition(lt, rt, constantReflection, false);
     }
@@ -336,7 +336,7 @@
      * @return true if the comparison is known to be true, false if the comparison is known to be
      *         false
      */
-    public boolean foldCondition(Constant lt, Constant rt, ConstantReflectionProvider constantReflection, boolean unorderedIsTrue) {
+    public boolean foldCondition(JavaConstant lt, JavaConstant rt, ConstantReflectionProvider constantReflection, boolean unorderedIsTrue) {
         if (lt instanceof PrimitiveConstant) {
             switch (lt.getKind()) {
                 case Boolean:
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -53,7 +53,7 @@
     }
 
     @Override
-    public Stamp constant(Constant c, MetaAccessProvider meta) {
+    public Stamp constant(JavaConstant c, MetaAccessProvider meta) {
         ResolvedJavaType constType = c.isNull() ? null : meta.lookupJavaType(c);
         return copyWith(constType, c.isNonNull(), c.isNonNull(), c.isNull());
     }
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -278,9 +278,9 @@
         }
 
         /**
-         * Apply the operation to a {@link Constant}.
+         * Apply the operation to a {@link JavaConstant}.
          */
-        public abstract Constant foldConstant(Constant value);
+        public abstract JavaConstant foldConstant(JavaConstant value);
 
         /**
          * Apply the operation to a {@link Stamp}.
@@ -359,9 +359,9 @@
         }
 
         /**
-         * Apply the operation to two {@linkplain Constant Constants}.
+         * Apply the operation to two {@linkplain JavaConstant Constants}.
          */
-        public abstract Constant foldConstant(Constant a, Constant b);
+        public abstract JavaConstant foldConstant(JavaConstant a, JavaConstant b);
 
         /**
          * Apply the operation to two {@linkplain Stamp Stamps}.
@@ -388,13 +388,13 @@
         }
 
         /**
-         * Check whether a {@link Constant} is a neutral element for this operation. A neutral
+         * Check whether a {@link JavaConstant} is a neutral element for this operation. A neutral
          * element is any element {@code n} where {@code a . n == a} for all a.
          *
-         * @param n the {@link Constant} that should be tested
+         * @param n the {@link JavaConstant} that should be tested
          * @return true iff for all {@code a}: {@code a . n == a}
          */
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             return false;
         }
 
@@ -407,7 +407,7 @@
          * @return a unique {@code z} such that {@code z == a . a} for each {@code a} in
          *         {@code stamp} if it exists, otherwise {@code null}
          */
-        public Constant getZero(Stamp stamp) {
+        public JavaConstant getZero(Stamp stamp) {
             return null;
         }
     }
@@ -453,7 +453,7 @@
             super(op);
         }
 
-        public abstract Constant foldConstant(int inputBits, int resultBits, Constant value);
+        public abstract JavaConstant foldConstant(int inputBits, int resultBits, JavaConstant value);
 
         public abstract Stamp foldStamp(int inputBits, int resultBits, Stamp stamp);
     }
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -61,7 +61,7 @@
     }
 
     @Override
-    public Stamp constant(Constant c, MetaAccessProvider meta) {
+    public Stamp constant(JavaConstant c, MetaAccessProvider meta) {
         assert c.getKind().isNumericFloat() && c.getKind().getBitCount() == getBits();
         return StampFactory.forConstant(c);
     }
@@ -243,13 +243,13 @@
     }
 
     @Override
-    public Constant asConstant() {
+    public JavaConstant asConstant() {
         if (nonNaN && Double.compare(lowerBound, upperBound) == 0) {
             switch (getBits()) {
                 case 32:
-                    return Constant.forFloat((float) lowerBound);
+                    return JavaConstant.forFloat((float) lowerBound);
                 case 64:
-                    return Constant.forDouble(lowerBound);
+                    return JavaConstant.forDouble(lowerBound);
             }
         }
         return null;
@@ -260,12 +260,12 @@
     new UnaryOp.Neg() {
 
         @Override
-        public Constant foldConstant(Constant value) {
+        public JavaConstant foldConstant(JavaConstant value) {
             switch (value.getKind()) {
                 case Float:
-                    return Constant.forFloat(-value.asFloat());
+                    return JavaConstant.forFloat(-value.asFloat());
                 case Double:
-                    return Constant.forDouble(-value.asDouble());
+                    return JavaConstant.forDouble(-value.asDouble());
                 default:
                     throw GraalInternalError.shouldNotReachHere();
             }
@@ -281,13 +281,13 @@
     new BinaryOp.Add(false, true) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
             switch (a.getKind()) {
                 case Float:
-                    return Constant.forFloat(a.asFloat() + b.asFloat());
+                    return JavaConstant.forFloat(a.asFloat() + b.asFloat());
                 case Double:
-                    return Constant.forDouble(a.asDouble() + b.asDouble());
+                    return JavaConstant.forDouble(a.asDouble() + b.asDouble());
                 default:
                     throw GraalInternalError.shouldNotReachHere();
             }
@@ -300,7 +300,7 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             switch (n.getKind()) {
                 case Float:
                     return Float.compare(n.asFloat(), -0.0f) == 0;
@@ -315,13 +315,13 @@
     new BinaryOp.Sub(false, false) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
             switch (a.getKind()) {
                 case Float:
-                    return Constant.forFloat(a.asFloat() - b.asFloat());
+                    return JavaConstant.forFloat(a.asFloat() - b.asFloat());
                 case Double:
-                    return Constant.forDouble(a.asDouble() - b.asDouble());
+                    return JavaConstant.forDouble(a.asDouble() - b.asDouble());
                 default:
                     throw GraalInternalError.shouldNotReachHere();
             }
@@ -334,7 +334,7 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             switch (n.getKind()) {
                 case Float:
                     return Float.compare(n.asFloat(), 0.0f) == 0;
@@ -349,13 +349,13 @@
     new BinaryOp.Mul(false, true) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
             switch (a.getKind()) {
                 case Float:
-                    return Constant.forFloat(a.asFloat() * b.asFloat());
+                    return JavaConstant.forFloat(a.asFloat() * b.asFloat());
                 case Double:
-                    return Constant.forDouble(a.asDouble() * b.asDouble());
+                    return JavaConstant.forDouble(a.asDouble() * b.asDouble());
                 default:
                     throw GraalInternalError.shouldNotReachHere();
             }
@@ -368,7 +368,7 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             switch (n.getKind()) {
                 case Float:
                     return Float.compare(n.asFloat(), 1.0f) == 0;
@@ -383,13 +383,13 @@
     new BinaryOp.Div(false, false) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
             switch (a.getKind()) {
                 case Float:
-                    return Constant.forFloat(a.asFloat() / b.asFloat());
+                    return JavaConstant.forFloat(a.asFloat() / b.asFloat());
                 case Double:
-                    return Constant.forDouble(a.asDouble() / b.asDouble());
+                    return JavaConstant.forDouble(a.asDouble() / b.asDouble());
                 default:
                     throw GraalInternalError.shouldNotReachHere();
             }
@@ -402,7 +402,7 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             switch (n.getKind()) {
                 case Float:
                     return Float.compare(n.asFloat(), 1.0f) == 0;
@@ -417,13 +417,13 @@
     new BinaryOp.Rem(false, false) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
             switch (a.getKind()) {
                 case Float:
-                    return Constant.forFloat(a.asFloat() % b.asFloat());
+                    return JavaConstant.forFloat(a.asFloat() % b.asFloat());
                 case Double:
-                    return Constant.forDouble(a.asDouble() % b.asDouble());
+                    return JavaConstant.forDouble(a.asDouble() % b.asDouble());
                 default:
                     throw GraalInternalError.shouldNotReachHere();
             }
@@ -443,8 +443,8 @@
     new FloatConvertOp(F2I) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forInt((int) value.asFloat());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forInt((int) value.asFloat());
         }
 
         @Override
@@ -457,8 +457,8 @@
     new FloatConvertOp(F2L) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forLong((long) value.asFloat());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forLong((long) value.asFloat());
         }
 
         @Override
@@ -471,8 +471,8 @@
     new FloatConvertOp(D2I) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forInt((int) value.asDouble());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forInt((int) value.asDouble());
         }
 
         @Override
@@ -485,8 +485,8 @@
     new FloatConvertOp(D2L) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forLong((long) value.asDouble());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forLong((long) value.asDouble());
         }
 
         @Override
@@ -499,8 +499,8 @@
     new FloatConvertOp(F2D) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forDouble(value.asFloat());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forDouble(value.asFloat());
         }
 
         @Override
@@ -513,8 +513,8 @@
     new FloatConvertOp(D2F) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forFloat((float) value.asDouble());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forFloat((float) value.asDouble());
         }
 
         @Override
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -55,7 +55,7 @@
     }
 
     @Override
-    public Stamp constant(Constant c, MetaAccessProvider meta) {
+    public Stamp constant(JavaConstant c, MetaAccessProvider meta) {
         throw GraalInternalError.shouldNotReachHere("illegal stamp has no value");
     }
 
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -89,7 +89,7 @@
     }
 
     @Override
-    public Stamp constant(Constant c, MetaAccessProvider meta) {
+    public Stamp constant(JavaConstant c, MetaAccessProvider meta) {
         long value = c.asLong();
         return StampFactory.forInteger(getBits(), value, value);
     }
@@ -314,19 +314,19 @@
     }
 
     @Override
-    public Constant asConstant() {
+    public JavaConstant asConstant() {
         if (lowerBound == upperBound) {
             switch (getBits()) {
                 case 1:
-                    return Constant.forBoolean(lowerBound != 0);
+                    return JavaConstant.forBoolean(lowerBound != 0);
                 case 8:
-                    return Constant.forByte((byte) lowerBound);
+                    return JavaConstant.forByte((byte) lowerBound);
                 case 16:
-                    return Constant.forShort((short) lowerBound);
+                    return JavaConstant.forShort((short) lowerBound);
                 case 32:
-                    return Constant.forInt((int) lowerBound);
+                    return JavaConstant.forInt((int) lowerBound);
                 case 64:
-                    return Constant.forLong(lowerBound);
+                    return JavaConstant.forLong(lowerBound);
             }
         }
         return null;
@@ -373,8 +373,8 @@
     new UnaryOp.Neg() {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forIntegerKind(value.getKind(), -value.asLong());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forIntegerKind(value.getKind(), -value.asLong());
         }
 
         @Override
@@ -393,9 +393,9 @@
     new BinaryOp.Add(true, true) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
-            return Constant.forIntegerKind(a.getKind(), a.asLong() + b.asLong());
+            return JavaConstant.forIntegerKind(a.getKind(), a.asLong() + b.asLong());
         }
 
         @Override
@@ -442,7 +442,7 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             return n.asLong() == 0;
         }
     },
@@ -450,9 +450,9 @@
     new BinaryOp.Sub(true, false) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
-            return Constant.forIntegerKind(a.getKind(), a.asLong() - b.asLong());
+            return JavaConstant.forIntegerKind(a.getKind(), a.asLong() - b.asLong());
         }
 
         @Override
@@ -461,23 +461,23 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             return n.asLong() == 0;
         }
 
         @Override
-        public Constant getZero(Stamp s) {
+        public JavaConstant getZero(Stamp s) {
             IntegerStamp stamp = (IntegerStamp) s;
-            return Constant.forPrimitiveInt(stamp.getBits(), 0);
+            return JavaConstant.forPrimitiveInt(stamp.getBits(), 0);
         }
     },
 
     new BinaryOp.Mul(true, true) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
-            return Constant.forIntegerKind(a.getKind(), a.asLong() * b.asLong());
+            return JavaConstant.forIntegerKind(a.getKind(), a.asLong() * b.asLong());
         }
 
         @Override
@@ -495,7 +495,7 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             return n.asLong() == 1;
         }
     },
@@ -503,9 +503,9 @@
     new BinaryOp.Div(true, false) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
-            return Constant.forIntegerKind(a.getKind(), a.asLong() / b.asLong());
+            return JavaConstant.forIntegerKind(a.getKind(), a.asLong() / b.asLong());
         }
 
         @Override
@@ -523,7 +523,7 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             return n.asLong() == 1;
         }
     },
@@ -531,9 +531,9 @@
     new BinaryOp.Rem(false, false) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
-            return Constant.forIntegerKind(a.getKind(), a.asLong() % b.asLong());
+            return JavaConstant.forIntegerKind(a.getKind(), a.asLong() % b.asLong());
         }
 
         @Override
@@ -562,8 +562,8 @@
     new UnaryOp.Not() {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forIntegerKind(value.getKind(), ~value.asLong());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forIntegerKind(value.getKind(), ~value.asLong());
         }
 
         @Override
@@ -578,9 +578,9 @@
     new BinaryOp.And(true, true) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
-            return Constant.forIntegerKind(a.getKind(), a.asLong() & b.asLong());
+            return JavaConstant.forIntegerKind(a.getKind(), a.asLong() & b.asLong());
         }
 
         @Override
@@ -592,7 +592,7 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             int bits = n.getKind().getBitCount();
             long mask = CodeUtil.mask(bits);
             return (n.asLong() & mask) == mask;
@@ -602,9 +602,9 @@
     new BinaryOp.Or(true, true) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
-            return Constant.forIntegerKind(a.getKind(), a.asLong() | b.asLong());
+            return JavaConstant.forIntegerKind(a.getKind(), a.asLong() | b.asLong());
         }
 
         @Override
@@ -616,7 +616,7 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             return n.asLong() == 0;
         }
     },
@@ -624,9 +624,9 @@
     new BinaryOp.Xor(true, true) {
 
         @Override
-        public Constant foldConstant(Constant a, Constant b) {
+        public JavaConstant foldConstant(JavaConstant a, JavaConstant b) {
             assert a.getKind() == b.getKind();
-            return Constant.forIntegerKind(a.getKind(), a.asLong() ^ b.asLong());
+            return JavaConstant.forIntegerKind(a.getKind(), a.asLong() ^ b.asLong());
         }
 
         @Override
@@ -642,22 +642,22 @@
         }
 
         @Override
-        public boolean isNeutral(Constant n) {
+        public boolean isNeutral(JavaConstant n) {
             return n.asLong() == 0;
         }
 
         @Override
-        public Constant getZero(Stamp s) {
+        public JavaConstant getZero(Stamp s) {
             IntegerStamp stamp = (IntegerStamp) s;
-            return Constant.forPrimitiveInt(stamp.getBits(), 0);
+            return JavaConstant.forPrimitiveInt(stamp.getBits(), 0);
         }
     },
 
     new IntegerConvertOp.ZeroExtend() {
 
         @Override
-        public Constant foldConstant(int inputBits, int resultBits, Constant value) {
-            return Constant.forPrimitiveInt(resultBits, CodeUtil.zeroExtend(value.asLong(), inputBits));
+        public JavaConstant foldConstant(int inputBits, int resultBits, JavaConstant value) {
+            return JavaConstant.forPrimitiveInt(resultBits, CodeUtil.zeroExtend(value.asLong(), inputBits));
         }
 
         @Override
@@ -685,8 +685,8 @@
     new IntegerConvertOp.SignExtend() {
 
         @Override
-        public Constant foldConstant(int inputBits, int resultBits, Constant value) {
-            return Constant.forPrimitiveInt(resultBits, CodeUtil.signExtend(value.asLong(), inputBits));
+        public JavaConstant foldConstant(int inputBits, int resultBits, JavaConstant value) {
+            return JavaConstant.forPrimitiveInt(resultBits, CodeUtil.signExtend(value.asLong(), inputBits));
         }
 
         @Override
@@ -706,8 +706,8 @@
     new IntegerConvertOp.Narrow() {
 
         @Override
-        public Constant foldConstant(int inputBits, int resultBits, Constant value) {
-            return Constant.forPrimitiveInt(resultBits, CodeUtil.narrow(value.asLong(), resultBits));
+        public JavaConstant foldConstant(int inputBits, int resultBits, JavaConstant value) {
+            return JavaConstant.forPrimitiveInt(resultBits, CodeUtil.narrow(value.asLong(), resultBits));
         }
 
         @Override
@@ -744,8 +744,8 @@
     new FloatConvertOp(I2F) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forFloat(value.asInt());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forFloat(value.asInt());
         }
 
         @Override
@@ -759,8 +759,8 @@
     new FloatConvertOp(L2F) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forFloat(value.asLong());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forFloat(value.asLong());
         }
 
         @Override
@@ -774,8 +774,8 @@
     new FloatConvertOp(I2D) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forDouble(value.asInt());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forDouble(value.asInt());
         }
 
         @Override
@@ -789,8 +789,8 @@
     new FloatConvertOp(L2D) {
 
         @Override
-        public Constant foldConstant(Constant value) {
-            return Constant.forDouble(value.asLong());
+        public JavaConstant foldConstant(JavaConstant value) {
+            return JavaConstant.forDouble(value.asLong());
         }
 
         @Override
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -66,9 +66,9 @@
     }
 
     @Override
-    public Constant asConstant() {
+    public JavaConstant asConstant() {
         if (alwaysNull()) {
-            return Constant.NULL_OBJECT;
+            return JavaConstant.NULL_OBJECT;
         } else {
             return null;
         }
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -93,7 +93,7 @@
      * If it is not possible to represent single value stamps, this method returns a stamp that
      * includes c, and is otherwise as narrow as possible.
      */
-    public abstract Stamp constant(Constant c, MetaAccessProvider meta);
+    public abstract Stamp constant(JavaConstant c, MetaAccessProvider meta);
 
     /**
      * Test whether two stamps have the same base type.
@@ -112,7 +112,7 @@
      * @return the constant corresponding to the single value of this stamp and null if this stamp
      *         can represent less or more than one value.
      */
-    public Constant asConstant() {
+    public JavaConstant asConstant() {
         return null;
     }
 }
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -167,7 +167,7 @@
         return new FloatStamp(kind.getBitCount(), lowerBound, upperBound, nonNaN);
     }
 
-    public static Stamp forConstant(Constant value) {
+    public static Stamp forConstant(JavaConstant value) {
         Kind kind = value.getKind();
         switch (kind) {
             case Boolean:
@@ -195,7 +195,7 @@
         }
     }
 
-    public static Stamp forConstant(Constant value, MetaAccessProvider metaAccess) {
+    public static Stamp forConstant(JavaConstant value, MetaAccessProvider metaAccess) {
         if (value.getKind() == Kind.Object) {
             ResolvedJavaType type = value.isNull() ? null : metaAccess.lookupJavaType(value);
             return new ObjectStamp(type, value.isNonNull(), value.isNonNull(), value.isNull());
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@
     }
 
     @Override
-    public Stamp constant(Constant c, MetaAccessProvider meta) {
+    public Stamp constant(JavaConstant c, MetaAccessProvider meta) {
         throw GraalInternalError.shouldNotReachHere("void stamp has no value");
     }
 
--- a/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java	Thu Oct 30 12:21:07 2014 +0100
@@ -62,7 +62,7 @@
     }
 
     @Override
-    public boolean canInlineConstant(Constant c) {
+    public boolean canInlineConstant(JavaConstant c) {
         switch (c.getKind()) {
             case Long:
                 return NumUtil.isInt(c.asLong()) && !getCodeCache().needsDataPatch(c);
@@ -125,7 +125,7 @@
                 Value indexRegister;
                 Value convertedIndex = index.getKind() == Kind.Long ? index : this.emitSignExtend(index, 32, 64);
                 if (scale != 1) {
-                    indexRegister = emitUMul(convertedIndex, Constant.forInt(scale));
+                    indexRegister = emitUMul(convertedIndex, JavaConstant.forInt(scale));
                 } else {
                     indexRegister = convertedIndex;
                 }
@@ -199,13 +199,13 @@
     public void emitIntegerTestBranch(Value left, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueDestinationProbability) {
         Variable result = emitAnd(left, right);
         Variable dummyResult = newVariable(left.getLIRKind());
-        append(new CompareBranchOp(mapKindToCompareOp(result.getKind()), Condition.EQ, result, Constant.forInt(0), dummyResult, dummyResult, trueDestination, falseDestination, false));
+        append(new CompareBranchOp(mapKindToCompareOp(result.getKind()), Condition.EQ, result, JavaConstant.forInt(0), dummyResult, dummyResult, trueDestination, falseDestination, false));
     }
 
     @Override
     public Variable emitIntegerTestMove(Value left, Value right, Value trueValue, Value falseValue) {
         Variable result = emitAnd(left, right);
-        append(new CondMoveOp(mapKindToCompareOp(result.getKind()), result, Constant.forInt(0), result, Condition.EQ, load(trueValue), load(falseValue)));
+        append(new CondMoveOp(mapKindToCompareOp(result.getKind()), result, JavaConstant.forInt(0), result, Condition.EQ, load(trueValue), load(falseValue)));
         return result;
     }
 
@@ -822,7 +822,7 @@
      * Graal generates for any switch construct appearing in Java bytecode.
      */
     @Override
-    public void emitStrategySwitch(Constant[] keyConstants, double[] keyProbabilities, LabelRef[] keyTargets, LabelRef defaultTarget, Variable value) {
+    public void emitStrategySwitch(JavaConstant[] keyConstants, double[] keyProbabilities, LabelRef[] keyTargets, LabelRef defaultTarget, Variable value) {
         emitStrategySwitch(new SwitchStrategy.SequentialStrategy(keyProbabilities, keyConstants), value, keyTargets, defaultTarget);
     }
 
--- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java	Thu Oct 30 12:21:07 2014 +0100
@@ -93,7 +93,7 @@
     }
 
     @Override
-    public boolean canInlineConstant(Constant c) {
+    public boolean canInlineConstant(JavaConstant c) {
         switch (c.getKind()) {
             case Long:
                 return NumUtil.isInt(c.asLong()) && !getCodeCache().needsDataPatch(c);
@@ -168,9 +168,9 @@
                 convertedIndex = emitSignExtend(index, 32, 64);
                 if (scale != 1) {
                     if (CodeUtil.isPowerOf2(scale)) {
-                        indexRegister = emitShl(convertedIndex, Constant.forInt(CodeUtil.log2(scale)));
+                        indexRegister = emitShl(convertedIndex, JavaConstant.forInt(CodeUtil.log2(scale)));
                     } else {
-                        indexRegister = emitMul(convertedIndex, Constant.forInt(scale));
+                        indexRegister = emitMul(convertedIndex, JavaConstant.forInt(scale));
                     }
                 } else {
                     indexRegister = convertedIndex;
@@ -696,13 +696,13 @@
             assert inputVal.getKind() == Kind.Long;
             Variable result = newVariable(LIRKind.derive(inputVal).changeType(Kind.Long));
             long mask = CodeUtil.mask(fromBits);
-            append(new Op2Stack(LAND, result, inputVal, Constant.forLong(mask)));
+            append(new Op2Stack(LAND, result, inputVal, JavaConstant.forLong(mask)));
             return result;
         } else {
             assert inputVal.getKind() == Kind.Int;
             Variable result = newVariable(LIRKind.derive(inputVal).changeType(Kind.Int));
             int mask = (int) CodeUtil.mask(fromBits);
-            append(new Op2Stack(IAND, result, inputVal, Constant.forInt(mask)));
+            append(new Op2Stack(IAND, result, inputVal, JavaConstant.forInt(mask)));
             if (toBits > 32) {
                 Variable longResult = newVariable(LIRKind.derive(inputVal).changeType(Kind.Long));
                 emitMove(longResult, result);
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Thu Oct 30 12:21:07 2014 +0100
@@ -83,7 +83,7 @@
     }
 
     @Override
-    public boolean canInlineConstant(Constant c) {
+    public boolean canInlineConstant(JavaConstant c) {
         switch (c.getKind()) {
             case Int:
                 return SPARCAssembler.isSimm13(c.asInt()) && !getCodeCache().needsDataPatch(c);
@@ -142,9 +142,9 @@
                 if (scale != 1) {
                     Value longIndex = index.getKind() == Kind.Long ? index : emitSignExtend(index, 32, 64);
                     if (CodeUtil.isPowerOf2(scale)) {
-                        indexRegister = emitShl(longIndex, Constant.forLong(CodeUtil.log2(scale)));
+                        indexRegister = emitShl(longIndex, JavaConstant.forLong(CodeUtil.log2(scale)));
                     } else {
-                        indexRegister = emitMul(longIndex, Constant.forLong(scale));
+                        indexRegister = emitMul(longIndex, JavaConstant.forLong(scale));
                     }
                 } else {
                     indexRegister = asAllocatable(index);
@@ -163,14 +163,14 @@
         } else {
             displacementInt = 0;
             if (baseRegister.equals(Value.ILLEGAL)) {
-                baseRegister = load(Constant.forLong(finalDisp));
+                baseRegister = load(JavaConstant.forLong(finalDisp));
             } else {
                 if (finalDisp == 0) {
                     // Nothing to do. Just use the base register.
                 } else {
                     Variable longBaseRegister = newVariable(LIRKind.derivedReference(Kind.Long));
                     emitMove(longBaseRegister, baseRegister);
-                    baseRegister = emitAdd(longBaseRegister, Constant.forLong(finalDisp));
+                    baseRegister = emitAdd(longBaseRegister, JavaConstant.forLong(finalDisp));
                 }
             }
         }
@@ -273,7 +273,7 @@
 
     private Value loadSimm11(Value value) {
         if (isConstant(value)) {
-            Constant c = asConstant(value);
+            JavaConstant c = asConstant(value);
             if (c.isNull() || SPARCAssembler.isSimm11(c)) {
                 return value;
             } else {
@@ -552,7 +552,7 @@
         }
     }
 
-    private Variable emitBinaryConst(SPARCArithmetic op, AllocatableValue a, Constant b, LIRFrameState state) {
+    private Variable emitBinaryConst(SPARCArithmetic op, AllocatableValue a, JavaConstant b, LIRFrameState state) {
         switch (op) {
             case IADD:
             case LADD:
@@ -786,7 +786,7 @@
 
     private Variable emitShift(SPARCArithmetic op, Value a, Value b) {
         Variable result = newVariable(LIRKind.derive(a, b).changeType(a.getPlatformKind()));
-        if (isConstant(b) && canInlineConstant((Constant) b)) {
+        if (isConstant(b) && canInlineConstant((JavaConstant) b)) {
             append(new BinaryRegConst(op, result, load(a), asConstant(b), null));
         } else {
             append(new BinaryRegReg(op, result, load(a), load(b)));
@@ -978,15 +978,15 @@
             assert inputVal.getKind() == Kind.Long;
             Variable result = newVariable(LIRKind.derive(inputVal).changeType(Kind.Long));
             long mask = CodeUtil.mask(fromBits);
-            append(new BinaryRegConst(SPARCArithmetic.LAND, result, asAllocatable(inputVal), Constant.forLong(mask), null));
+            append(new BinaryRegConst(SPARCArithmetic.LAND, result, asAllocatable(inputVal), JavaConstant.forLong(mask), null));
             return result;
         } else {
             assert inputVal.getKind() == Kind.Int || inputVal.getKind() == Kind.Short || inputVal.getKind() == Kind.Byte || inputVal.getKind() == Kind.Char : inputVal.getKind();
             Variable result = newVariable(LIRKind.derive(inputVal).changeType(Kind.Int));
             long mask = CodeUtil.mask(fromBits);
-            Constant constant = Constant.forInt((int) mask);
+            JavaConstant constant = JavaConstant.forInt((int) mask);
             if (fromBits == 32) {
-                append(new BinaryRegConst(IUSHR, result, inputVal, Constant.forInt(0)));
+                append(new BinaryRegConst(IUSHR, result, inputVal, JavaConstant.forInt(0)));
             } else if (canInlineConstant(constant)) {
                 append(new BinaryRegConst(SPARCArithmetic.IAND, result, asAllocatable(inputVal), constant, null));
             } else {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/BoxingEliminationTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/BoxingEliminationTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -255,7 +255,7 @@
     public void intTest1() {
         ValueNode result = getResult("intTest1Snippet");
         Assert.assertTrue(result.isConstant());
-        Assert.assertEquals(1, result.asConstant().asInt());
+        Assert.assertEquals(1, result.asJavaConstant().asInt());
     }
 
     public static int mergeTest1Snippet(boolean d, int a, int b) {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CompareCanonicalizerTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CompareCanonicalizerTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -128,9 +128,9 @@
     @Test
     public void testIntegerTestCanonicalization() {
         ValueNode result = getResult(getCanonicalizedGraph("integerTestCanonicalization1"));
-        assertTrue(result.isConstant() && result.asConstant().asLong() == 1);
+        assertTrue(result.isConstant() && result.asJavaConstant().asLong() == 1);
         result = getResult(getCanonicalizedGraph("integerTestCanonicalization2"));
-        assertTrue(result.isConstant() && result.asConstant().asLong() == 1);
+        assertTrue(result.isConstant() && result.asJavaConstant().asLong() == 1);
         StructuredGraph graph = getCanonicalizedGraph("integerTestCanonicalization3");
         assertDeepEquals(1, graph.getNodes(ReturnNode.class).count());
         assertTrue(graph.getNodes(ReturnNode.class).first().result() instanceof ConditionalNode);
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,8 +41,8 @@
                 boolean implies = c1.implies(c2);
                 if (implies) {
                     for (int i = 0; i < 1000; i++) {
-                        Constant a = Constant.forInt(rand.nextInt());
-                        Constant b = Constant.forInt(i < 100 ? a.asInt() : rand.nextInt());
+                        JavaConstant a = JavaConstant.forInt(rand.nextInt());
+                        JavaConstant b = JavaConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
                         boolean result1 = c1.foldCondition(a, b, null, false);
                         boolean result2 = c2.foldCondition(a, b, null, false);
                         if (result1) {
@@ -63,8 +63,8 @@
                 assertEquals(join, c2.join(c1));
                 if (join != null) {
                     for (int i = 0; i < 1000; i++) {
-                        Constant a = Constant.forInt(rand.nextInt());
-                        Constant b = Constant.forInt(i < 100 ? a.asInt() : rand.nextInt());
+                        JavaConstant a = JavaConstant.forInt(rand.nextInt());
+                        JavaConstant b = JavaConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
                         boolean result1 = c1.foldCondition(a, b, null, false);
                         boolean result2 = c2.foldCondition(a, b, null, false);
                         boolean resultJoin = join.foldCondition(a, b, null, false);
@@ -88,8 +88,8 @@
                 assertEquals(meet, c2.meet(c1));
                 if (meet != null) {
                     for (int i = 0; i < 1000; i++) {
-                        Constant a = Constant.forInt(rand.nextInt());
-                        Constant b = Constant.forInt(i < 100 ? a.asInt() : rand.nextInt());
+                        JavaConstant a = JavaConstant.forInt(rand.nextInt());
+                        JavaConstant b = JavaConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
                         boolean result1 = c1.foldCondition(a, b, null, false);
                         boolean result2 = c2.foldCondition(a, b, null, false);
                         boolean resultMeet = meet.foldCondition(a, b, null, false);
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FlowSensitiveReductionTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FlowSensitiveReductionTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -148,7 +148,7 @@
         new FlowSensitiveReductionPhase(getMetaAccess()).apply(graph, context);
         new CanonicalizerPhase(true).apply(graph, context);
         for (ConstantNode constant : getConstantNodes(graph)) {
-            assertTrue("unexpected constant: " + constant, constant.asConstant().isNull() || constant.asConstant().asInt() > 0);
+            assertTrue("unexpected constant: " + constant, constant.asJavaConstant().isNull() || constant.asJavaConstant().asInt() > 0);
         }
     }
 
@@ -184,7 +184,7 @@
         new FlowSensitiveReductionPhase(getMetaAccess()).apply(graph, new PhaseContext(getProviders(), null));
         new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), null));
         for (ConstantNode constant : getConstantNodes(graph)) {
-            assertTrue("unexpected constant: " + constant, constant.asConstant().isNull() || constant.asConstant().asInt() > 0);
+            assertTrue("unexpected constant: " + constant, constant.asJavaConstant().isNull() || constant.asJavaConstant().asInt() > 0);
         }
     }
 
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -249,8 +249,8 @@
         Assert.assertEquals("unexpected number of ReturnNodes: " + graphString, graph.getNodes(ReturnNode.class).count(), 1);
         ValueNode result = graph.getNodes(ReturnNode.class).first().result();
         Assert.assertTrue("unexpected ReturnNode result node: " + graphString, result.isConstant());
-        Assert.assertEquals("unexpected ReturnNode result kind: " + graphString, result.asConstant().getKind(), Kind.Int);
-        Assert.assertEquals("unexpected ReturnNode result: " + graphString, result.asConstant().asInt(), value);
+        Assert.assertEquals("unexpected ReturnNode result kind: " + graphString, result.asJavaConstant().getKind(), Kind.Int);
+        Assert.assertEquals("unexpected ReturnNode result: " + graphString, result.asJavaConstant().asInt(), value);
     }
 
     protected static String getCanonicalGraphString(StructuredGraph graph, boolean excludeVirtual, boolean checkConstants) {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EATestBase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EATestBase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -134,12 +134,12 @@
      * @param iterativeEscapeAnalysis true if escape analysis should be run for more than one
      *            iteration
      */
-    protected void testEscapeAnalysis(String snippet, final Constant expectedConstantResult, final boolean iterativeEscapeAnalysis) {
+    protected void testEscapeAnalysis(String snippet, final JavaConstant expectedConstantResult, final boolean iterativeEscapeAnalysis) {
         prepareGraph(snippet, iterativeEscapeAnalysis);
         if (expectedConstantResult != null) {
             for (ReturnNode returnNode : returnNodes) {
                 Assert.assertTrue(returnNode.result().toString(), returnNode.result().isConstant());
-                Assert.assertEquals(expectedConstantResult, returnNode.result().asConstant());
+                Assert.assertEquals(expectedConstantResult, returnNode.result().asJavaConstant());
             }
         }
         int newInstanceCount = graph.getNodes().filter(NewInstanceNode.class).count() + graph.getNodes().filter(NewArrayNode.class).count() +
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
 
     @Test
     public void test1() {
-        testEscapeAnalysis("test1Snippet", Constant.forInt(101), false);
+        testEscapeAnalysis("test1Snippet", JavaConstant.forInt(101), false);
     }
 
     public static int test1Snippet() {
@@ -51,7 +51,7 @@
 
     @Test
     public void test2() {
-        testEscapeAnalysis("test2Snippet", Constant.forInt(0), false);
+        testEscapeAnalysis("test2Snippet", JavaConstant.forInt(0), false);
     }
 
     public static int test2Snippet() {
@@ -61,7 +61,7 @@
 
     @Test
     public void test3() {
-        testEscapeAnalysis("test3Snippet", Constant.NULL_OBJECT, false);
+        testEscapeAnalysis("test3Snippet", JavaConstant.NULL_OBJECT, false);
     }
 
     public static Object test3Snippet() {
@@ -71,7 +71,7 @@
 
     @Test
     public void testMonitor() {
-        testEscapeAnalysis("testMonitorSnippet", Constant.forInt(0), false);
+        testEscapeAnalysis("testMonitorSnippet", JavaConstant.forInt(0), false);
     }
 
     public static int testMonitorSnippet() {
@@ -90,7 +90,7 @@
 
     @Test
     public void testMonitor2() {
-        testEscapeAnalysis("testMonitor2Snippet", Constant.forInt(0), false);
+        testEscapeAnalysis("testMonitor2Snippet", JavaConstant.forInt(0), false);
     }
 
     /**
@@ -113,7 +113,7 @@
 
     @Test
     public void testMerge() {
-        testEscapeAnalysis("testMerge1Snippet", Constant.forInt(0), true);
+        testEscapeAnalysis("testMerge1Snippet", JavaConstant.forInt(0), true);
     }
 
     public static int testMerge1Snippet(int a) {
@@ -132,7 +132,7 @@
 
     @Test
     public void testSimpleLoop() {
-        testEscapeAnalysis("testSimpleLoopSnippet", Constant.forInt(1), false);
+        testEscapeAnalysis("testSimpleLoopSnippet", JavaConstant.forInt(1), false);
     }
 
     public int testSimpleLoopSnippet(int a) {
@@ -145,7 +145,7 @@
 
     @Test
     public void testModifyingLoop() {
-        testEscapeAnalysis("testModifyingLoopSnippet", Constant.forInt(1), false);
+        testEscapeAnalysis("testModifyingLoopSnippet", JavaConstant.forInt(1), false);
     }
 
     public int testModifyingLoopSnippet(int a) {
@@ -159,7 +159,7 @@
 
     @Test
     public void testMergeAllocationsInt() {
-        testEscapeAnalysis("testMergeAllocationsIntSnippet", Constant.forInt(1), false);
+        testEscapeAnalysis("testMergeAllocationsIntSnippet", JavaConstant.forInt(1), false);
     }
 
     public int testMergeAllocationsIntSnippet(int a) {
@@ -176,7 +176,7 @@
 
     @Test
     public void testMergeAllocationsObj() {
-        testEscapeAnalysis("testMergeAllocationsObjSnippet", Constant.forInt(1), false);
+        testEscapeAnalysis("testMergeAllocationsObjSnippet", JavaConstant.forInt(1), false);
     }
 
     public int testMergeAllocationsObjSnippet(int a) {
@@ -196,7 +196,7 @@
 
     @Test
     public void testMergeAllocationsObjCirc() {
-        testEscapeAnalysis("testMergeAllocationsObjCircSnippet", Constant.forInt(1), false);
+        testEscapeAnalysis("testMergeAllocationsObjCircSnippet", JavaConstant.forInt(1), false);
     }
 
     public int testMergeAllocationsObjCircSnippet(int a) {
@@ -238,7 +238,7 @@
 
     @Test
     public void testMergeAllocationsException() {
-        testEscapeAnalysis("testMergeAllocationsExceptionSnippet", Constant.forInt(1), false);
+        testEscapeAnalysis("testMergeAllocationsExceptionSnippet", JavaConstant.forInt(1), false);
     }
 
     public int testMergeAllocationsExceptionSnippet(int a) {
@@ -267,7 +267,7 @@
 
     @Test
     public void testInstanceOf() {
-        testEscapeAnalysis("testInstanceOfSnippet", Constant.forInt(1), false);
+        testEscapeAnalysis("testInstanceOfSnippet", JavaConstant.forInt(1), false);
     }
 
     public boolean testInstanceOfSnippet() {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PEAReadEliminationTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PEAReadEliminationTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -88,7 +88,7 @@
         ValueNode result = getReturn("testSimpleSnippet").result();
         assertTrue(graph.getNodes().filter(LoadFieldNode.class).isEmpty());
         assertTrue(result.isConstant());
-        assertDeepEquals(2, result.asConstant().asInt());
+        assertDeepEquals(2, result.asJavaConstant().asInt());
     }
 
     @SuppressWarnings("all")
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/UnsafeEATest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/UnsafeEATest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
 
     @Test
     public void testSimpleInt() {
-        testEscapeAnalysis("testSimpleIntSnippet", Constant.forInt(101), false);
+        testEscapeAnalysis("testSimpleIntSnippet", JavaConstant.forInt(101), false);
     }
 
     public static int testSimpleIntSnippet() {
@@ -74,7 +74,7 @@
 
     @Test
     public void testSimpleDouble() {
-        testEscapeAnalysis("testSimpleDoubleSnippet", Constant.forDouble(10.1), false);
+        testEscapeAnalysis("testSimpleDoubleSnippet", JavaConstant.forDouble(10.1), false);
     }
 
     public static double testSimpleDoubleSnippet() {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Thu Oct 30 12:21:07 2014 +0100
@@ -319,7 +319,7 @@
                 Kind kind = Kind.Illegal;
                 if (dp.reference instanceof ConstantReference) {
                     VMConstant constant = ((ConstantReference) dp.reference).getConstant();
-                    kind = ((Constant) constant).getKind();
+                    kind = ((JavaConstant) constant).getKind();
                 }
                 dms[kind.ordinal()].add(1);
             }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java	Thu Oct 30 12:21:07 2014 +0100
@@ -529,10 +529,10 @@
      * The value with which a spilled child interval can be re-materialized. Currently this must be
      * a Constant.
      */
-    private Constant materializedValue;
+    private JavaConstant materializedValue;
 
     /**
-     * The number of times {@link #addMaterializationValue(Constant)} is called.
+     * The number of times {@link #addMaterializationValue(JavaConstant)} is called.
      */
     private int numMaterializationValuesAdded;
 
@@ -737,7 +737,7 @@
     /**
      * Sets the value which is used for re-materialization.
      */
-    void addMaterializationValue(Constant value) {
+    void addMaterializationValue(JavaConstant value) {
         if (numMaterializationValuesAdded == 0) {
             materializedValue = value;
         } else {
@@ -758,7 +758,7 @@
     /**
      * Returns a value which can be moved to a register instead of a restore-move from stack.
      */
-    public Constant getMaterializedValue() {
+    public JavaConstant getMaterializedValue() {
         return splitParent().materializedValue;
     }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Oct 30 12:21:07 2014 +0100
@@ -2227,12 +2227,12 @@
      * @param interval The interval for this defined value.
      * @return Returns the value which is moved to the instruction and which can be reused at all
      *         reload-locations in case the interval of this instruction is spilled. Currently this
-     *         can only be a {@link Constant}.
+     *         can only be a {@link JavaConstant}.
      */
-    public static Constant getMaterializedValue(LIRInstruction op, Value operand, Interval interval) {
+    public static JavaConstant getMaterializedValue(LIRInstruction op, Value operand, Interval interval) {
         if (op instanceof MoveOp) {
             MoveOp move = (MoveOp) op;
-            if (move.getInput() instanceof Constant) {
+            if (move.getInput() instanceof JavaConstant) {
                 /*
                  * Check if the interval has any uses which would accept an stack location (priority
                  * == ShouldHaveRegister). Rematerialization of such intervals can result in a
@@ -2247,7 +2247,7 @@
                         return null;
                     }
                 }
-                return (Constant) move.getInput();
+                return (JavaConstant) move.getInput();
             }
         }
         return null;
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeLIRBuilder.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeLIRBuilder.java	Thu Oct 30 12:21:07 2014 +0100
@@ -63,7 +63,7 @@
 
     public abstract int getArrayLengthOffset();
 
-    public abstract Constant getClassConstant(ResolvedJavaType declaringClass);
+    public abstract JavaConstant getClassConstant(ResolvedJavaType declaringClass);
 
     public abstract int getFieldOffset(ResolvedJavaField field);
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@
                             assert currentField != null;
                             int pos = 0;
                             for (int i = 0; i < vobj.entryCount(); i++) {
-                                if (!currentField.values().get(i).isConstant() || currentField.values().get(i).asConstant().getKind() != Kind.Illegal) {
+                                if (!currentField.values().get(i).isConstant() || currentField.values().get(i).asJavaConstant().getKind() != Kind.Illegal) {
                                     values[pos++] = toValue(currentField.values().get(i));
                                 } else {
                                     assert currentField.values().get(i - 1).getKind() == Kind.Double || currentField.values().get(i - 1).getKind() == Kind.Long : vobj + " " + i + " " +
@@ -214,7 +214,7 @@
                 } else if (value != null) {
                     STATE_VARIABLES.increment();
                     Value operand = nodeOperands.get(value);
-                    assert operand != null && (operand instanceof Variable || operand instanceof Constant) : operand + " for " + value;
+                    assert operand != null && (operand instanceof Variable || operand instanceof JavaConstant) : operand + " for " + value;
                     return operand;
 
                 } else {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java	Thu Oct 30 12:21:07 2014 +0100
@@ -532,7 +532,7 @@
                 gen.emitCompareBranch(kind, gen.load(operand(x.value())), x.keyAt(0), Condition.EQ, false, getLIRBlock(x.keySuccessor(0)), defaultTarget, probability);
             } else {
                 LabelRef[] keyTargets = new LabelRef[keyCount];
-                Constant[] keyConstants = new Constant[keyCount];
+                JavaConstant[] keyConstants = new JavaConstant[keyCount];
                 double[] keyProbabilities = new double[keyCount];
                 for (int i = 0; i < keyCount; i++) {
                     keyTargets[i] = getLIRBlock(x.keySuccessor(i));
--- a/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -172,7 +172,7 @@
             LIRGeneratorTool gen = generator.getLIRGeneratorTool();
             Variable ret = gen.newVariable(gen.getLIRKind(stamp()));
 
-            gen.append(new LoadThroughPatchOp(input.asConstant(), stamp() instanceof NarrowOopStamp, ret));
+            gen.append(new LoadThroughPatchOp(input.asJavaConstant(), stamp() instanceof NarrowOopStamp, ret));
             generator.setResult(this, ret);
         }
 
@@ -182,11 +182,11 @@
 
     private static class LoadThroughPatchOp extends LIRInstructionBase {
 
-        final Constant c;
+        final JavaConstant c;
         final boolean compressed;
         @Def({REG}) AllocatableValue result;
 
-        LoadThroughPatchOp(Constant c, boolean compressed, AllocatableValue result) {
+        LoadThroughPatchOp(JavaConstant c, boolean compressed, AllocatableValue result) {
             this.c = c;
             this.compressed = compressed;
             this.result = result;
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -332,7 +332,7 @@
     public static NativeFunctionInterface createNativeFunctionInterface() {
         HotSpotVMConfig config = HotSpotGraalRuntime.runtime().getConfig();
         RawNativeCallNodeFactory factory = new RawNativeCallNodeFactory() {
-            public FixedWithNextNode createRawCallNode(Kind returnType, Constant functionPointer, ValueNode... args) {
+            public FixedWithNextNode createRawCallNode(Kind returnType, JavaConstant functionPointer, ValueNode... args) {
                 return AMD64RawNativeCallNode.create(returnType, functionPointer, args);
             }
         };
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java	Thu Oct 30 12:21:07 2014 +0100
@@ -86,7 +86,7 @@
     }
 
     @Override
-    public Constant getClassConstant(ResolvedJavaType declaringClass) {
+    public JavaConstant getClassConstant(ResolvedJavaType declaringClass) {
         return HotSpotObjectConstant.forObject(((HotSpotResolvedJavaType) declaringClass).mirror());
     }
 
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCompare.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCompare.java	Thu Oct 30 12:21:07 2014 +0100
@@ -41,9 +41,9 @@
     public static class HotSpotCompareConstantOp extends AMD64LIRInstruction {
 
         @Use({REG}) protected AllocatableValue x;
-        protected Constant y;
+        protected JavaConstant y;
 
-        public HotSpotCompareConstantOp(AllocatableValue x, Constant y) {
+        public HotSpotCompareConstantOp(AllocatableValue x, JavaConstant y) {
             this.x = x;
             this.y = y;
         }
@@ -83,9 +83,9 @@
     @Opcode("CMP")
     public static class HotSpotCompareMemoryConstantOp extends MemOp {
 
-        protected Constant y;
+        protected JavaConstant y;
 
-        public HotSpotCompareMemoryConstantOp(Kind kind, AMD64AddressValue x, Constant y, LIRFrameState state) {
+        public HotSpotCompareMemoryConstantOp(Kind kind, AMD64AddressValue x, JavaConstant y, LIRFrameState state) {
             super(kind, x, state);
             this.y = y;
         }
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Thu Oct 30 12:21:07 2014 +0100
@@ -330,7 +330,7 @@
         return result;
     }
 
-    protected AMD64ZapRegistersOp emitZapRegisters(Register[] zappedRegisters, Constant[] zapValues) {
+    protected AMD64ZapRegistersOp emitZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues) {
         AMD64ZapRegistersOp zap = new AMD64ZapRegistersOp(zappedRegisters, zapValues);
         append(zap);
         return zap;
@@ -338,7 +338,7 @@
 
     protected boolean zapRegisters() {
         Register[] zappedRegisters = getResult().getFrameMapBuilder().getRegisterConfig().getAllocatableRegisters();
-        Constant[] zapValues = new Constant[zappedRegisters.length];
+        JavaConstant[] zapValues = new JavaConstant[zappedRegisters.length];
         for (int i = 0; i < zappedRegisters.length; i++) {
             PlatformKind kind = target().arch.getLargestStorableKind(zappedRegisters[i].getRegisterCategory());
             assert kind != Kind.Illegal;
@@ -360,14 +360,14 @@
         // TODO(mg): in case a native function uses floating point varargs, the ABI requires that
         // RAX contains the length of the varargs
         AllocatableValue numberOfFloatingPointArgumentsRegister = AMD64.rax.asValue();
-        emitMove(numberOfFloatingPointArgumentsRegister, Constant.forInt(numberOfFloatingPointArguments));
+        emitMove(numberOfFloatingPointArgumentsRegister, JavaConstant.forInt(numberOfFloatingPointArguments));
         for (int i = 0; i < args.length; i++) {
             Value arg = args[i];
             AllocatableValue loc = nativeCallingConvention.getArgument(i);
             emitMove(loc, arg);
             argLocations[i] = loc;
         }
-        Value ptr = emitMove(Constant.forLong(address));
+        Value ptr = emitMove(JavaConstant.forLong(address));
         append(new AMD64CCall(nativeCallingConvention.getReturn(), ptr, numberOfFloatingPointArgumentsRegister, argLocations));
     }
 
@@ -401,7 +401,7 @@
 
     @Override
     public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) {
-        moveDeoptValuesToThread(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0), Constant.NULL_OBJECT);
+        moveDeoptValuesToThread(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0), JavaConstant.NULL_OBJECT);
         append(new AMD64HotSpotDeoptimizeCallerOp());
     }
 
@@ -422,13 +422,13 @@
     /**
      * @return a compressed version of the incoming constant
      */
-    protected static Constant compress(Constant c, CompressEncoding encoding) {
+    protected static JavaConstant compress(JavaConstant c, CompressEncoding encoding) {
         if (c.getKind() == Kind.Long) {
             int compressedValue = (int) (((c.asLong() - encoding.base) >> encoding.shift) & 0xffffffffL);
             if (c instanceof HotSpotMetaspaceConstant) {
                 return HotSpotMetaspaceConstant.forMetaspaceObject(Kind.Int, compressedValue, HotSpotMetaspaceConstant.getMetaspaceObject(c), true);
             } else {
-                return Constant.forIntegerKind(Kind.Int, compressedValue);
+                return JavaConstant.forIntegerKind(Kind.Int, compressedValue);
             }
         } else {
             throw GraalInternalError.shouldNotReachHere();
@@ -468,7 +468,7 @@
      * @return True if the constant can be used directly, false if the constant needs to be in a
      *         register.
      */
-    protected boolean canStoreConstant(Constant c) {
+    protected boolean canStoreConstant(JavaConstant c) {
         // there is no immediate move of 64-bit constants on Intel
         switch (c.getKind()) {
             case Long:
@@ -486,7 +486,7 @@
     public void emitStore(LIRKind kind, Value address, Value inputVal, LIRFrameState state) {
         AMD64AddressValue storeAddress = asAddressValue(address);
         if (isConstant(inputVal)) {
-            Constant c = asConstant(inputVal);
+            JavaConstant c = asConstant(inputVal);
             if (canStoreConstant(c)) {
                 append(new HotSpotStoreConstantOp((Kind) kind.getPlatformKind(), storeAddress, c, state));
                 return;
@@ -510,7 +510,7 @@
             Variable result = newVariable(LIRKind.value(Kind.Int));
             AllocatableValue base = Value.ILLEGAL;
             if (encoding.base != 0) {
-                base = emitMove(Constant.forLong(encoding.base));
+                base = emitMove(JavaConstant.forLong(encoding.base));
             }
             append(new AMD64HotSpotMove.CompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
             return result;
@@ -531,7 +531,7 @@
             Variable result = newVariable(LIRKind.value(Kind.Long));
             AllocatableValue base = Value.ILLEGAL;
             if (encoding.base != 0) {
-                base = emitMove(Constant.forLong(encoding.base));
+                base = emitMove(JavaConstant.forLong(encoding.base));
             }
             append(new AMD64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
             return result;
@@ -540,8 +540,8 @@
 
     @Override
     protected AMD64LIRInstruction createMove(AllocatableValue dst, Value src) {
-        if (src instanceof Constant) {
-            return new AMD64HotSpotMove.HotSpotLoadConstantOp(dst, (Constant) src);
+        if (src instanceof JavaConstant) {
+            return new AMD64HotSpotMove.HotSpotLoadConstantOp(dst, (JavaConstant) src);
         } else {
             return super.createMove(dst, src);
         }
@@ -600,14 +600,14 @@
     @Override
     protected void emitCompareOp(PlatformKind cmpKind, Variable left, Value right) {
         if (right instanceof HotSpotConstant) {
-            append(new AMD64HotSpotCompare.HotSpotCompareConstantOp(left, (Constant) right));
+            append(new AMD64HotSpotCompare.HotSpotCompareConstantOp(left, (JavaConstant) right));
         } else {
             super.emitCompareOp(cmpKind, left, right);
         }
     }
 
     @Override
-    protected void emitCompareMemoryConOp(Kind kind, AMD64AddressValue address, Constant value, LIRFrameState state) {
+    protected void emitCompareMemoryConOp(Kind kind, AMD64AddressValue address, JavaConstant value, LIRFrameState state) {
         if (value instanceof HotSpotConstant) {
             append(new AMD64HotSpotCompare.HotSpotCompareMemoryConstantOp(kind, address, value, state));
         } else {
@@ -616,7 +616,7 @@
     }
 
     @Override
-    public boolean canInlineConstant(Constant c) {
+    public boolean canInlineConstant(JavaConstant c) {
         if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) {
             return true;
         } else if (c instanceof HotSpotObjectConstant) {
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java	Thu Oct 30 12:21:07 2014 +0100
@@ -45,9 +45,9 @@
     public static class HotSpotLoadConstantOp extends AMD64LIRInstruction implements MoveOp {
 
         @Def({REG, STACK}) private AllocatableValue result;
-        private final Constant input;
+        private final JavaConstant input;
 
-        public HotSpotLoadConstantOp(AllocatableValue result, Constant input) {
+        public HotSpotLoadConstantOp(AllocatableValue result, JavaConstant input) {
             this.result = result;
             this.input = input;
         }
@@ -125,7 +125,7 @@
 
     public static class HotSpotStoreConstantOp extends StoreConstantOp {
 
-        public HotSpotStoreConstantOp(Kind kind, AMD64AddressValue address, Constant input, LIRFrameState state) {
+        public HotSpotStoreConstantOp(Kind kind, AMD64AddressValue address, JavaConstant input, LIRFrameState state) {
             super(kind, address, input, state);
         }
 
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -77,7 +77,7 @@
         if (ImmutableCode.getValue()) {
             Kind hostWordKind = HotSpotGraalRuntime.getHostWordKind();
             int alignment = hostWordKind.getBitCount() / Byte.SIZE;
-            Constant pollingPageAddress = Constant.forIntegerKind(hostWordKind, config.safepointPollingAddress);
+            JavaConstant pollingPageAddress = JavaConstant.forIntegerKind(hostWordKind, config.safepointPollingAddress);
             // This move will be patched to load the safepoint page from a data segment
             // co-located with the immutable code.
             asm.movq(scratch, (AMD64Address) crb.recordDataReferenceInCode(pollingPageAddress, alignment));
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64RawNativeCallNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64RawNativeCallNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,14 +35,14 @@
 @NodeInfo
 public class AMD64RawNativeCallNode extends FixedWithNextNode implements LIRLowerable {
 
-    protected final Constant functionPointer;
+    protected final JavaConstant functionPointer;
     @Input NodeInputList<ValueNode> args;
 
-    public static AMD64RawNativeCallNode create(Kind returnType, Constant functionPointer, ValueNode[] args) {
+    public static AMD64RawNativeCallNode create(Kind returnType, JavaConstant functionPointer, ValueNode[] args) {
         return new AMD64RawNativeCallNode(returnType, functionPointer, args);
     }
 
-    protected AMD64RawNativeCallNode(Kind returnType, Constant functionPointer, ValueNode[] args) {
+    protected AMD64RawNativeCallNode(Kind returnType, JavaConstant functionPointer, ValueNode[] args) {
         super(StampFactory.forKind(returnType));
         this.functionPointer = functionPointer;
         this.args = new NodeInputList<>(this, args);
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotAssembler.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotAssembler.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
     }
 
     @Override
-    public final void mov(Register a, Constant src) {
+    public final void mov(Register a, JavaConstant src) {
         String regName = "$d" + a.encoding();
         // For a null object simply move 0x0 into the destination register.
         if (src.isNull()) {
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java	Thu Oct 30 12:21:07 2014 +0100
@@ -646,11 +646,11 @@
                 asm.emitLoad(wordKind, d17SafepointFlagAddrIndex, new HSAILAddressValue(wordLIRKind, d16DeoptInfo, config.hsailNoticeSafepointsOffset).toAddress());
                 // Load int value from that field
                 asm.emitLoadAcquire(s34DeoptOccurred, new HSAILAddressValue(wordLIRKind, d17SafepointFlagAddrIndex, 0).toAddress());
-                asm.emitCompare(Kind.Int, s34DeoptOccurred, Constant.forInt(0), "ne", false, false);
+                asm.emitCompare(Kind.Int, s34DeoptOccurred, JavaConstant.forInt(0), "ne", false, false);
                 asm.cbr(deoptInProgressLabel);
             }
             asm.emitLoadAcquire(s34DeoptOccurred, new HSAILAddressValue(wordLIRKind, d16DeoptInfo, config.hsailDeoptOccurredOffset).toAddress());
-            asm.emitCompare(Kind.Int, s34DeoptOccurred, Constant.forInt(0), "ne", false, false);
+            asm.emitCompare(Kind.Int, s34DeoptOccurred, JavaConstant.forInt(0), "ne", false, false);
             asm.cbr(deoptInProgressLabel);
             // load thread register if this kernel performs allocation
             if (usesAllocation) {
@@ -661,7 +661,7 @@
                     asm.emitComment("// map workitem to a tlab");
                     asm.emitString(String.format("rem_u32  $%s, %s, %d;", s34TlabIndex.getRegister(), workItemReg, HsailKernelTlabs.getValue()));
                     asm.emitConvert(d17TlabIndex, s34TlabIndex, wordKind, Kind.Int);
-                    asm.emit("mad", threadReg, d17TlabIndex, Constant.forInt(8), threadReg);
+                    asm.emit("mad", threadReg, d17TlabIndex, JavaConstant.forInt(8), threadReg);
                 } else {
                     // workitem is already mapped to solitary tlab
                 }
@@ -836,7 +836,7 @@
             asm.emitConvert(waveMathScratch2, workidreg, wordKind, Kind.Int);
             asm.emit("add", waveMathScratch1, waveMathScratch1, waveMathScratch2);
             HSAILAddress neverRanStoreAddr = new HSAILAddressValue(wordLIRKind, waveMathScratch1, 0).toAddress();
-            asm.emitStore(Kind.Byte, Constant.forInt(1), neverRanStoreAddr);
+            asm.emitStore(Kind.Byte, JavaConstant.forInt(1), neverRanStoreAddr);
             asm.emitString("ret;");
 
             // The deoptimizing lanes will jump here
@@ -847,23 +847,23 @@
             asm.emitLoadKernelArg(scratch64, asm.getDeoptInfoName(), "u64");
 
             // Set deopt occurred flag
-            asm.emitMov(Kind.Int, scratch32, Constant.forInt(1));
+            asm.emitMov(Kind.Int, scratch32, JavaConstant.forInt(1));
             asm.emitStoreRelease(scratch32, deoptInfoAddr);
 
             asm.emitComment("// Determine next deopt save slot");
-            asm.emitAtomicAdd(scratch32, deoptNextIndexAddr, Constant.forInt(1));
+            asm.emitAtomicAdd(scratch32, deoptNextIndexAddr, JavaConstant.forInt(1));
             /*
              * scratch32 now holds next index to use set error condition if no room in save area
              */
             asm.emitComment("// assert room to save deopt");
-            asm.emitCompare(Kind.Int, scratch32, Constant.forInt(maxDeoptIndex), "lt", false, false);
+            asm.emitCompare(Kind.Int, scratch32, JavaConstant.forInt(maxDeoptIndex), "lt", false, false);
             asm.cbr("@L_StoreDeopt");
             /*
              * if assert fails, store a guaranteed negative workitemid in top level deopt occurred
              * flag
              */
             asm.emitWorkItemAbsId(scratch32);
-            asm.emit("mad", scratch32, scratch32, Constant.forInt(-1), Constant.forInt(-1));
+            asm.emit("mad", scratch32, scratch32, JavaConstant.forInt(-1), JavaConstant.forInt(-1));
             asm.emitStore(scratch32, deoptInfoAddr);
             asm.emitString("ret;");
 
@@ -874,17 +874,17 @@
             asm.emitComment("// Convert id's for ptr math");
             asm.emitConvert(cuSaveAreaPtr, scratch32, wordKind, Kind.Int);
             asm.emitComment("// multiply by sizeof KernelDeoptArea");
-            asm.emit("mul", cuSaveAreaPtr, cuSaveAreaPtr, Constant.forInt(sizeofKernelDeopt));
+            asm.emit("mul", cuSaveAreaPtr, cuSaveAreaPtr, JavaConstant.forInt(sizeofKernelDeopt));
             asm.emitComment("// Add computed offset to deoptInfoPtr base");
             asm.emit("add", cuSaveAreaPtr, cuSaveAreaPtr, scratch64);
             // Add offset to _deopt_save_states[0]
-            asm.emit("add", scratch64, cuSaveAreaPtr, Constant.forInt(offsetToDeoptSaveStates));
+            asm.emit("add", scratch64, cuSaveAreaPtr, JavaConstant.forInt(offsetToDeoptSaveStates));
 
             HSAILAddress workItemAddr = new HSAILAddressValue(wordLIRKind, scratch64, offsetToDeoptimizationWorkItem).toAddress();
             HSAILAddress actionReasonStoreAddr = new HSAILAddressValue(wordLIRKind, scratch64, offsetToDeoptimizationReason).toAddress();
 
             asm.emitComment("// Get _deopt_info._first_frame");
-            asm.emit("add", waveMathScratch1, scratch64, Constant.forInt(offsetToDeoptimizationFrame));
+            asm.emit("add", waveMathScratch1, scratch64, JavaConstant.forInt(offsetToDeoptimizationFrame));
             // Now scratch64 is the _deopt_info._first_frame
             HSAILAddress pcStoreAddr = new HSAILAddressValue(wordLIRKind, waveMathScratch1, offsetToFramePc).toAddress();
             HSAILAddress regCountsAddr = new HSAILAddressValue(wordLIRKind, waveMathScratch1, offsetToNumSaves).toAddress();
@@ -897,7 +897,7 @@
             asm.emitStore(Kind.Int, codeBufferOffsetReg, pcStoreAddr);
 
             asm.emitComment("// store regCounts (" + numSRegs + " $s registers, " + numDRegs + " $d registers, " + numStackSlots + " stack slots)");
-            asm.emitStore(Kind.Int, Constant.forInt(numSRegs + (numDRegs << 8) + (numStackSlots << 16)), regCountsAddr);
+            asm.emitStore(Kind.Int, JavaConstant.forInt(numSRegs + (numDRegs << 8) + (numStackSlots << 16)), regCountsAddr);
 
             /*
              * Loop thru the usedValues storing each of the registers that are used. We always store
@@ -1187,8 +1187,8 @@
     private static ValueNode getNodeForValueFromFrame(Value localValue, ParameterNode hsailFrame, StructuredGraph hostGraph, HotSpotProviders providers, HotSpotVMConfig config, int numSRegs,
                     int numDRegs, Map<VirtualObject, VirtualObjectNode> virtualObjects) {
         ValueNode valueNode;
-        if (localValue instanceof Constant) {
-            valueNode = ConstantNode.forConstant((Constant) localValue, providers.getMetaAccess(), hostGraph);
+        if (localValue instanceof JavaConstant) {
+            valueNode = ConstantNode.forConstant((JavaConstant) localValue, providers.getMetaAccess(), hostGraph);
         } else if (localValue instanceof VirtualObject) {
             valueNode = getNodeForVirtualObjectFromFrame((VirtualObject) localValue, virtualObjects, hostGraph);
         } else if (localValue instanceof StackSlot) {
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java	Thu Oct 30 12:21:07 2014 +0100
@@ -93,12 +93,12 @@
         return config.narrowKlassBase;
     }
 
-    private static boolean canStoreConstant(Constant c) {
+    private static boolean canStoreConstant(JavaConstant c) {
         return !(c instanceof HotSpotObjectConstant);
     }
 
     @Override
-    public boolean canInlineConstant(Constant c) {
+    public boolean canInlineConstant(JavaConstant c) {
         if (c instanceof HotSpotObjectConstant) {
             return c.isNull();
         } else {
@@ -125,9 +125,9 @@
     public void emitStore(LIRKind kind, Value address, Value inputVal, LIRFrameState state) {
         HSAILAddressValue storeAddress = asAddressValue(address);
         if (isConstant(inputVal)) {
-            Constant c = asConstant(inputVal);
+            JavaConstant c = asConstant(inputVal);
             if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) {
-                c = Constant.INT_0;
+                c = JavaConstant.INT_0;
             }
             if (canStoreConstant(c)) {
                 append(new StoreConstantOp((Kind) kind.getPlatformKind(), storeAddress, c, state));
@@ -234,8 +234,8 @@
     @Override
     protected HSAILLIRInstruction createMove(AllocatableValue dst, Value src) {
         if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(src)) {
-            return new MoveToRegOp(Kind.Int, dst, Constant.INT_0);
-        } else if (src instanceof HotSpotObjectConstant && HotSpotObjectConstant.isCompressed((Constant) src)) {
+            return new MoveToRegOp(Kind.Int, dst, JavaConstant.INT_0);
+        } else if (src instanceof HotSpotObjectConstant && HotSpotObjectConstant.isCompressed((JavaConstant) src)) {
             Variable uncompressed = newVariable(LIRKind.reference(Kind.Object));
             append(new MoveToRegOp(Kind.Object, uncompressed, src));
             CompressEncoding oopEncoding = config.getOopEncoding();
@@ -253,13 +253,13 @@
     /**
      * @return a compressed version of the incoming constant lifted from AMD64HotSpotLIRGenerator
      */
-    protected static Constant compress(Constant c, CompressEncoding encoding) {
+    protected static JavaConstant compress(JavaConstant c, CompressEncoding encoding) {
         if (c.getKind() == Kind.Long) {
             int compressedValue = (int) (((c.asLong() - encoding.base) >> encoding.shift) & 0xffffffffL);
             if (c instanceof HotSpotMetaspaceConstant) {
                 return HotSpotMetaspaceConstant.forMetaspaceObject(Kind.Int, compressedValue, HotSpotMetaspaceConstant.getMetaspaceObject(c), true);
             } else {
-                return Constant.forIntegerKind(Kind.Int, compressedValue);
+                return JavaConstant.forIntegerKind(Kind.Int, compressedValue);
             }
         } else {
             throw GraalInternalError.shouldNotReachHere();
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotNodeLIRBuilder.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotNodeLIRBuilder.java	Thu Oct 30 12:21:07 2014 +0100
@@ -64,13 +64,13 @@
     /**
      * @return a compressed version of the incoming constant lifted from AMD64HotSpotLIRGenerator
      */
-    protected static Constant compress(Constant c, CompressEncoding encoding) {
+    protected static JavaConstant compress(JavaConstant c, CompressEncoding encoding) {
         if (c.getKind() == Kind.Long) {
             int compressedValue = (int) (((c.asLong() - encoding.base) >> encoding.shift) & 0xffffffffL);
             if (c instanceof HotSpotMetaspaceConstant) {
                 return HotSpotMetaspaceConstant.forMetaspaceObject(Kind.Int, compressedValue, HotSpotMetaspaceConstant.getMetaspaceObject(c), true);
             } else {
-                return Constant.forIntegerKind(Kind.Int, compressedValue);
+                return JavaConstant.forIntegerKind(Kind.Int, compressedValue);
             }
         } else {
             throw GraalInternalError.shouldNotReachHere();
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotSafepointOp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotSafepointOp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -37,7 +37,7 @@
  */
 @Opcode("SAFEPOINT")
 public class HSAILHotSpotSafepointOp extends HSAILLIRInstruction implements HSAILControlFlow.DeoptimizingOp {
-    private Constant actionAndReason;
+    private JavaConstant actionAndReason;
     @State protected LIRFrameState frameState;
     protected int codeBufferPos = -1;
     final int offsetToNoticeSafepoints;
@@ -73,13 +73,13 @@
             // Load int value from that field
             HSAILAddress noticeSafepointsIntAddr = new HSAILAddressValue(LIRKind.value(Kind.Long), spAddrReg, 0).toAddress();
             masm.emitLoadAcquire(scratch32, noticeSafepointsIntAddr);
-            masm.emitCompare(Kind.Int, scratch32, Constant.forInt(0), "eq", false, false);
+            masm.emitCompare(Kind.Int, scratch32, JavaConstant.forInt(0), "eq", false, false);
             masm.cbr(afterSafepointLabel);
 
             AllocatableValue actionAndReasonReg = HSAIL.actionAndReasonReg.asValue(LIRKind.value(Kind.Int));
             AllocatableValue codeBufferOffsetReg = HSAIL.codeBufferOffsetReg.asValue(LIRKind.value(Kind.Int));
             masm.emitMov(Kind.Int, actionAndReasonReg, actionAndReason);
-            masm.emitMov(Kind.Int, codeBufferOffsetReg, Constant.forInt(codeBufferPos));
+            masm.emitMov(Kind.Int, codeBufferOffsetReg, JavaConstant.forInt(codeBufferPos));
             masm.emitJumpToLabelName(masm.getDeoptLabelName());
 
             masm.emitString0(afterSafepointLabel + ":\n");
--- a/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/ReplacingStreams.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/ReplacingStreams.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -170,8 +170,8 @@
             }
 
             // is the object a constant of object type?
-            if (obj.getClass() == Constant.class) {
-                Constant constant = (Constant) obj;
+            if (obj.getClass() == JavaConstant.class) {
+                JavaConstant constant = (JavaConstant) obj;
                 if (constant.getKind() != Kind.Object) {
                     return obj;
                 }
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java	Thu Oct 30 12:21:07 2014 +0100
@@ -179,7 +179,7 @@
 
     @Override
     public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) {
-        moveDeoptValuesToThread(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0), Constant.NULL_OBJECT);
+        moveDeoptValuesToThread(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0), JavaConstant.NULL_OBJECT);
         append(new SPARCHotSpotDeoptimizeCallerOp());
     }
 
@@ -191,7 +191,7 @@
         return result;
     }
 
-    private static boolean canStoreConstant(Constant c) {
+    private static boolean canStoreConstant(JavaConstant c) {
         // SPARC can only store integer null constants (via g0)
         switch (c.getKind()) {
             case Float:
@@ -206,7 +206,7 @@
     public void emitStore(LIRKind kind, Value address, Value inputVal, LIRFrameState state) {
         SPARCAddressValue storeAddress = asAddressValue(address);
         if (isConstant(inputVal)) {
-            Constant c = asConstant(inputVal);
+            JavaConstant c = asConstant(inputVal);
             if (canStoreConstant(c)) {
                 append(new StoreConstantOp((Kind) kind.getPlatformKind(), storeAddress, c, state));
                 return;
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -92,7 +92,7 @@
         NodeIterable<ConstantNode> filter = getConstantNodes(result);
         assertDeepEquals(1, filter.count());
         HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) getMetaAccess().lookupJavaType(AheadOfTimeCompilationTest.class);
-        assertDeepEquals(type.klass(), filter.first().asConstant());
+        assertDeepEquals(type.klass(), filter.first().asJavaConstant());
 
         assertDeepEquals(1, result.getNodes(FloatingReadNode.class).count());
         assertDeepEquals(0, result.getNodes().filter(ReadNode.class).count());
@@ -104,7 +104,7 @@
 
         NodeIterable<ConstantNode> filter = getConstantNodes(result);
         assertDeepEquals(1, filter.count());
-        Object mirror = HotSpotObjectConstant.asObject(filter.first().asConstant());
+        Object mirror = HotSpotObjectConstant.asObject(filter.first().asJavaConstant());
         assertDeepEquals(Class.class, mirror.getClass());
         assertDeepEquals(AheadOfTimeCompilationTest.class, mirror);
 
@@ -132,7 +132,7 @@
         StructuredGraph result = compile("getPrimitiveClassObject", false);
         NodeIterable<ConstantNode> filter = getConstantNodes(result);
         assertDeepEquals(1, filter.count());
-        Object mirror = HotSpotObjectConstant.asObject(filter.first().asConstant());
+        Object mirror = HotSpotObjectConstant.asObject(filter.first().asJavaConstant());
         assertDeepEquals(Class.class, mirror.getClass());
         assertDeepEquals(Integer.TYPE, mirror);
 
@@ -160,7 +160,7 @@
 
         NodeIterable<ConstantNode> filter = getConstantNodes(result);
         assertDeepEquals(1, filter.count());
-        Object mirror = HotSpotObjectConstant.asObject(filter.first().asConstant());
+        Object mirror = HotSpotObjectConstant.asObject(filter.first().asJavaConstant());
         assertDeepEquals(String.class, mirror.getClass());
         assertDeepEquals("test string", mirror);
 
@@ -182,7 +182,7 @@
         assertDeepEquals(1, getConstantNodes(result).count());
         ConstantNode constant = getConstantNodes(result).first();
         assertDeepEquals(Kind.Long, constant.getKind());
-        assertDeepEquals(((HotSpotResolvedObjectType) getMetaAccess().lookupJavaType(Boolean.class)).klass(), constant.asConstant());
+        assertDeepEquals(((HotSpotResolvedObjectType) getMetaAccess().lookupJavaType(Boolean.class)).klass(), constant.asJavaConstant());
     }
 
     @Test
@@ -193,7 +193,7 @@
         assertDeepEquals(1, getConstantNodes(result).count());
         ConstantNode constant = getConstantNodes(result).first();
         assertDeepEquals(Kind.Object, constant.getKind());
-        assertDeepEquals(Boolean.TRUE, HotSpotObjectConstant.asObject(constant.asConstant()));
+        assertDeepEquals(Boolean.TRUE, HotSpotObjectConstant.asObject(constant.asJavaConstant()));
     }
 
     private StructuredGraph compile(String test, boolean compileAOT) {
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/InstalledCodeExecuteHelperTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/InstalledCodeExecuteHelperTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@
             assert parameterTypes.length == args.length;
             for (int i = 0; i < argsToBind.length; i++) {
                 ParameterNode param = graph.getParameter(i);
-                Constant c = HotSpotObjectConstant.forBoxedValue(parameterTypes[i].getKind(), argsToBind[i]);
+                JavaConstant c = HotSpotObjectConstant.forBoxedValue(parameterTypes[i].getKind(), argsToBind[i]);
                 ConstantNode replacement = ConstantNode.forConstant(c, getMetaAccess(), graph);
                 param.replaceAtUsages(replacement);
             }
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -651,7 +651,7 @@
                                  * A "barrierIndex" variable was found and is checked against the
                                  * input barrier array.
                                  */
-                                if (eliminateBarrier(write.value().asConstant().asInt(), removedBarrierIndices)) {
+                                if (eliminateBarrier(write.value().asJavaConstant().asInt(), removedBarrierIndices)) {
                                     return true;
                                 }
                             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledRuntimeStub.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledRuntimeStub.java	Thu Oct 30 12:21:07 2014 +0100
@@ -57,7 +57,7 @@
             if (data.reference instanceof ConstantReference) {
                 ConstantReference ref = (ConstantReference) data.reference;
                 if (ref.getConstant() instanceof HotSpotMetaspaceConstant) {
-                    Object object = HotSpotMetaspaceConstant.getMetaspaceObject((Constant) ref.getConstant());
+                    Object object = HotSpotMetaspaceConstant.getMetaspaceObject((JavaConstant) ref.getConstant());
                     if (object instanceof HotSpotResolvedObjectType && ((HotSpotResolvedObjectType) object).getName().equals("[I")) {
                         // special handling for NewArrayStub
                         // embedding the type '[I' is safe, since it is never unloaded
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@
         }
         assert groups.get(index).equals(group) : "mismatching groups: " + groups.get(index) + " vs. " + group;
         if (counter.getIncrement().isConstant()) {
-            staticCounters.get(index).addAndGet(counter.getIncrement().asConstant().asLong());
+            staticCounters.get(index).addAndGet(counter.getIncrement().asJavaConstant().asLong());
         }
         return index;
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -402,7 +402,7 @@
         Kind wordKind = target.wordKind;
         HotSpotVMConfig config = runtime.getConfig();
         LocationNode location = ConstantLocationNode.create(FINAL_LOCATION, wordKind, config.hubOffset, graph);
-        assert !object.isConstant() || object.asConstant().isNull();
+        assert !object.isConstant() || object.asJavaConstant().isNull();
 
         Stamp hubStamp;
         if (config.useCompressedClassPointers) {
@@ -422,7 +422,7 @@
     private WriteNode createWriteHub(StructuredGraph graph, Kind wordKind, ValueNode object, ValueNode value) {
         HotSpotVMConfig config = runtime.getConfig();
         LocationNode location = ConstantLocationNode.create(HUB_LOCATION, wordKind, config.hubOffset, graph);
-        assert !object.isConstant() || object.asConstant().isNull();
+        assert !object.isConstant() || object.asJavaConstant().isNull();
 
         ValueNode writeValue = value;
         if (config.useCompressedClassPointers) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -252,11 +252,11 @@
         return code;
     }
 
-    public boolean needsDataPatch(Constant constant) {
+    public boolean needsDataPatch(JavaConstant constant) {
         return constant instanceof HotSpotMetaspaceConstant;
     }
 
-    public Data createDataItem(Constant constant) {
+    public Data createDataItem(JavaConstant constant) {
         int size;
         DataBuilder builder;
         if (constant instanceof VMConstant) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCompressedNullConstant.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCompressedNullConstant.java	Thu Oct 30 12:21:07 2014 +0100
@@ -25,13 +25,13 @@
 import com.oracle.graal.api.meta.*;
 
 /**
- * The compressed representation of the {@link Constant#NULL_OBJECT null constant}.
+ * The compressed representation of the {@link JavaConstant#NULL_OBJECT null constant}.
  */
-public final class HotSpotCompressedNullConstant extends Constant implements HotSpotConstant {
+public final class HotSpotCompressedNullConstant extends JavaConstant implements HotSpotConstant {
 
     private static final long serialVersionUID = 8906209595800783961L;
 
-    public static final Constant COMPRESSED_NULL = new HotSpotCompressedNullConstant();
+    public static final JavaConstant COMPRESSED_NULL = new HotSpotCompressedNullConstant();
 
     private HotSpotCompressedNullConstant() {
         super(LIRKind.reference(Kind.Int));
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -383,13 +383,13 @@
         final JVM_CONSTANT tag = getTagAt(cpi);
         switch (tag) {
             case Integer:
-                return Constant.forInt(getIntAt(cpi));
+                return JavaConstant.forInt(getIntAt(cpi));
             case Long:
-                return Constant.forLong(getLongAt(cpi));
+                return JavaConstant.forLong(getLongAt(cpi));
             case Float:
-                return Constant.forFloat(getFloatAt(cpi));
+                return JavaConstant.forFloat(getFloatAt(cpi));
             case Double:
-                return Constant.forDouble(getDoubleAt(cpi));
+                return JavaConstant.forDouble(getDoubleAt(cpi));
             case Class:
             case UnresolvedClass:
             case UnresolvedClassInError:
@@ -421,7 +421,7 @@
     }
 
     @Override
-    public Constant lookupAppendix(int cpi, int opcode) {
+    public JavaConstant lookupAppendix(int cpi, int opcode) {
         assert Bytecodes.isInvoke(opcode);
         final int index = toConstantPoolIndex(cpi, opcode);
         Object result = runtime().getCompilerToVM().lookupAppendixInPool(metaspaceConstantPool, index);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantReflectionProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantReflectionProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -43,12 +43,12 @@
     }
 
     @Override
-    public Boolean constantEquals(Constant x, Constant y) {
+    public Boolean constantEquals(JavaConstant x, JavaConstant y) {
         return x.equals(y);
     }
 
     @Override
-    public Integer readArrayLength(Constant array) {
+    public Integer readArrayLength(JavaConstant array) {
         if (array.getKind() != Kind.Object || array.isNull() || !HotSpotObjectConstant.asObject(array).getClass().isArray()) {
             return null;
         }
@@ -56,7 +56,7 @@
     }
 
     @Override
-    public Constant readUnsafeConstant(Kind kind, Constant baseConstant, long initialDisplacement) {
+    public JavaConstant readUnsafeConstant(Kind kind, JavaConstant baseConstant, long initialDisplacement) {
         Object base;
         long displacement;
         if (baseConstant.getKind() == Kind.Object) {
@@ -78,29 +78,29 @@
 
         switch (kind) {
             case Boolean:
-                return Constant.forBoolean(base == null ? unsafe.getByte(displacement) != 0 : unsafe.getBoolean(base, displacement));
+                return JavaConstant.forBoolean(base == null ? unsafe.getByte(displacement) != 0 : unsafe.getBoolean(base, displacement));
             case Byte:
-                return Constant.forByte(base == null ? unsafe.getByte(displacement) : unsafe.getByte(base, displacement));
+                return JavaConstant.forByte(base == null ? unsafe.getByte(displacement) : unsafe.getByte(base, displacement));
             case Char:
-                return Constant.forChar(base == null ? unsafe.getChar(displacement) : unsafe.getChar(base, displacement));
+                return JavaConstant.forChar(base == null ? unsafe.getChar(displacement) : unsafe.getChar(base, displacement));
             case Short:
-                return Constant.forShort(base == null ? unsafe.getShort(displacement) : unsafe.getShort(base, displacement));
+                return JavaConstant.forShort(base == null ? unsafe.getShort(displacement) : unsafe.getShort(base, displacement));
             case Int:
-                return Constant.forInt(base == null ? unsafe.getInt(displacement) : unsafe.getInt(base, displacement));
+                return JavaConstant.forInt(base == null ? unsafe.getInt(displacement) : unsafe.getInt(base, displacement));
             case Long:
                 if (displacement == config().hubOffset && runtime.getConfig().useCompressedClassPointers) {
                     if (base == null) {
                         throw new GraalInternalError("Base of object must not be null");
                     } else {
-                        return Constant.forLong(runtime.getCompilerToVM().readUnsafeKlassPointer(base));
+                        return JavaConstant.forLong(runtime.getCompilerToVM().readUnsafeKlassPointer(base));
                     }
                 } else {
-                    return Constant.forLong(base == null ? unsafe.getLong(displacement) : unsafe.getLong(base, displacement));
+                    return JavaConstant.forLong(base == null ? unsafe.getLong(displacement) : unsafe.getLong(base, displacement));
                 }
             case Float:
-                return Constant.forFloat(base == null ? unsafe.getFloat(displacement) : unsafe.getFloat(base, displacement));
+                return JavaConstant.forFloat(base == null ? unsafe.getFloat(displacement) : unsafe.getFloat(base, displacement));
             case Double:
-                return Constant.forDouble(base == null ? unsafe.getDouble(displacement) : unsafe.getDouble(base, displacement));
+                return JavaConstant.forDouble(base == null ? unsafe.getDouble(displacement) : unsafe.getDouble(base, displacement));
             case Object: {
                 Object o = null;
                 if (baseConstant.getKind() == Kind.Object) {
@@ -123,7 +123,7 @@
     }
 
     @Override
-    public Constant readRawConstant(Kind kind, Constant baseConstant, long initialDisplacement, int bits) {
+    public JavaConstant readRawConstant(Kind kind, JavaConstant baseConstant, long initialDisplacement, int bits) {
         Object base;
         long displacement;
         if (baseConstant.getKind() == Kind.Object) {
@@ -174,13 +174,13 @@
         } else {
             switch (kind) {
                 case Int:
-                    return Constant.forInt((int) rawValue);
+                    return JavaConstant.forInt((int) rawValue);
                 case Long:
-                    return Constant.forLong(rawValue);
+                    return JavaConstant.forLong(rawValue);
                 case Float:
-                    return Constant.forFloat(Float.intBitsToFloat((int) rawValue));
+                    return JavaConstant.forFloat(Float.intBitsToFloat((int) rawValue));
                 case Double:
-                    return Constant.forDouble(Double.longBitsToDouble(rawValue));
+                    return JavaConstant.forDouble(Double.longBitsToDouble(rawValue));
                 default:
                     throw GraalInternalError.shouldNotReachHere();
             }
@@ -188,7 +188,7 @@
     }
 
     @Override
-    public Constant readArrayElement(Constant array, int index) {
+    public JavaConstant readArrayElement(JavaConstant array, int index) {
         if (array.getKind() != Kind.Object || array.isNull()) {
             return null;
         }
@@ -201,12 +201,12 @@
         if (a instanceof Object[]) {
             return HotSpotObjectConstant.forObject(((Object[]) a)[index]);
         } else {
-            return Constant.forBoxedPrimitive(Array.get(a, index));
+            return JavaConstant.forBoxedPrimitive(Array.get(a, index));
         }
     }
 
     @Override
-    public Constant boxPrimitive(Constant source) {
+    public JavaConstant boxPrimitive(JavaConstant source) {
         if (!source.getKind().isPrimitive()) {
             return null;
         }
@@ -214,15 +214,15 @@
     }
 
     @Override
-    public Constant unboxPrimitive(Constant source) {
+    public JavaConstant unboxPrimitive(JavaConstant source) {
         if (!source.getKind().isObject()) {
             return null;
         }
-        return Constant.forBoxedPrimitive(HotSpotObjectConstant.asObject(source));
+        return JavaConstant.forBoxedPrimitive(HotSpotObjectConstant.asObject(source));
     }
 
     @Override
-    public ResolvedJavaType asJavaType(Constant constant) {
+    public ResolvedJavaType asJavaType(JavaConstant constant) {
         if (constant instanceof HotSpotObjectConstant) {
             Object obj = HotSpotObjectConstant.asObject(constant);
             if (obj instanceof Class) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaAccessProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaAccessProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
         return fromClass(clazz);
     }
 
-    public HotSpotResolvedObjectType lookupJavaType(Constant constant) {
+    public HotSpotResolvedObjectType lookupJavaType(JavaConstant constant) {
         if (constant.isNull() || !(constant instanceof HotSpotObjectConstant)) {
             return null;
         }
@@ -132,31 +132,31 @@
     }
 
     @Override
-    public Constant encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason, int debugId) {
+    public JavaConstant encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason, int debugId) {
         HotSpotVMConfig config = runtime.getConfig();
         int actionValue = convertDeoptAction(action);
         int reasonValue = convertDeoptReason(reason);
         int debugValue = debugId & intMaskRight(config.deoptimizationDebugIdBits);
-        Constant c = Constant.forInt(~((debugValue << config.deoptimizationDebugIdShift) | (reasonValue << config.deoptimizationReasonShift) | (actionValue << config.deoptimizationActionShift)));
+        JavaConstant c = JavaConstant.forInt(~((debugValue << config.deoptimizationDebugIdShift) | (reasonValue << config.deoptimizationReasonShift) | (actionValue << config.deoptimizationActionShift)));
         assert c.asInt() < 0;
         return c;
     }
 
-    public DeoptimizationReason decodeDeoptReason(Constant constant) {
+    public DeoptimizationReason decodeDeoptReason(JavaConstant constant) {
         HotSpotVMConfig config = runtime.getConfig();
         int reasonValue = ((~constant.asInt()) >> config.deoptimizationReasonShift) & intMaskRight(config.deoptimizationReasonBits);
         DeoptimizationReason reason = convertDeoptReason(reasonValue);
         return reason;
     }
 
-    public DeoptimizationAction decodeDeoptAction(Constant constant) {
+    public DeoptimizationAction decodeDeoptAction(JavaConstant constant) {
         HotSpotVMConfig config = runtime.getConfig();
         int actionValue = ((~constant.asInt()) >> config.deoptimizationActionShift) & intMaskRight(config.deoptimizationActionBits);
         DeoptimizationAction action = convertDeoptAction(actionValue);
         return action;
     }
 
-    public int decodeDebugId(Constant constant) {
+    public int decodeDebugId(JavaConstant constant) {
         HotSpotVMConfig config = runtime.getConfig();
         return ((~constant.asInt()) >> config.deoptimizationDebugIdShift) & intMaskRight(config.deoptimizationDebugIdBits);
     }
@@ -293,7 +293,7 @@
     }
 
     @Override
-    public long getMemorySize(Constant constant) {
+    public long getMemorySize(JavaConstant constant) {
         if (constant.getKind() == Kind.Object) {
             HotSpotResolvedObjectType lookupJavaType = this.lookupJavaType(constant);
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstant.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstant.java	Thu Oct 30 12:21:07 2014 +0100
@@ -30,11 +30,11 @@
 
     private static final long serialVersionUID = 1003463314013122983L;
 
-    public static Constant forMetaspaceObject(Kind kind, long primitive, Object metaspaceObject, boolean compressed) {
+    public static JavaConstant forMetaspaceObject(Kind kind, long primitive, Object metaspaceObject, boolean compressed) {
         return new HotSpotMetaspaceConstant(kind, primitive, metaspaceObject, compressed);
     }
 
-    public static Object getMetaspaceObject(Constant constant) {
+    public static Object getMetaspaceObject(JavaConstant constant) {
         return ((HotSpotMetaspaceConstant) constant).metaspaceObject;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodHandleAccessProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodHandleAccessProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -110,21 +110,21 @@
     }
 
     @Override
-    public ResolvedJavaMethod resolveInvokeBasicTarget(Constant methodHandle, boolean forceBytecodeGeneration) {
+    public ResolvedJavaMethod resolveInvokeBasicTarget(JavaConstant methodHandle, boolean forceBytecodeGeneration) {
         if (methodHandle.isNull()) {
             return null;
         }
 
         /* Load non-public field: LambdaForm MethodHandle.form */
-        Constant lambdaForm = LazyInitialization.methodHandleFormField.readValue(methodHandle);
+        JavaConstant lambdaForm = LazyInitialization.methodHandleFormField.readValue(methodHandle);
         if (lambdaForm.isNull()) {
             return null;
         }
 
-        Constant memberName;
+        JavaConstant memberName;
         if (forceBytecodeGeneration) {
             /* Invoke non-public method: MemberName LambdaForm.compileToBytecode() */
-            memberName = LazyInitialization.lambdaFormCompileToBytecodeMethod.invoke(lambdaForm, new Constant[0]);
+            memberName = LazyInitialization.lambdaFormCompileToBytecodeMethod.invoke(lambdaForm, new JavaConstant[0]);
         } else {
             /* Load non-public field: MemberName LambdaForm.vmentry */
             memberName = LazyInitialization.lambdaFormVmentryField.readValue(lambdaForm);
@@ -133,20 +133,20 @@
     }
 
     @Override
-    public ResolvedJavaMethod resolveLinkToTarget(Constant memberName) {
+    public ResolvedJavaMethod resolveLinkToTarget(JavaConstant memberName) {
         return getTargetMethod(memberName);
     }
 
     /**
      * Returns the {@link ResolvedJavaMethod} for the vmtarget of a java.lang.invoke.MemberName.
      */
-    private static ResolvedJavaMethod getTargetMethod(Constant memberName) {
+    private static ResolvedJavaMethod getTargetMethod(JavaConstant memberName) {
         if (memberName.isNull()) {
             return null;
         }
 
         /* Load injected field: JVM_Method* MemberName.vmtarget */
-        Constant vmtarget = LazyInitialization.memberNameVmtargetField.readValue(memberName);
+        JavaConstant vmtarget = LazyInitialization.memberNameVmtargetField.readValue(memberName);
         /* Create a method from the vmtarget method pointer. */
         return HotSpotResolvedJavaMethod.fromMetaspace(vmtarget.asLong());
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java	Thu Oct 30 12:21:07 2014 +0100
@@ -28,27 +28,27 @@
  * Represents a constant non-{@code null} object reference, within the compiler and across the
  * compiler/runtime interface.
  */
-public final class HotSpotObjectConstant extends Constant implements HotSpotConstant, VMConstant {
+public final class HotSpotObjectConstant extends JavaConstant implements HotSpotConstant, VMConstant {
 
     private static final long serialVersionUID = 3592151693708093496L;
 
-    public static Constant forObject(Object object) {
+    public static JavaConstant forObject(Object object) {
         if (object == null) {
-            return Constant.NULL_OBJECT;
+            return JavaConstant.NULL_OBJECT;
         } else {
             return new HotSpotObjectConstant(object, false);
         }
     }
 
-    public static Constant forBoxedValue(Kind kind, Object value) {
+    public static JavaConstant forBoxedValue(Kind kind, Object value) {
         if (kind == Kind.Object) {
             return HotSpotObjectConstant.forObject(value);
         } else {
-            return Constant.forBoxedPrimitive(value);
+            return JavaConstant.forBoxedPrimitive(value);
         }
     }
 
-    public static Object asObject(Constant constant) {
+    public static Object asObject(JavaConstant constant) {
         if (constant.isNull()) {
             return null;
         } else {
@@ -56,7 +56,7 @@
         }
     }
 
-    public static Object asBoxedValue(Constant constant) {
+    public static Object asBoxedValue(JavaConstant constant) {
         if (constant.isNull()) {
             return null;
         } else if (constant instanceof HotSpotObjectConstant) {
@@ -66,7 +66,7 @@
         }
     }
 
-    public static boolean isCompressed(Constant constant) {
+    public static boolean isCompressed(JavaConstant constant) {
         if (constant.isNull()) {
             return HotSpotCompressedNullConstant.NULL_OBJECT.equals(constant);
         } else {
@@ -84,12 +84,12 @@
         assert object != null;
     }
 
-    public Constant compress() {
+    public JavaConstant compress() {
         assert !compressed;
         return new HotSpotObjectConstant(object, true);
     }
 
-    public Constant uncompress() {
+    public JavaConstant uncompress() {
         assert compressed;
         return new HotSpotObjectConstant(object, false);
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Thu Oct 30 12:21:07 2014 +0100
@@ -101,8 +101,8 @@
     }
 
     /**
-     * If the compiler is configured for AOT mode, {@link #readConstantValue(Constant)} should be
-     * only called for snippets or replacements.
+     * If the compiler is configured for AOT mode, {@link #readConstantValue(JavaConstant)} should
+     * be only called for snippets or replacements.
      */
     private static boolean isCalledForSnippets() {
         MetaAccessProvider metaAccess = runtime().getHostProviders().getMetaAccess();
@@ -194,7 +194,7 @@
      * {@code receiver} is (assignable to) {@link StableOptionValue}.
      */
     @Override
-    public Constant readConstantValue(Constant receiver) {
+    public JavaConstant readConstantValue(JavaConstant receiver) {
         assert !ImmutableCode.getValue() || isCalledForSnippets() : receiver;
 
         if (receiver == null) {
@@ -218,14 +218,14 @@
             if (object != null) {
                 if (isFinal()) {
                     if (isInObject(object)) {
-                        Constant value = readValue(receiver);
+                        JavaConstant value = readValue(receiver);
                         if (assumeNonStaticFinalFieldsAsFinal(object.getClass()) || !value.isDefaultForKind()) {
                             return value;
                         }
                     }
                 } else if (isStable()) {
                     if (isInObject(object)) {
-                        Constant value = readValue(receiver);
+                        JavaConstant value = readValue(receiver);
                         if (assumeDefaultStableFieldsAsFinal(object.getClass()) || !value.isDefaultForKind()) {
                             return value;
                         }
@@ -259,7 +259,7 @@
     }
 
     @Override
-    public Constant readValue(Constant receiver) {
+    public JavaConstant readValue(JavaConstant receiver) {
         if (receiver == null) {
             assert isStatic();
             if (holder.isInitialized()) {
@@ -279,8 +279,8 @@
 
     /**
      * Usually {@link Stable} fields are not considered constant if the value is the
-     * {@link Constant#isDefaultForKind default value}. For some special classes we want to override
-     * this behavior.
+     * {@link JavaConstant#isDefaultForKind default value}. For some special classes we want to
+     * override this behavior.
      */
     private static boolean assumeDefaultStableFieldsAsFinal(Class<?> clazz) {
         // HotSpotVMConfig has a lot of zero-value fields which we know are stable and want to be
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Thu Oct 30 12:21:07 2014 +0100
@@ -159,7 +159,7 @@
     /**
      * Gets the address of the C++ Method object for this method.
      */
-    public Constant getMetaspaceMethodConstant() {
+    public JavaConstant getMetaspaceMethodConstant() {
         return HotSpotMetaspaceConstant.forMetaspaceObject(getHostWordKind(), metaspaceMethod, this, false);
     }
 
@@ -168,7 +168,7 @@
     }
 
     @Override
-    public Constant getEncoding() {
+    public JavaConstant getEncoding() {
         return getMetaspaceMethodConstant();
     }
 
@@ -702,7 +702,7 @@
     }
 
     @Override
-    public Constant invoke(Constant receiver, Constant[] arguments) {
+    public JavaConstant invoke(JavaConstant receiver, JavaConstant[] arguments) {
         assert !isConstructor();
         Method javaMethod = toJava();
         javaMethod.setAccessible(true);
@@ -723,7 +723,7 @@
     }
 
     @Override
-    public Constant newInstance(Constant[] arguments) {
+    public JavaConstant newInstance(JavaConstant[] arguments) {
         assert isConstructor();
         Constructor<?> javaConstructor = toJavaConstructor();
         javaConstructor.setAccessible(true);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Thu Oct 30 12:21:07 2014 +0100
@@ -66,10 +66,10 @@
     /**
      * Gets the Graal mirror from a HotSpot metaspace Klass native object.
      *
-     * @param metaspaceKlass a metaspace Klass object boxed in a {@link Constant}
+     * @param metaspaceKlass a metaspace Klass object boxed in a {@link JavaConstant}
      * @return the {@link HotSpotResolvedObjectType} corresponding to {@code klassConstant}
      */
-    public static HotSpotResolvedObjectType fromMetaspaceKlass(Constant metaspaceKlass) {
+    public static HotSpotResolvedObjectType fromMetaspaceKlass(JavaConstant metaspaceKlass) {
         assert metaspaceKlass.getKind() == Kind.Long;
         return fromMetaspaceKlass(metaspaceKlass.asLong());
     }
@@ -93,7 +93,7 @@
      * <p>
      * <b>NOTE</b>: Creating an instance of this class does not install the mirror for the
      * {@link Class} type. Use {@link #fromObjectClass(Class)},
-     * {@link #fromMetaspaceKlass(Constant)} or {@link #fromMetaspaceKlass(long)} instead.
+     * {@link #fromMetaspaceKlass(JavaConstant)} or {@link #fromMetaspaceKlass(long)} instead.
      * </p>
      *
      * @param javaClass the Class to create the mirror for
@@ -278,7 +278,7 @@
     }
 
     @Override
-    public Constant getEncoding(Representation r) {
+    public JavaConstant getEncoding(Representation r) {
         switch (r) {
             case JavaClass:
                 return HotSpotObjectConstant.forObject(mirror());
@@ -341,7 +341,7 @@
     }
 
     @Override
-    public boolean isInstance(Constant obj) {
+    public boolean isInstance(JavaConstant obj) {
         if (obj.getKind() == Kind.Object && !obj.isNull()) {
             return mirror().isInstance(HotSpotObjectConstant.asObject(obj));
         }
@@ -777,9 +777,9 @@
     }
 
     /**
-     * Gets the metaspace Klass boxed in a {@link Constant}.
+     * Gets the metaspace Klass boxed in a {@link JavaConstant}.
      */
-    public Constant klass() {
+    public JavaConstant klass() {
         return HotSpotMetaspaceConstant.forMetaspaceObject(runtime().getTarget().wordKind, getMetaspaceKlass(), this, false);
     }
 
@@ -865,7 +865,7 @@
     }
 
     @Override
-    public Constant newArray(int length) {
+    public JavaConstant newArray(int length) {
         return HotSpotObjectConstant.forObject(Array.newInstance(mirror(), length));
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -114,7 +114,7 @@
     }
 
     @Override
-    public Constant getEncoding(Representation r) {
+    public JavaConstant getEncoding(Representation r) {
         throw GraalInternalError.unimplemented("HotSpotResolvedPrimitiveType.getEncoding");
     }
 
@@ -148,7 +148,7 @@
     }
 
     @Override
-    public boolean isInstance(Constant obj) {
+    public boolean isInstance(JavaConstant obj) {
         return false;
     }
 
@@ -274,7 +274,7 @@
     }
 
     @Override
-    public Constant newArray(int length) {
+    public JavaConstant newArray(int length) {
         return HotSpotObjectConstant.forObject(Array.newInstance(mirror(), length));
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -28,22 +28,22 @@
 public class HotSpotSnippetReflectionProvider implements SnippetReflectionProvider {
 
     @Override
-    public Constant forObject(Object object) {
+    public JavaConstant forObject(Object object) {
         return HotSpotObjectConstant.forObject(object);
     }
 
     @Override
-    public Object asObject(Constant constant) {
+    public Object asObject(JavaConstant constant) {
         return HotSpotObjectConstant.asObject(constant);
     }
 
     @Override
-    public Constant forBoxed(Kind kind, Object value) {
+    public JavaConstant forBoxed(Kind kind, Object value) {
         return HotSpotObjectConstant.forBoxedValue(kind, value);
     }
 
     @Override
-    public Object asBoxedValue(Constant constant) {
+    public Object asBoxedValue(JavaConstant constant) {
         return HotSpotObjectConstant.asBoxedValue(constant);
     }
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSpeculationLog.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSpeculationLog.java	Thu Oct 30 12:21:07 2014 +0100
@@ -28,7 +28,7 @@
 public class HotSpotSpeculationLog extends SpeculationLog {
 
     @Override
-    public Constant speculate(Object reason) {
+    public JavaConstant speculate(Object reason) {
         addSpeculation(reason);
         return HotSpotObjectConstant.forObject(reason);
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
             g.start().setStateAfter(frameState);
             List<ValueNode> parameters = new ArrayList<>();
             FixedWithNextNode fixedWithNext = getParameters(g, arg0, argumentTypes.length, argumentTypes, parameters, providers);
-            Constant functionPointerNode = Constant.forLong(functionPointer);
+            JavaConstant functionPointerNode = JavaConstant.forLong(functionPointer);
 
             ValueNode[] arguments = new ValueNode[parameters.size()];
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/RawNativeCallNodeFactory.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/RawNativeCallNodeFactory.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,5 +29,5 @@
  * Factory for creating a node that makes a direct call to a native function pointer.
  */
 public interface RawNativeCallNodeFactory {
-    FixedWithNextNode createRawCallNode(Kind returnType, Constant functionPointer, ValueNode... args);
+    FixedWithNextNode createRawCallNode(Kind returnType, JavaConstant functionPointer, ValueNode... args);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassCastNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassCastNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -65,7 +65,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forJavaClass, ValueNode forObject) {
         if (forJavaClass.isConstant()) {
-            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(forJavaClass.asConstant());
+            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(forJavaClass.asJavaConstant());
             if (c != null && !c.isPrimitive()) {
                 HotSpotResolvedObjectType type = HotSpotResolvedObjectType.fromObjectClass(c);
                 return CheckCastNode.create(type, forObject, null, false);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetClassLoader0Node.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetClassLoader0Node.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,7 @@
     public Node canonical(CanonicalizerTool tool) {
         ValueNode javaClass = getJavaClass();
         if (javaClass.isConstant()) {
-            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asConstant());
+            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asJavaConstant());
             if (c != null) {
                 /*
                  * This is an intrinsic for getClassLoader0, which occurs after any security checks.
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetComponentTypeNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetComponentTypeNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
     public Node canonical(CanonicalizerTool tool) {
         ValueNode javaClass = getJavaClass();
         if (javaClass.isConstant()) {
-            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asConstant());
+            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asJavaConstant());
             if (c != null) {
                 Class<?> componentType = c.getComponentType();
                 return ConstantNode.forConstant(HotSpotObjectConstant.forObject(componentType), tool.getMetaAccess());
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetModifiersNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetModifiersNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -54,7 +54,7 @@
     public Node canonical(CanonicalizerTool tool) {
         ValueNode javaClass = getJavaClass();
         if (javaClass.isConstant()) {
-            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asConstant());
+            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asJavaConstant());
             if (c != null) {
                 return ConstantNode.forInt(c.getModifiers());
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetSuperclassNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassGetSuperclassNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
     public Node canonical(CanonicalizerTool tool) {
         ValueNode javaClass = getJavaClass();
         if (javaClass.isConstant()) {
-            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asConstant());
+            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asJavaConstant());
             if (c != null) {
                 Class<?> superclass = c.getSuperclass();
                 return ConstantNode.forConstant(HotSpotObjectConstant.forObject(superclass), tool.getMetaAccess());
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsArrayNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsArrayNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -54,7 +54,7 @@
     public Node canonical(CanonicalizerTool tool) {
         ValueNode javaClass = getJavaClass();
         if (javaClass.isConstant()) {
-            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asConstant());
+            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asJavaConstant());
             if (c != null) {
                 return ConstantNode.forBoolean(c.isArray());
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsInstanceNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsInstanceNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -61,13 +61,13 @@
         ValueNode javaClass = getJavaClass();
         if (javaClass.isConstant()) {
             ValueNode object = getObject();
-            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asConstant());
+            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asJavaConstant());
             if (c != null) {
                 if (c.isPrimitive()) {
                     return ConstantNode.forBoolean(false);
                 }
                 if (object.isConstant()) {
-                    Object o = HotSpotObjectConstant.asObject(object.asConstant());
+                    Object o = HotSpotObjectConstant.asObject(object.asJavaConstant());
                     return ConstantNode.forBoolean(o != null && c.isInstance(o));
                 }
                 HotSpotResolvedObjectType type = HotSpotResolvedObjectType.fromObjectClass(c);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsInterfaceNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsInterfaceNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
     public Node canonical(CanonicalizerTool tool) {
         ValueNode javaClass = getJavaClass();
         if (javaClass.isConstant()) {
-            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asConstant());
+            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asJavaConstant());
             if (c != null) {
                 return ConstantNode.forBoolean(c.isInterface());
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsPrimitiveNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassIsPrimitiveNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -54,7 +54,7 @@
     public Node canonical(CanonicalizerTool tool) {
         ValueNode javaClass = getJavaClass();
         if (javaClass.isConstant()) {
-            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asConstant());
+            Class<?> c = (Class<?>) HotSpotObjectConstant.asObject(javaClass.asJavaConstant());
             if (c != null) {
                 return ConstantNode.forBoolean(c.isPrimitive());
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -73,8 +73,8 @@
         return input.graph().unique(CompressionNode.create(CompressionOp.Uncompress, input, encoding));
     }
 
-    private static Constant compress(Constant c, CompressEncoding encoding) {
-        if (Constant.NULL_OBJECT.equals(c)) {
+    private static JavaConstant compress(JavaConstant c, CompressEncoding encoding) {
+        if (JavaConstant.NULL_OBJECT.equals(c)) {
             return HotSpotCompressedNullConstant.COMPRESSED_NULL;
         } else if (c instanceof HotSpotObjectConstant) {
             return ((HotSpotObjectConstant) c).compress();
@@ -86,9 +86,9 @@
         }
     }
 
-    private static Constant uncompress(Constant c, CompressEncoding encoding) {
+    private static JavaConstant uncompress(JavaConstant c, CompressEncoding encoding) {
         if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) {
-            return Constant.NULL_OBJECT;
+            return JavaConstant.NULL_OBJECT;
         } else if (c instanceof HotSpotObjectConstant) {
             return ((HotSpotObjectConstant) c).uncompress();
         } else if (c instanceof HotSpotMetaspaceConstant) {
@@ -100,7 +100,7 @@
     }
 
     @Override
-    public Constant convert(Constant c) {
+    public JavaConstant convert(JavaConstant c) {
         switch (op) {
             case Compress:
                 return compress(c, encoding);
@@ -112,7 +112,7 @@
     }
 
     @Override
-    public Constant reverse(Constant c) {
+    public JavaConstant reverse(JavaConstant c) {
         switch (op) {
             case Compress:
                 return uncompress(c, encoding);
@@ -162,7 +162,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         if (forValue.isConstant()) {
-            return ConstantNode.forConstant(stamp(), convert(forValue.asConstant()), tool.getMetaAccess());
+            return ConstantNode.forConstant(stamp(), convert(forValue.asJavaConstant()), tool.getMetaAccess());
         } else if (forValue instanceof CompressionNode) {
             CompressionNode other = (CompressionNode) forValue;
             if (op != other.op && encoding.equals(other.encoding)) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
     @Override
     public boolean inferStamp() {
         if (stamp() == defaultStamp && hub.isConstant()) {
-            updateStamp(StampFactory.exactNonNull(HotSpotResolvedObjectType.fromMetaspaceKlass(hub.asConstant())));
+            updateStamp(StampFactory.exactNonNull(HotSpotResolvedObjectType.fromMetaspaceKlass(hub.asJavaConstant())));
             return true;
         }
         return false;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
     @Override
     public boolean inferStamp() {
         if (stamp() == defaultStamp && hub.isConstant()) {
-            updateStamp(StampFactory.exactNonNull(HotSpotResolvedObjectType.fromMetaspaceKlass(hub.asConstant())));
+            updateStamp(StampFactory.exactNonNull(HotSpotResolvedObjectType.fromMetaspaceKlass(hub.asJavaConstant())));
             return true;
         }
         return false;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
     @Override
     public boolean inferStamp() {
         if (stamp() == defaultStamp && hub.isConstant()) {
-            updateStamp(StampFactory.exactNonNull(HotSpotResolvedObjectType.fromMetaspaceKlass(hub.asConstant())));
+            updateStamp(StampFactory.exactNonNull(HotSpotResolvedObjectType.fromMetaspaceKlass(hub.asJavaConstant())));
             return true;
         }
         return false;
@@ -68,7 +68,7 @@
 
     @Override
     protected Value[] operands(NodeLIRBuilderTool gen) {
-        return new Value[]{gen.operand(hub), Constant.forInt(rank), gen.operand(dims)};
+        return new Value[]{gen.operand(hub), JavaConstant.forInt(rank), gen.operand(dims)};
     }
 
     @NodeIntrinsic
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@
     }
 
     @Override
-    public Constant asConstant() {
+    public JavaConstant asConstant() {
         if (alwaysNull()) {
             return HotSpotCompressedNullConstant.COMPRESSED_NULL;
         } else {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@
     }
 
     private static boolean isNullReference(ConstantNode node) {
-        return isObject(node) && node.asConstant().isNull();
+        return isObject(node) && node.asJavaConstant().isNull();
     }
 
     private static boolean isDirectMethodHandle(ConstantNode node) {
@@ -80,7 +80,7 @@
             return false;
         }
 
-        Object o = HotSpotObjectConstant.asObject(node.asConstant());
+        Object o = HotSpotObjectConstant.asObject(node.asJavaConstant());
         if (!(o instanceof String)) {
             return false;
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -58,11 +58,11 @@
         this.oopEncoding = oopEncoding;
     }
 
-    private ValueNode getClassConstantReplacement(StructuredGraph graph, PhaseContext context, Constant constant) {
+    private ValueNode getClassConstantReplacement(StructuredGraph graph, PhaseContext context, JavaConstant constant) {
         if (constant instanceof HotSpotObjectConstant && HotSpotObjectConstant.asObject(constant) instanceof Class<?>) {
             MetaAccessProvider metaAccess = context.getMetaAccess();
             ResolvedJavaType type = metaAccess.lookupJavaType((Class<?>) HotSpotObjectConstant.asObject(constant));
-            Constant klass;
+            JavaConstant klass;
             LocationNode location;
             if (type instanceof HotSpotResolvedObjectType) {
                 location = ConstantLocationNode.create(FINAL_LOCATION, Kind.Object, classMirrorOffset, graph);
@@ -105,7 +105,7 @@
     @Override
     protected void run(StructuredGraph graph, PhaseContext context) {
         for (ConstantNode node : getConstantNodes(graph)) {
-            Constant constant = node.asConstant();
+            JavaConstant constant = node.asJavaConstant();
             ValueNode freadNode = getClassConstantReplacement(graph, context, constant);
             if (freadNode != null) {
                 node.replace(graph, freadNode);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -118,7 +118,7 @@
     }
 
     private boolean shouldUnroll() {
-        return getLength().isConstant() && getLength().asConstant().asInt() <= GraalOptions.MaximumEscapeAnalysisArrayLength.getValue();
+        return getLength().isConstant() && getLength().asJavaConstant().asInt() <= GraalOptions.MaximumEscapeAnalysisArrayLength.getValue();
     }
 
     private ValueNode computeBase(ValueNode base, ValueNode pos) {
@@ -183,7 +183,7 @@
         return uninitialized;
     }
 
-    static boolean isHeapWordAligned(Constant value, Kind kind) {
+    static boolean isHeapWordAligned(JavaConstant value, Kind kind) {
         return (arrayBaseOffset(kind) + (long) value.asInt() * arrayIndexScale(kind)) % heapWordSize() == 0;
     }
 
@@ -193,8 +193,8 @@
             // Can treat as disjoint
             disjoint = true;
         }
-        Constant constantSrc = srcPos.stamp().asConstant();
-        Constant constantDst = destPos.stamp().asConstant();
+        JavaConstant constantSrc = srcPos.stamp().asConstant();
+        JavaConstant constantDst = destPos.stamp().asConstant();
         if (constantSrc != null && constantDst != null) {
             if (!aligned) {
                 aligned = isHeapWordAligned(constantSrc, componentKind) && isHeapWordAligned(constantDst, componentKind);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -106,7 +106,7 @@
             if (shouldUnroll()) {
                 final StructuredGraph copy = snippetGraph;
                 try (Scope s = Debug.scope("ArrayCopySnippetSpecialization", snippetGraph.method())) {
-                    unrollFixedLengthLoop(copy, getLength().asConstant().asInt(), tool);
+                    unrollFixedLengthLoop(copy, getLength().asJavaConstant().asInt(), tool);
                 } catch (Throwable e) {
                     throw Debug.handle(e);
                 }
@@ -116,7 +116,7 @@
     }
 
     private boolean shouldUnroll() {
-        return getLength().isConstant() && getLength().asConstant().asInt() <= GraalOptions.MaximumEscapeAnalysisArrayLength.getValue();
+        return getLength().isConstant() && getLength().asJavaConstant().asInt() <= GraalOptions.MaximumEscapeAnalysisArrayLength.getValue();
     }
 
     /*
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
 
     private ConstantNode getConstantCallTarget(MetaAccessProvider metaAccess, Assumptions assumptions) {
         if (getCallSite().isConstant() && !getCallSite().isNullConstant()) {
-            CallSite callSite = (CallSite) HotSpotObjectConstant.asObject(getCallSite().asConstant());
+            CallSite callSite = (CallSite) HotSpotObjectConstant.asObject(getCallSite().asJavaConstant());
             MethodHandle target = callSite.getTarget();
             if (!(callSite instanceof ConstantCallSite)) {
                 if (assumptions == null || !assumptions.useOptimisticAssumptions()) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CompositeValueClassSubstitutions.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CompositeValueClassSubstitutions.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@
 
         @SuppressWarnings("unchecked")
         @Override
-        protected Constant evaluate(Constant param, MetaAccessProvider metaAccess) {
+        protected JavaConstant evaluate(JavaConstant param, MetaAccessProvider metaAccess) {
             if (param.isNull() || ImmutableCode.getValue()) {
                 return null;
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotNodeClassSubstitutions.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotNodeClassSubstitutions.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
         }
 
         @Override
-        protected Constant evaluate(Constant param, MetaAccessProvider metaAccess) {
+        protected JavaConstant evaluate(JavaConstant param, MetaAccessProvider metaAccess) {
             if (param.isNull() || ImmutableCode.getValue()) {
                 return null;
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MethodHandleNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MethodHandleNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -146,7 +146,7 @@
     protected InvokeNode getInvokeBasicTarget() {
         ValueNode methodHandleNode = getReceiver();
         if (methodHandleNode.isConstant()) {
-            return getTargetInvokeNode(methodHandleAccess().resolveInvokeBasicTarget(methodHandleNode.asConstant(), false));
+            return getTargetInvokeNode(methodHandleAccess().resolveInvokeBasicTarget(methodHandleNode.asJavaConstant(), false));
         }
         return null;
     }
@@ -162,7 +162,7 @@
     protected InvokeNode getLinkToTarget() {
         ValueNode memberNameNode = getMemberName();
         if (memberNameNode.isConstant()) {
-            return getTargetInvokeNode(methodHandleAccess().resolveLinkToTarget(memberNameNode.asConstant()));
+            return getTargetInvokeNode(methodHandleAccess().resolveLinkToTarget(memberNameNode.asJavaConstant()));
         }
         return null;
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectGetClassNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectGetClassNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
         }
         State state = tool.getObjectState(getObject());
         if (state != null) {
-            Constant clazz = state.getVirtualObject().type().getEncoding(Representation.JavaClass);
+            JavaConstant clazz = state.getVirtualObject().type().getEncoding(Representation.JavaClass);
             tool.replaceWithValue(ConstantNode.forConstant(clazz, tool.getMetaAccessProvider(), graph()));
         }
     }
@@ -75,14 +75,14 @@
         } else {
             ResolvedJavaType type = StampTool.typeOrNull(getObject());
             if (StampTool.isExactType(getObject())) {
-                Constant clazz = type.getEncoding(Representation.JavaClass);
+                JavaConstant clazz = type.getEncoding(Representation.JavaClass);
                 return ConstantNode.forConstant(clazz, tool.getMetaAccess());
             }
             if (type != null && tool.assumptions().useOptimisticAssumptions()) {
                 ResolvedJavaType exactType = type.findUniqueConcreteSubtype();
                 if (exactType != null) {
                     tool.assumptions().recordConcreteSubtype(type, exactType);
-                    Constant clazz = exactType.getEncoding(Representation.JavaClass);
+                    JavaConstant clazz = exactType.getEncoding(Representation.JavaClass);
                     return ConstantNode.forConstant(clazz, tool.getMetaAccess());
                 }
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemIdentityHashCodeNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemIdentityHashCodeNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
     }
 
     @Override
-    protected Constant evaluate(Constant param, MetaAccessProvider metaAccess) {
-        return ImmutableCode.getValue() || param.isNull() ? null : Constant.forInt(System.identityHashCode(HotSpotObjectConstant.asObject(param)));
+    protected JavaConstant evaluate(JavaConstant param, MetaAccessProvider metaAccess) {
+        return ImmutableCode.getValue() || param.isNull() ? null : JavaConstant.forInt(System.identityHashCode(HotSpotObjectConstant.asObject(param)));
     }
 }
--- a/graal/com.oracle.graal.java.decompiler/src/com/oracle/graal/java/decompiler/lines/DecompilerSyntaxLine.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.java.decompiler/src/com/oracle/graal/java/decompiler/lines/DecompilerSyntaxLine.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
 
     protected static String getStringRepresentation(Node node) {
         if (node instanceof ConstantNode) {
-            return ((ConstantNode) node).asConstant().toValueString();
+            return ((ConstantNode) node).asJavaConstant().toValueString();
         } else if (node instanceof ParameterNode) {
             return "param_" + ((ParameterNode) node).index();
         } else {
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java	Thu Oct 30 12:21:07 2014 +0100
@@ -197,8 +197,8 @@
             } else {
                 handleUnresolvedLoadConstant(type);
             }
-        } else if (con instanceof Constant) {
-            Constant constant = (Constant) con;
+        } else if (con instanceof JavaConstant) {
+            JavaConstant constant = (JavaConstant) con;
             frameState.push(constant.getKind().getStackKind(), appendConstant(constant));
         } else {
             throw new Error("lookupConstant returned an object of incorrect type");
@@ -499,7 +499,7 @@
         int index = getStream().readLocalIndex();
         int delta = getStream().readIncrement();
         T x = frameState.loadLocal(index);
-        T y = appendConstant(Constant.forInt(delta));
+        T y = appendConstant(JavaConstant.forInt(delta));
         frameState.storeLocal(index, append(genIntegerAdd(Kind.Int, x, y)));
     }
 
@@ -516,13 +516,13 @@
     protected abstract void genIf(T x, Condition cond, T y);
 
     private void genIfZero(Condition cond) {
-        T y = appendConstant(Constant.INT_0);
+        T y = appendConstant(JavaConstant.INT_0);
         T x = frameState.ipop();
         genIf(x, cond, y);
     }
 
     private void genIfNull(Condition cond) {
-        T y = appendConstant(Constant.NULL_OBJECT);
+        T y = appendConstant(JavaConstant.NULL_OBJECT);
         T x = frameState.apop();
         genIf(x, cond, y);
     }
@@ -888,7 +888,7 @@
         }
     }
 
-    protected abstract T appendConstant(Constant constant);
+    protected abstract T appendConstant(JavaConstant constant);
 
     protected abstract T append(T v);
 
@@ -929,23 +929,23 @@
         // @formatter:off
     switch (opcode) {
         case NOP            : /* nothing to do */ break;
-        case ACONST_NULL    : frameState.apush(appendConstant(Constant.NULL_OBJECT)); break;
+        case ACONST_NULL    : frameState.apush(appendConstant(JavaConstant.NULL_OBJECT)); break;
         case ICONST_M1      : // fall through
         case ICONST_0       : // fall through
         case ICONST_1       : // fall through
         case ICONST_2       : // fall through
         case ICONST_3       : // fall through
         case ICONST_4       : // fall through
-        case ICONST_5       : frameState.ipush(appendConstant(Constant.forInt(opcode - ICONST_0))); break;
+        case ICONST_5       : frameState.ipush(appendConstant(JavaConstant.forInt(opcode - ICONST_0))); break;
         case LCONST_0       : // fall through
-        case LCONST_1       : frameState.lpush(appendConstant(Constant.forLong(opcode - LCONST_0))); break;
+        case LCONST_1       : frameState.lpush(appendConstant(JavaConstant.forLong(opcode - LCONST_0))); break;
         case FCONST_0       : // fall through
         case FCONST_1       : // fall through
-        case FCONST_2       : frameState.fpush(appendConstant(Constant.forFloat(opcode - FCONST_0))); break;
+        case FCONST_2       : frameState.fpush(appendConstant(JavaConstant.forFloat(opcode - FCONST_0))); break;
         case DCONST_0       : // fall through
-        case DCONST_1       : frameState.dpush(appendConstant(Constant.forDouble(opcode - DCONST_0))); break;
-        case BIPUSH         : frameState.ipush(appendConstant(Constant.forInt(stream.readByte()))); break;
-        case SIPUSH         : frameState.ipush(appendConstant(Constant.forInt(stream.readShort()))); break;
+        case DCONST_1       : frameState.dpush(appendConstant(JavaConstant.forDouble(opcode - DCONST_0))); break;
+        case BIPUSH         : frameState.ipush(appendConstant(JavaConstant.forInt(stream.readByte()))); break;
+        case SIPUSH         : frameState.ipush(appendConstant(JavaConstant.forInt(stream.readShort()))); break;
         case LDC            : // fall through
         case LDC_W          : // fall through
         case LDC2_W         : genLoadConstant(stream.readCPI(), opcode); break;
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -115,8 +115,8 @@
                         int cpi = stream.readCPI();
                         Object constant = cp.lookupConstant(cpi);
                         String desc = null;
-                        if (constant instanceof Constant) {
-                            Constant c = ((Constant) constant);
+                        if (constant instanceof JavaConstant) {
+                            JavaConstant c = ((JavaConstant) constant);
                             desc = c.toValueString();
                         } else {
                             desc = constant.toString();
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -337,7 +337,7 @@
             protected void handleUnresolvedCheckCast(JavaType type, ValueNode object) {
                 assert !graphBuilderConfig.eagerResolving();
                 append(FixedGuardNode.create(currentGraph.unique(IsNullNode.create(object)), Unresolved, InvalidateRecompile));
-                frameState.apush(appendConstant(Constant.NULL_OBJECT));
+                frameState.apush(appendConstant(JavaConstant.NULL_OBJECT));
             }
 
             /**
@@ -351,7 +351,7 @@
                 DeoptimizeNode deopt = currentGraph.add(DeoptimizeNode.create(InvalidateRecompile, Unresolved));
                 append(IfNode.create(currentGraph.unique(IsNullNode.create(object)), successor, deopt, 1));
                 lastInstr = successor;
-                frameState.ipush(appendConstant(Constant.INT_0));
+                frameState.ipush(appendConstant(JavaConstant.INT_0));
             }
 
             /**
@@ -736,7 +736,7 @@
             @Override
             protected void genInvokeDynamic(JavaMethod target) {
                 if (target instanceof ResolvedJavaMethod) {
-                    Constant appendix = constantPool.lookupAppendix(stream.readCPI4(), Bytecodes.INVOKEDYNAMIC);
+                    JavaConstant appendix = constantPool.lookupAppendix(stream.readCPI4(), Bytecodes.INVOKEDYNAMIC);
                     if (appendix != null) {
                         frameState.apush(ConstantNode.forConstant(appendix, metaAccess, currentGraph));
                     }
@@ -758,7 +758,7 @@
                      * +and+invokedynamic
                      */
                     boolean hasReceiver = !((ResolvedJavaMethod) target).isStatic();
-                    Constant appendix = constantPool.lookupAppendix(stream.readCPI(), Bytecodes.INVOKEVIRTUAL);
+                    JavaConstant appendix = constantPool.lookupAppendix(stream.readCPI(), Bytecodes.INVOKEVIRTUAL);
                     if (appendix != null) {
                         frameState.apush(ConstantNode.forConstant(appendix, metaAccess, currentGraph));
                     }
@@ -911,7 +911,7 @@
             }
 
             private ConstantNode getJsrConstant(long bci) {
-                Constant nextBciConstant = new RawConstant(bci);
+                JavaConstant nextBciConstant = new RawConstant(bci);
                 Stamp nextBciStamp = StampFactory.forConstant(nextBciConstant);
                 ConstantNode nextBciNode = ConstantNode.create(nextBciConstant, nextBciStamp);
                 return currentGraph.unique(nextBciNode);
@@ -927,7 +927,7 @@
             }
 
             @Override
-            protected ConstantNode appendConstant(Constant constant) {
+            protected ConstantNode appendConstant(JavaConstant constant) {
                 assert constant != null;
                 return ConstantNode.forConstant(constant, metaAccess, currentGraph);
             }
--- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@
             for (int i = 0; i < args.length; i++) {
                 ParameterNode param = graph.getParameter(i);
                 if (param != null) {
-                    Constant c = getSnippetReflection().forBoxed(parameterTypes[i].getKind(), args[i]);
+                    JavaConstant c = getSnippetReflection().forBoxed(parameterTypes[i].getKind(), args[i]);
                     ConstantNode replacement = ConstantNode.forConstant(c, getMetaAccess(), graph);
                     param.replaceAtUsages(replacement);
                 } else {
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Thu Oct 30 12:21:07 2014 +0100
@@ -255,9 +255,9 @@
         @Opcode private final AMD64Arithmetic opcode;
         @Def({REG, HINT}) protected AllocatableValue result;
         @Use({REG, STACK}) protected AllocatableValue x;
-        protected Constant y;
+        protected JavaConstant y;
 
-        public BinaryRegConst(AMD64Arithmetic opcode, AllocatableValue result, AllocatableValue x, Constant y) {
+        public BinaryRegConst(AMD64Arithmetic opcode, AllocatableValue result, AllocatableValue x, JavaConstant y) {
             this.opcode = opcode;
             this.result = result;
             this.x = x;
@@ -320,9 +320,9 @@
         @Opcode private final AMD64Arithmetic opcode;
         @Def({REG}) protected AllocatableValue result;
         @Use({REG, STACK}) protected AllocatableValue x;
-        protected Constant y;
+        protected JavaConstant y;
 
-        public BinaryRegStackConst(AMD64Arithmetic opcode, AllocatableValue result, AllocatableValue x, Constant y) {
+        public BinaryRegStackConst(AMD64Arithmetic opcode, AllocatableValue result, AllocatableValue x, JavaConstant y) {
             this.opcode = opcode;
             this.result = result;
             this.x = x;
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -148,8 +148,8 @@
         @Override
         public void verify() {
             super.verify();
-            assert y instanceof Variable || y instanceof Constant;
-            assert kind != Kind.Long || !(y instanceof Constant) || NumUtil.isInt(((Constant) y).asLong());
+            assert y instanceof Variable || y instanceof JavaConstant;
+            assert kind != Kind.Long || !(y instanceof JavaConstant) || NumUtil.isInt(((JavaConstant) y).asLong());
         }
     }
 
@@ -181,7 +181,7 @@
                     throw GraalInternalError.shouldNotReachHere();
             }
         } else if (isRegister(x) && isConstant(y)) {
-            boolean isZero = ((Constant) y).isDefaultForKind();
+            boolean isZero = ((JavaConstant) y).isDefaultForKind();
             switch (opcode) {
                 case BCMP:
                     if (isZero) {
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java	Thu Oct 30 12:21:07 2014 +0100
@@ -117,7 +117,7 @@
     }
 
     public static class StrategySwitchOp extends AMD64LIRInstruction implements BlockEndOp {
-        @Use({CONST}) protected Constant[] keyConstants;
+        @Use({CONST}) protected JavaConstant[] keyConstants;
         private final LabelRef[] keyTargets;
         private LabelRef defaultTarget;
         @Alive({REG}) protected Value key;
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Thu Oct 30 12:21:07 2014 +0100
@@ -258,9 +258,9 @@
 
     public static class StoreConstantOp extends MemOp {
 
-        protected final Constant input;
+        protected final JavaConstant input;
 
-        public StoreConstantOp(Kind kind, AMD64AddressValue address, Constant input, LIRFrameState state) {
+        public StoreConstantOp(Kind kind, AMD64AddressValue address, JavaConstant input, LIRFrameState state) {
             super(kind, address, state);
             this.input = input;
         }
@@ -519,9 +519,9 @@
             }
         } else if (isConstant(input)) {
             if (isRegister(result)) {
-                const2reg(crb, masm, result, (Constant) input);
+                const2reg(crb, masm, result, (JavaConstant) input);
             } else if (isStackSlot(result)) {
-                const2stack(crb, masm, result, (Constant) input);
+                const2stack(crb, masm, result, (JavaConstant) input);
             } else {
                 throw GraalInternalError.shouldNotReachHere();
             }
@@ -621,7 +621,7 @@
         }
     }
 
-    private static void const2reg(CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, Constant input) {
+    private static void const2reg(CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, JavaConstant input) {
         /*
          * Note: we use the kind of the input operand (and not the kind of the result operand)
          * because they don't match in all cases. For example, an object constant can be loaded to a
@@ -698,7 +698,7 @@
         }
     }
 
-    private static void const2stack(CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, Constant input) {
+    private static void const2stack(CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, JavaConstant input) {
         assert !crb.codeCache.needsDataPatch(input);
         AMD64Address dest = (AMD64Address) crb.asAddress(result);
         switch (input.getKind().getStackKind()) {
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ZapRegistersOp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ZapRegistersOp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -48,9 +48,9 @@
     /**
      * The garbage values that are written to the registers.
      */
-    @Use({CONST}) protected Constant[] zapValues;
+    @Use({CONST}) protected JavaConstant[] zapValues;
 
-    public AMD64ZapRegistersOp(Register[] zappedRegisters, Constant[] zapValues) {
+    public AMD64ZapRegistersOp(Register[] zappedRegisters, JavaConstant[] zapValues) {
         this.zappedRegisters = zappedRegisters;
         this.zapValues = zapValues;
     }
--- a/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java	Thu Oct 30 12:21:07 2014 +0100
@@ -55,7 +55,7 @@
         /**
          * The array of key constants used for the cases of this switch statement.
          */
-        @Use({CONST}) protected Constant[] keyConstants;
+        @Use({CONST}) protected JavaConstant[] keyConstants;
         /**
          * The branch target labels that correspond to each case.
          */
@@ -156,7 +156,7 @@
         public void emitCode(CompilationResultBuilder crb, HSAILAssembler masm) {
             String reasonString;
             if (isConstant(actionAndReason)) {
-                DeoptimizationReason reason = metaAccessProvider.decodeDeoptReason((Constant) actionAndReason);
+                DeoptimizationReason reason = metaAccessProvider.decodeDeoptReason((JavaConstant) actionAndReason);
                 reasonString = reason.toString();
             } else {
                 reasonString = "Variable Reason";
@@ -180,7 +180,7 @@
             AllocatableValue actionAndReasonReg = HSAIL.actionAndReasonReg.asValue(LIRKind.value(Kind.Int));
             AllocatableValue codeBufferOffsetReg = HSAIL.codeBufferOffsetReg.asValue(LIRKind.value(Kind.Int));
             masm.emitMov(Kind.Int, actionAndReasonReg, actionAndReason);
-            masm.emitMov(Kind.Int, codeBufferOffsetReg, Constant.forInt(codeBufferPos));
+            masm.emitMov(Kind.Int, codeBufferOffsetReg, JavaConstant.forInt(codeBufferPos));
             masm.emitJumpToLabelName(masm.getDeoptLabelName());
 
             // Now record the debuginfo. If HSAIL deoptimization is off,
--- a/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILMove.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILMove.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,8 +77,8 @@
         }
 
         private void checkForNullObjectInput() {
-            if (result.getKind() == Kind.Object && isConstant(input) && input.getKind() == Kind.Long && ((Constant) input).asLong() == 0) {
-                input = Constant.NULL_OBJECT;
+            if (result.getKind() == Kind.Object && isConstant(input) && input.getKind() == Kind.Long && ((JavaConstant) input).asLong() == 0) {
+                input = JavaConstant.NULL_OBJECT;
             }
         }
 
@@ -224,9 +224,9 @@
 
     public static class StoreConstantOp extends MemOp {
 
-        protected final Constant input;
+        protected final JavaConstant input;
 
-        public StoreConstantOp(Kind kind, HSAILAddressValue address, Constant input, LIRFrameState state) {
+        public StoreConstantOp(Kind kind, HSAILAddressValue address, JavaConstant input, LIRFrameState state) {
             super(kind, address, state);
             this.input = input;
         }
--- a/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXArithmetic.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXArithmetic.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,9 +73,9 @@
             Variable dst = (Variable) result;
             Variable src = (Variable) x;
             if (from == Kind.Long && to == Kind.Int) {
-                new And(dst, src, Constant.forLong(0xFFFFFFFF)).emit(masm);
+                new And(dst, src, JavaConstant.forLong(0xFFFFFFFF)).emit(masm);
             } else if ((from == Kind.Int || from == Kind.Long) && to == Kind.Short) {
-                new And(dst, src, Constant.forInt((short) 0xFFFF)).emit(masm);
+                new And(dst, src, JavaConstant.forInt((short) 0xFFFF)).emit(masm);
             } else {
                 new Cvt((Variable) result, (Variable) x, to, from).emit(masm);
             }
--- a/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXCompare.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXCompare.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,7 +80,7 @@
                     new Setp(condition, x, y, p).emit(masm);
                     break;
                 case ACMP:
-                    if (((Constant) y).isNull()) {
+                    if (((JavaConstant) y).isNull()) {
                         new Setp(condition, x, y, p).emit(masm);
                     } else {
                         throw GraalInternalError.shouldNotReachHere("Only null object constants are allowed in comparisons");
--- a/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXControlFlow.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXControlFlow.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -204,7 +204,7 @@
 
     public static class StrategySwitchOp extends PTXPredicatedLIRInstruction implements BlockEndOp {
 
-        @Use({CONST}) protected Constant[] keyConstants;
+        @Use({CONST}) protected JavaConstant[] keyConstants;
         private final LabelRef[] keyTargets;
         private LabelRef defaultTarget;
         @Alive({REG}) protected Value key;
@@ -277,9 +277,9 @@
             if (lowKey != 0) {
                 // subtract the low value from the switch value
                 // new Sub(value, value, lowKey).emit(masm);
-                new Setp(GT, index, Constant.forInt(highKey - lowKey), getPredRegNum()).emit(masm);
+                new Setp(GT, index, JavaConstant.forInt(highKey - lowKey), getPredRegNum()).emit(masm);
             } else {
-                new Setp(GT, index, Constant.forInt(highKey), getPredRegNum()).emit(masm);
+                new Setp(GT, index, JavaConstant.forInt(highKey), getPredRegNum()).emit(masm);
             }
 
             // Jump to default target if index is not within the jump table
--- a/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXMemOp.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXMemOp.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@
                 case Float:
                 case Double:
                 case Object:
-                    new Ld(Global, result, addr.getBase(), Constant.forLong(addr.getDisplacement())).emit(masm);
+                    new Ld(Global, result, addr.getBase(), JavaConstant.forLong(addr.getDisplacement())).emit(masm);
                     break;
                 default:
                     throw GraalInternalError.shouldNotReachHere();
@@ -101,7 +101,7 @@
                 case Float:
                 case Double:
                 case Object:
-                    new St(Global, input, addr.getBase(), Constant.forLong(addr.getDisplacement())).emit(masm);
+                    new St(Global, input, addr.getBase(), JavaConstant.forLong(addr.getDisplacement())).emit(masm);
                     break;
                 default:
                     throw GraalInternalError.shouldNotReachHere("missing: " + address.getKind());
@@ -137,7 +137,7 @@
                 case Float:
                 case Double:
                 case Object:
-                    new LoadParam(Parameter, result, addr.getBase(), Constant.forLong(addr.getDisplacement())).emit(masm);
+                    new LoadParam(Parameter, result, addr.getBase(), JavaConstant.forLong(addr.getDisplacement())).emit(masm);
                     break;
                 default:
                     throw GraalInternalError.shouldNotReachHere();
@@ -170,7 +170,7 @@
                 case Long:
                 case Float:
                 case Double:
-                    new LoadAddr(Parameter, result, addr.getBase(), Constant.forLong(addr.getDisplacement())).emit(masm);
+                    new LoadAddr(Parameter, result, addr.getBase(), JavaConstant.forLong(addr.getDisplacement())).emit(masm);
                     break;
                 default:
                     throw GraalInternalError.shouldNotReachHere();
@@ -206,7 +206,7 @@
                 case Float:
                 case Double:
                 case Object:
-                    new St(Global, input, addr.getBase(), Constant.forLong(addr.getDisplacement())).emit(masm);
+                    new St(Global, input, addr.getBase(), JavaConstant.forLong(addr.getDisplacement())).emit(masm);
                     break;
                 default:
                     throw GraalInternalError.shouldNotReachHere("missing: " + address.getKind());
--- a/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXMove.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXMove.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -181,7 +181,7 @@
             }
         } else if (isConstant(input)) {
             if (isVariable(result)) {
-                const2reg(crb, masm, result, (Constant) input);
+                const2reg(crb, masm, result, (JavaConstant) input);
             } else {
                 throw GraalInternalError.shouldNotReachHere();
             }
@@ -210,7 +210,7 @@
         }
     }
 
-    private static void const2reg(CompilationResultBuilder crb, PTXMacroAssembler masm, Value result, Constant input) {
+    private static void const2reg(CompilationResultBuilder crb, PTXMacroAssembler masm, Value result, JavaConstant input) {
         Variable dest = (Variable) result;
 
         switch (input.getKind().getStackKind()) {
@@ -223,10 +223,10 @@
                 break;
             case Object:
                 if (input.isNull()) {
-                    new Mov(dest, Constant.forLong(0x0L)).emit(masm);
+                    new Mov(dest, JavaConstant.forLong(0x0L)).emit(masm);
                 } else if (crb.target.inlineObjects) {
                     crb.recordInlineDataInCode(input);
-                    new Mov(dest, Constant.forLong(0xDEADDEADDEADDEADL)).emit(masm);
+                    new Mov(dest, JavaConstant.forLong(0xDEADDEADDEADDEADL)).emit(masm);
                 } else {
                     // new Mov(dest, crb.recordDataReferenceInCode(input, 0, false));
                 }
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java	Thu Oct 30 12:21:07 2014 +0100
@@ -114,13 +114,13 @@
         @Def({REG, HINT}) protected AllocatableValue result;
         @Use({REG}) protected Value x;
         @State protected LIRFrameState state;
-        protected Constant y;
+        protected JavaConstant y;
 
-        public BinaryRegConst(SPARCArithmetic opcode, AllocatableValue result, Value x, Constant y) {
+        public BinaryRegConst(SPARCArithmetic opcode, AllocatableValue result, Value x, JavaConstant y) {
             this(opcode, result, x, y, null);
         }
 
-        public BinaryRegConst(SPARCArithmetic opcode, AllocatableValue result, Value x, Constant y, LIRFrameState state) {
+        public BinaryRegConst(SPARCArithmetic opcode, AllocatableValue result, Value x, JavaConstant y, LIRFrameState state) {
             this.opcode = opcode;
             this.result = result;
             this.x = x;
@@ -175,7 +175,7 @@
         }
     }
 
-    private static void emitRegConstant(CompilationResultBuilder crb, SPARCMacroAssembler masm, SPARCArithmetic opcode, Value dst, Value src1, Constant src2, LIRFrameState info,
+    private static void emitRegConstant(CompilationResultBuilder crb, SPARCMacroAssembler masm, SPARCArithmetic opcode, Value dst, Value src1, JavaConstant src2, LIRFrameState info,
                     SPARCDelayedControlTransfer delaySlotLir) {
         assert isSimm13(crb.asIntConst(src2)) : src2;
         int constant = crb.asIntConst(src2);
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -108,7 +108,7 @@
                     new Cmp(asIntReg(x), crb.asIntConst(y)).emit(masm);
                     break;
                 case ACMP:
-                    if (((Constant) y).isNull()) {
+                    if (((JavaConstant) y).isNull()) {
                         new Cmp(asObjectReg(x), 0).emit(masm);
                         break;
                     } else {
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java	Thu Oct 30 12:21:07 2014 +0100
@@ -518,7 +518,7 @@
     }
 
     public static class StrategySwitchOp extends SPARCLIRInstruction implements BlockEndOp {
-        @Use({CONST}) protected Constant[] keyConstants;
+        @Use({CONST}) protected JavaConstant[] keyConstants;
         private final LabelRef[] keyTargets;
         private LabelRef defaultTarget;
         @Alive({REG}) protected Value key;
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Thu Oct 30 12:21:07 2014 +0100
@@ -540,9 +540,9 @@
 
     public static class StoreConstantOp extends MemOp implements SPARCTailDelayedLIRInstruction {
 
-        protected final Constant input;
+        protected final JavaConstant input;
 
-        public StoreConstantOp(Kind kind, SPARCAddressValue address, Constant input, LIRFrameState state) {
+        public StoreConstantOp(Kind kind, SPARCAddressValue address, JavaConstant input, LIRFrameState state) {
             super(kind, address, state);
             this.input = input;
             if (!input.isDefaultForKind()) {
@@ -601,7 +601,7 @@
                 throw GraalInternalError.shouldNotReachHere();
             }
         } else if (isConstant(input)) {
-            Constant constant = asConstant(input);
+            JavaConstant constant = asConstant(input);
             if (isRegister(result)) {
                 const2reg(crb, masm, result, constant, delaySlotLir);
             } else if (isStackSlot(result)) {
@@ -755,7 +755,7 @@
         }
     }
 
-    private static void const2reg(CompilationResultBuilder crb, SPARCMacroAssembler masm, Value result, Constant input, SPARCDelayedControlTransfer delaySlotLir) {
+    private static void const2reg(CompilationResultBuilder crb, SPARCMacroAssembler masm, Value result, JavaConstant input, SPARCDelayedControlTransfer delaySlotLir) {
         try (SPARCScratchRegister sc = SPARCScratchRegister.get()) {
             Register scratch = sc.getRegister();
             boolean hasVIS3 = ((SPARC) masm.target.arch).getFeatures().contains(CPUFeature.VIS3);
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Thu Oct 30 12:21:07 2014 +0100
@@ -362,7 +362,7 @@
     /**
      * Marks the specified location as a reference in the reference map of the debug information.
      * The tracked location can be a {@link RegisterValue} or a {@link StackSlot}. Note that a
-     * {@link Constant} is automatically tracked.
+     * {@link JavaConstant} is automatically tracked.
      *
      * @param location The location to be added to the reference map.
      * @param refMap A reference map, as created by {@link #initReferenceMap(boolean)}.
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -121,7 +121,7 @@
     /**
      * Called by the register allocator to mark the specified location as a reference in the
      * reference map of the debug information. The tracked location can be a {@link RegisterValue}
-     * or a {@link StackSlot}. Note that a {@link Constant} is automatically tracked.
+     * or a {@link StackSlot}. Note that a {@link JavaConstant} is automatically tracked.
      *
      * @param location The location to be added to the reference map.
      * @param frameMap The frame map.
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java	Thu Oct 30 12:21:07 2014 +0100
@@ -123,7 +123,7 @@
         COMPOSITE,
 
         /**
-         * The value can be a {@link Constant}.
+         * The value can be a {@link JavaConstant}.
          */
         CONST,
 
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
 abstract class LIRIntrospection extends FieldIntrospection {
 
     private static final Class<Value> VALUE_CLASS = Value.class;
-    private static final Class<Constant> CONSTANT_CLASS = Constant.class;
+    private static final Class<JavaConstant> CONSTANT_CLASS = JavaConstant.class;
     private static final Class<Variable> VARIABLE_CLASS = Variable.class;
     private static final Class<RegisterValue> REGISTER_VALUE_CLASS = RegisterValue.class;
     private static final Class<StackSlot> STACK_SLOT_CLASS = StackSlot.class;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,10 +32,10 @@
 /**
  * This class encapsulates different strategies on how to generate code for switch instructions.
  * 
- * The {@link #getBestStrategy(double[], Constant[], LabelRef[])} method can be used to get strategy
- * with the smallest average effort (average number of comparisons until a decision is reached). The
- * strategy returned by this method will have its averageEffort set, while a strategy constructed
- * directly will not.
+ * The {@link #getBestStrategy(double[], JavaConstant[], LabelRef[])} method can be used to get
+ * strategy with the smallest average effort (average number of comparisons until a decision is
+ * reached). The strategy returned by this method will have its averageEffort set, while a strategy
+ * constructed directly will not.
  */
 public abstract class SwitchStrategy {
 
@@ -191,11 +191,11 @@
     }
 
     public final double[] keyProbabilities;
-    public final Constant[] keyConstants;
+    public final JavaConstant[] keyConstants;
     private double averageEffort = -1;
     private EffortClosure effortClosure;
 
-    public SwitchStrategy(double[] keyProbabilities, Constant[] keyConstants) {
+    public SwitchStrategy(double[] keyProbabilities, JavaConstant[] keyConstants) {
         assert keyConstants.length == keyProbabilities.length && keyConstants.length >= 2;
         this.keyProbabilities = keyProbabilities;
         this.keyConstants = keyConstants;
@@ -254,7 +254,7 @@
     public static class SequentialStrategy extends SwitchStrategy {
         private final Integer[] indexes;
 
-        public SequentialStrategy(final double[] keyProbabilities, Constant[] keyConstants) {
+        public SequentialStrategy(final double[] keyProbabilities, JavaConstant[] keyConstants) {
             super(keyProbabilities, keyConstants);
 
             int keyCount = keyConstants.length;
@@ -289,7 +289,7 @@
     public static class RangesStrategy extends SwitchStrategy {
         private final Integer[] indexes;
 
-        public RangesStrategy(final double[] keyProbabilities, Constant[] keyConstants) {
+        public RangesStrategy(final double[] keyProbabilities, JavaConstant[] keyConstants) {
             super(keyProbabilities, keyConstants);
 
             int keyCount = keyConstants.length;
@@ -353,7 +353,7 @@
 
         private final double[] probabilitySums;
 
-        public BinaryStrategy(double[] keyProbabilities, Constant[] keyConstants) {
+        public BinaryStrategy(double[] keyProbabilities, JavaConstant[] keyConstants) {
             super(keyProbabilities, keyConstants);
             probabilitySums = new double[keyProbabilities.length + 1];
             double sum = 0;
@@ -457,7 +457,7 @@
 
     public abstract void run(SwitchClosure closure);
 
-    private static SwitchStrategy[] getStrategies(double[] keyProbabilities, Constant[] keyConstants, LabelRef[] keyTargets) {
+    private static SwitchStrategy[] getStrategies(double[] keyProbabilities, JavaConstant[] keyConstants, LabelRef[] keyTargets) {
         SwitchStrategy[] strategies = new SwitchStrategy[]{new SequentialStrategy(keyProbabilities, keyConstants), new RangesStrategy(keyProbabilities, keyConstants),
                         new BinaryStrategy(keyProbabilities, keyConstants)};
         for (SwitchStrategy strategy : strategies) {
@@ -473,7 +473,7 @@
      * Creates all switch strategies for the given switch, evaluates them (based on average effort)
      * and returns the best one.
      */
-    public static SwitchStrategy getBestStrategy(double[] keyProbabilities, Constant[] keyConstants, LabelRef[] keyTargets) {
+    public static SwitchStrategy getBestStrategy(double[] keyProbabilities, JavaConstant[] keyConstants, LabelRef[] keyTargets) {
         SwitchStrategy[] strategies = getStrategies(keyProbabilities, keyConstants, keyTargets);
         double bestEffort = Integer.MAX_VALUE;
         SwitchStrategy bestStrategy = null;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java	Thu Oct 30 12:21:07 2014 +0100
@@ -80,7 +80,7 @@
 
     private List<ExceptionInfo> exceptionInfoList;
 
-    private final IdentityHashMap<Constant, Data> dataCache;
+    private final IdentityHashMap<JavaConstant, Data> dataCache;
 
     public CompilationResultBuilder(CodeCacheProvider codeCache, ForeignCallsProvider foreignCalls, FrameMap frameMap, Assembler asm, FrameContext frameContext, CompilationResult compilationResult) {
         this.target = codeCache.getTarget();
@@ -161,7 +161,7 @@
         compilationResult.recordInfopoint(pos, debugInfo, reason);
     }
 
-    public void recordInlineDataInCode(Constant data) {
+    public void recordInlineDataInCode(JavaConstant data) {
         assert data != null;
         int pos = asm.position();
         Debug.log("Inline data in code: pos = %d, data = %s", pos, data);
@@ -177,7 +177,7 @@
         return asm.getPlaceholder();
     }
 
-    public AbstractAddress recordDataReferenceInCode(Constant constant, int alignment) {
+    public AbstractAddress recordDataReferenceInCode(JavaConstant constant, int alignment) {
         assert constant != null;
         Debug.log("Constant reference in code: pos = %d, data = %s", asm.position(), constant);
         Data data = dataCache.get(constant);
@@ -203,7 +203,7 @@
      */
     public int asIntConst(Value value) {
         assert (value.getKind().isNumericInteger()) && isConstant(value);
-        Constant constant = (Constant) value;
+        JavaConstant constant = (JavaConstant) value;
         assert !codeCache.needsDataPatch(constant) : constant + " should be in a DataPatch";
         long c = constant.asLong();
         if (!NumUtil.isInt(c)) {
@@ -217,7 +217,7 @@
      */
     public float asFloatConst(Value value) {
         assert (value.getKind().getStackKind() == Kind.Float && isConstant(value));
-        Constant constant = (Constant) value;
+        JavaConstant constant = (JavaConstant) value;
         assert !codeCache.needsDataPatch(constant) : constant + " should be in a DataPatch";
         return constant.asFloat();
     }
@@ -227,7 +227,7 @@
      */
     public long asLongConst(Value value) {
         assert (value.getKind().getStackKind() == Kind.Long && isConstant(value));
-        Constant constant = (Constant) value;
+        JavaConstant constant = (JavaConstant) value;
         assert !codeCache.needsDataPatch(constant) : constant + " should be in a DataPatch";
         return constant.asLong();
     }
@@ -237,7 +237,7 @@
      */
     public double asDoubleConst(Value value) {
         assert (value.getKind().getStackKind() == Kind.Double && isConstant(value));
-        Constant constant = (Constant) value;
+        JavaConstant constant = (JavaConstant) value;
         assert !codeCache.needsDataPatch(constant) : constant + " should be in a DataPatch";
         return constant.asDouble();
     }
@@ -251,7 +251,7 @@
 
     public AbstractAddress asFloatConstRef(Value value, int alignment) {
         assert value.getKind() == Kind.Float && isConstant(value);
-        return recordDataReferenceInCode((Constant) value, alignment);
+        return recordDataReferenceInCode((JavaConstant) value, alignment);
     }
 
     /**
@@ -263,7 +263,7 @@
 
     public AbstractAddress asDoubleConstRef(Value value, int alignment) {
         assert value.getKind() == Kind.Double && isConstant(value);
-        return recordDataReferenceInCode((Constant) value, alignment);
+        return recordDataReferenceInCode((JavaConstant) value, alignment);
     }
 
     /**
@@ -271,7 +271,7 @@
      */
     public AbstractAddress asLongConstRef(Value value) {
         assert value.getKind() == Kind.Long && isConstant(value);
-        return recordDataReferenceInCode((Constant) value, 8);
+        return recordDataReferenceInCode((JavaConstant) value, 8);
     }
 
     /**
@@ -279,7 +279,7 @@
      */
     public AbstractAddress asObjectConstRef(Value value) {
         assert value.getKind() == Kind.Object && isConstant(value);
-        return recordDataReferenceInCode((Constant) value, 8);
+        return recordDataReferenceInCode((JavaConstant) value, 8);
     }
 
     public AbstractAddress asByteAddr(Value value) {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java	Thu Oct 30 12:21:07 2014 +0100
@@ -282,7 +282,7 @@
         }
     }
 
-    private void insertLoad(Constant constant, LIRKind kind, AbstractBlock<?> block, List<UseEntry> usages) {
+    private void insertLoad(JavaConstant constant, LIRKind kind, AbstractBlock<?> block, List<UseEntry> usages) {
         assert usages != null && usages.size() > 0 : String.format("No usages %s %s %s", constant, block, usages);
         // create variable
         Variable variable = lirGen.newVariable(kind);
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/DefUseTree.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/DefUseTree.java	Thu Oct 30 12:21:07 2014 +0100
@@ -49,8 +49,8 @@
         return (Variable) ((MoveOp) instruction).getResult();
     }
 
-    public Constant getConstant() {
-        return (Constant) ((MoveOp) instruction).getInput();
+    public JavaConstant getConstant() {
+        return (JavaConstant) ((MoveOp) instruction).getInput();
     }
 
     public LIRInstruction getInstruction() {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java	Thu Oct 30 12:21:07 2014 +0100
@@ -118,7 +118,7 @@
     }
 
     @Override
-    public Value emitLoadConstant(LIRKind kind, Constant constant) {
+    public Value emitLoadConstant(LIRKind kind, JavaConstant constant) {
         if (canInlineConstant(constant)) {
             return constant;
         } else {
@@ -149,10 +149,10 @@
      * @return True if the constant can be used directly, false if the constant needs to be in a
      *         register.
      */
-    protected abstract boolean canInlineConstant(Constant c);
+    protected abstract boolean canInlineConstant(JavaConstant c);
 
     public Value loadNonConst(Value value) {
-        if (isConstant(value) && !canInlineConstant((Constant) value)) {
+        if (isConstant(value) && !canInlineConstant((JavaConstant) value)) {
             return emitMove(value);
         }
         return value;
@@ -292,7 +292,7 @@
         }
     }
 
-    public void emitStrategySwitch(Constant[] keyConstants, double[] keyProbabilities, LabelRef[] keyTargets, LabelRef defaultTarget, Variable value) {
+    public void emitStrategySwitch(JavaConstant[] keyConstants, double[] keyProbabilities, LabelRef[] keyTargets, LabelRef defaultTarget, Variable value) {
         int keyCount = keyConstants.length;
         SwitchStrategy strategy = SwitchStrategy.getBestStrategy(keyProbabilities, keyConstants, keyTargets);
         long valueRange = keyConstants[keyCount - 1].asLong() - keyConstants[0].asLong() + 1;
@@ -334,27 +334,27 @@
     /**
      * Gets a garbage value for a given kind.
      */
-    protected Constant zapValueForKind(PlatformKind kind) {
+    protected JavaConstant zapValueForKind(PlatformKind kind) {
         long dead = 0xDEADDEADDEADDEADL;
         switch ((Kind) kind) {
             case Boolean:
-                return Constant.FALSE;
+                return JavaConstant.FALSE;
             case Byte:
-                return Constant.forByte((byte) dead);
+                return JavaConstant.forByte((byte) dead);
             case Char:
-                return Constant.forChar((char) dead);
+                return JavaConstant.forChar((char) dead);
             case Short:
-                return Constant.forShort((short) dead);
+                return JavaConstant.forShort((short) dead);
             case Int:
-                return Constant.forInt((int) dead);
+                return JavaConstant.forInt((int) dead);
             case Double:
-                return Constant.forDouble(Double.longBitsToDouble(dead));
+                return JavaConstant.forDouble(Double.longBitsToDouble(dead));
             case Float:
-                return Constant.forFloat(Float.intBitsToFloat((int) dead));
+                return JavaConstant.forFloat(Float.intBitsToFloat((int) dead));
             case Long:
-                return Constant.forLong(dead);
+                return JavaConstant.forLong(dead);
             case Object:
-                return Constant.NULL_OBJECT;
+                return JavaConstant.NULL_OBJECT;
             default:
                 throw new IllegalArgumentException(kind.toString());
         }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java	Thu Oct 30 12:21:07 2014 +0100
@@ -52,7 +52,7 @@
 
     void doBlockEnd(AbstractBlock<?> block);
 
-    Value emitLoadConstant(LIRKind kind, Constant constant);
+    Value emitLoadConstant(LIRKind kind, JavaConstant constant);
 
     Value emitLoad(LIRKind kind, Value address, LIRFrameState state);
 
@@ -173,7 +173,7 @@
 
     Variable emitIntegerTestMove(Value leftVal, Value right, Value trueValue, Value falseValue);
 
-    void emitStrategySwitch(Constant[] keyConstants, double[] keyProbabilities, LabelRef[] keyTargets, LabelRef defaultTarget, Variable value);
+    void emitStrategySwitch(JavaConstant[] keyConstants, double[] keyProbabilities, LabelRef[] keyTargets, LabelRef defaultTarget, Variable value);
 
     void emitStrategySwitch(SwitchStrategy strategy, Variable key, LabelRef[] keyTargets, LabelRef defaultTarget);
 
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/BasicInductionVariable.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/BasicInductionVariable.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,16 +103,16 @@
 
     @Override
     public long constantInit() {
-        return init.asConstant().asLong();
+        return init.asJavaConstant().asLong();
     }
 
     @Override
     public long constantStride() {
         if (op instanceof AddNode) {
-            return rawStride.asConstant().asLong();
+            return rawStride.asJavaConstant().asLong();
         }
         if (op instanceof SubNode) {
-            return -rawStride.asConstant().asLong();
+            return -rawStride.asJavaConstant().asLong();
         }
         throw GraalInternalError.shouldNotReachHere();
     }
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@
 
     public long constantMaxTripCount() {
         long off = oneOff ? iv.direction() == Direction.Up ? 1 : -1 : 0;
-        long max = (((ConstantNode) end).asConstant().asLong() + off - iv.constantInit()) / iv.constantStride();
+        long max = (((ConstantNode) end).asJavaConstant().asLong() + off - iv.constantInit()) / iv.constantStride();
         return Math.max(0, max);
     }
 
@@ -158,7 +158,7 @@
             cond = graph.unique(IntegerLessThanNode.create(end, v1));
         }
         overflowGuard = graph.unique(GuardNode.create(cond, BeginNode.prevBegin(loop.entryPoint()), DeoptimizationReason.LoopLimitCheck, DeoptimizationAction.InvalidateRecompile, true,
-                        Constant.NULL_OBJECT)); // TODO gd: use speculation
+                        JavaConstant.NULL_OBJECT)); // TODO gd: use speculation
         loop.loopBegin().setOverflowGuard(overflowGuard);
         return overflowGuard;
     }
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedOffsetInductionVariable.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedOffsetInductionVariable.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@
 
     @Override
     public long constantInit() {
-        return op(base.constantInit(), offset.asConstant().asLong());
+        return op(base.constantInit(), offset.asJavaConstant().asLong());
     }
 
     @Override
@@ -108,7 +108,7 @@
 
     @Override
     public long constantExtremum() {
-        return op(base.constantExtremum(), offset.asConstant().asLong());
+        return op(base.constantExtremum(), offset.asJavaConstant().asLong());
     }
 
     private long op(long b, long o) {
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedScaledInductionVariable.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DerivedScaledInductionVariable.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,12 +93,12 @@
 
     @Override
     public long constantInit() {
-        return base.constantInit() * scale.asConstant().asLong();
+        return base.constantInit() * scale.asJavaConstant().asLong();
     }
 
     @Override
     public long constantStride() {
-        return base.constantStride() * scale.asConstant().asLong();
+        return base.constantStride() * scale.asJavaConstant().asLong();
     }
 
     @Override
@@ -118,7 +118,7 @@
 
     @Override
     public long constantExtremum() {
-        return base.constantExtremum() * scale.asConstant().asLong();
+        return base.constantExtremum() * scale.asJavaConstant().asLong();
     }
 
     @Override
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariables.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariables.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -117,7 +117,7 @@
         if (op instanceof LeftShiftNode) {
             LeftShiftNode shift = (LeftShiftNode) op;
             if (shift.getX() == base && shift.getY().isConstant()) {
-                return ConstantNode.forInt(1 << shift.getY().asConstant().asInt(), base.graph());
+                return ConstantNode.forInt(1 << shift.getY().asJavaConstant().asInt(), base.graph());
             }
         }
         return null;
--- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -268,7 +268,7 @@
     @Test
     public void testAnd() {
         assertEquals(new IntegerStamp(32, Integer.MIN_VALUE, 0x40000000L, 0, 0xc0000000L),
-                        IntegerStamp.OPS.getAnd().foldStamp(StampFactory.forKind(Kind.Int), StampFactory.forConstant(Constant.forInt(0xc0000000))));
+                        IntegerStamp.OPS.getAnd().foldStamp(StampFactory.forKind(Kind.Int), StampFactory.forConstant(JavaConstant.forInt(0xc0000000))));
     }
 
     private static void testSignExtendShort(long lower, long upper) {
--- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/NegateNodeCanonicalizationTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/NegateNodeCanonicalizationTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,8 +47,8 @@
         byte[] a = new byte[]{Byte.MIN_VALUE, Byte.MIN_VALUE + 1, -1, 0, 1, Byte.MAX_VALUE - 1, Byte.MAX_VALUE};
         for (byte i : a) {
             ConstantNode node = ConstantNode.forByte(i, graph);
-            Constant expected = Constant.forInt(-i);
-            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asConstant()));
+            JavaConstant expected = JavaConstant.forInt(-i);
+            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asJavaConstant()));
         }
     }
 
@@ -57,8 +57,8 @@
         char[] a = new char[]{Character.MIN_VALUE, Character.MIN_VALUE + 1, 0, 1, Character.MAX_VALUE - 1, Character.MAX_VALUE};
         for (char i : a) {
             ConstantNode node = ConstantNode.forChar(i, graph);
-            Constant expected = Constant.forInt(-i);
-            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asConstant()));
+            JavaConstant expected = JavaConstant.forInt(-i);
+            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asJavaConstant()));
         }
     }
 
@@ -67,8 +67,8 @@
         short[] a = new short[]{Short.MIN_VALUE, Short.MIN_VALUE + 1, -1, 0, 1, Short.MAX_VALUE - 1, Short.MAX_VALUE};
         for (short i : a) {
             ConstantNode node = ConstantNode.forShort(i, graph);
-            Constant expected = Constant.forInt(-i);
-            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asConstant()));
+            JavaConstant expected = JavaConstant.forInt(-i);
+            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asJavaConstant()));
         }
     }
 
@@ -77,8 +77,8 @@
         int[] a = new int[]{Integer.MIN_VALUE, Integer.MIN_VALUE + 1, -1, 0, 1, Integer.MAX_VALUE - 1, Integer.MAX_VALUE};
         for (int i : a) {
             ConstantNode node = ConstantNode.forInt(i, graph);
-            Constant expected = Constant.forInt(-i);
-            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asConstant()));
+            JavaConstant expected = JavaConstant.forInt(-i);
+            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asJavaConstant()));
         }
     }
 
@@ -87,8 +87,8 @@
         long[] a = new long[]{Long.MIN_VALUE, Long.MIN_VALUE + 1, -1, 0, 1, Long.MAX_VALUE - 1, Long.MAX_VALUE};
         for (long i : a) {
             ConstantNode node = ConstantNode.forLong(i, graph);
-            Constant expected = Constant.forLong(-i);
-            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asConstant()));
+            JavaConstant expected = JavaConstant.forLong(-i);
+            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asJavaConstant()));
         }
     }
 
@@ -97,8 +97,8 @@
         float[] a = new float[]{Float.MIN_VALUE, Float.MIN_VALUE + 1, -1, 0, 1, Float.MAX_VALUE - 1, Float.MAX_VALUE};
         for (float i : a) {
             ConstantNode node = ConstantNode.forFloat(i, graph);
-            Constant expected = Constant.forFloat(-i);
-            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asConstant()));
+            JavaConstant expected = JavaConstant.forFloat(-i);
+            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asJavaConstant()));
         }
     }
 
@@ -107,8 +107,8 @@
         double[] a = new double[]{Double.MIN_VALUE, Double.MIN_VALUE + 1, -1, 0, 1, Double.MAX_VALUE - 1, Double.MAX_VALUE};
         for (double i : a) {
             ConstantNode node = ConstantNode.forDouble(i, graph);
-            Constant expected = Constant.forDouble(-i);
-            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asConstant()));
+            JavaConstant expected = JavaConstant.forDouble(-i);
+            assertEquals(expected, ArithmeticOpTable.forStamp(node.stamp()).getNeg().foldConstant(node.asJavaConstant()));
         }
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,16 +36,16 @@
 import com.oracle.graal.nodes.spi.*;
 
 /**
- * The {@code ConstantNode} represents a {@link Constant constant}.
+ * The {@code ConstantNode} represents a {@link JavaConstant constant}.
  */
 @NodeInfo(shortName = "Const", nameTemplate = "Const({p#rawvalue})")
 public class ConstantNode extends FloatingNode implements LIRLowerable {
 
     private static final DebugMetric ConstantNodes = Debug.metric("ConstantNodes");
 
-    protected final Constant value;
+    protected final JavaConstant value;
 
-    private static ConstantNode createPrimitive(Constant value) {
+    private static ConstantNode createPrimitive(JavaConstant value) {
         assert value.getKind() != Kind.Object;
         return ConstantNode.create(value, StampFactory.forConstant(value));
     }
@@ -55,11 +55,11 @@
      *
      * @param value the constant
      */
-    public static ConstantNode create(Constant value, Stamp stamp) {
+    public static ConstantNode create(JavaConstant value, Stamp stamp) {
         return new ConstantNode(value, stamp);
     }
 
-    protected ConstantNode(Constant value, Stamp stamp) {
+    protected ConstantNode(JavaConstant value, Stamp stamp) {
         super(stamp);
         assert stamp != null;
         this.value = value;
@@ -69,7 +69,7 @@
     /**
      * @return the constant value represented by this node
      */
-    public Constant getValue() {
+    public JavaConstant getValue() {
         return value;
     }
 
@@ -110,7 +110,7 @@
         return true;
     }
 
-    public static ConstantNode forConstant(Constant constant, MetaAccessProvider metaAccess, StructuredGraph graph) {
+    public static ConstantNode forConstant(JavaConstant constant, MetaAccessProvider metaAccess, StructuredGraph graph) {
         if (constant.getKind().getStackKind() == Kind.Int && constant.getKind() != Kind.Int) {
             return forInt(constant.asInt(), graph);
         }
@@ -121,7 +121,7 @@
         }
     }
 
-    public static ConstantNode forConstant(Constant constant, MetaAccessProvider metaAccess) {
+    public static ConstantNode forConstant(JavaConstant constant, MetaAccessProvider metaAccess) {
         if (constant.getKind().getStackKind() == Kind.Int && constant.getKind() != Kind.Int) {
             return forInt(constant.asInt());
         }
@@ -132,18 +132,18 @@
         }
     }
 
-    public static ConstantNode forConstant(Stamp stamp, Constant constant, MetaAccessProvider metaAccess, StructuredGraph graph) {
+    public static ConstantNode forConstant(Stamp stamp, JavaConstant constant, MetaAccessProvider metaAccess, StructuredGraph graph) {
         return graph.unique(ConstantNode.create(constant, stamp.constant(constant, metaAccess)));
     }
 
-    public static ConstantNode forConstant(Stamp stamp, Constant constant, MetaAccessProvider metaAccess) {
+    public static ConstantNode forConstant(Stamp stamp, JavaConstant constant, MetaAccessProvider metaAccess) {
         return ConstantNode.create(constant, stamp.constant(constant, metaAccess));
     }
 
     /**
      * Returns a node for a Java primitive.
      */
-    public static ConstantNode forPrimitive(Constant constant, StructuredGraph graph) {
+    public static ConstantNode forPrimitive(JavaConstant constant, StructuredGraph graph) {
         assert constant.getKind() != Kind.Object;
         return forConstant(constant, null, graph);
     }
@@ -151,7 +151,7 @@
     /**
      * Returns a node for a Java primitive.
      */
-    public static ConstantNode forPrimitive(Constant constant) {
+    public static ConstantNode forPrimitive(JavaConstant constant) {
         assert constant.getKind() != Kind.Object;
         return forConstant(constant, null);
     }
@@ -159,7 +159,7 @@
     /**
      * Returns a node for a primitive of a given type.
      */
-    public static ConstantNode forPrimitive(Stamp stamp, Constant constant, StructuredGraph graph) {
+    public static ConstantNode forPrimitive(Stamp stamp, JavaConstant constant, StructuredGraph graph) {
         if (stamp instanceof IntegerStamp) {
             assert constant.getKind().isNumericInteger() && stamp.getStackKind() == constant.getKind().getStackKind();
             IntegerStamp istamp = (IntegerStamp) stamp;
@@ -173,7 +173,7 @@
     /**
      * Returns a node for a primitive of a given type.
      */
-    public static ConstantNode forPrimitive(Stamp stamp, Constant constant) {
+    public static ConstantNode forPrimitive(Stamp stamp, JavaConstant constant) {
         if (stamp instanceof IntegerStamp) {
             assert constant.getKind().isNumericInteger() && stamp.getStackKind() == constant.getKind().getStackKind();
             IntegerStamp istamp = (IntegerStamp) stamp;
@@ -194,7 +194,7 @@
      * @return a node for a double constant
      */
     public static ConstantNode forDouble(double d, StructuredGraph graph) {
-        return unique(graph, createPrimitive(Constant.forDouble(d)));
+        return unique(graph, createPrimitive(JavaConstant.forDouble(d)));
     }
 
     /**
@@ -204,7 +204,7 @@
      * @return a node for a double constant
      */
     public static ConstantNode forDouble(double d) {
-        return createPrimitive(Constant.forDouble(d));
+        return createPrimitive(JavaConstant.forDouble(d));
     }
 
     /**
@@ -214,7 +214,7 @@
      * @return a node for a float constant
      */
     public static ConstantNode forFloat(float f, StructuredGraph graph) {
-        return unique(graph, createPrimitive(Constant.forFloat(f)));
+        return unique(graph, createPrimitive(JavaConstant.forFloat(f)));
     }
 
     /**
@@ -224,7 +224,7 @@
      * @return a node for a float constant
      */
     public static ConstantNode forFloat(float f) {
-        return createPrimitive(Constant.forFloat(f));
+        return createPrimitive(JavaConstant.forFloat(f));
     }
 
     /**
@@ -234,7 +234,7 @@
      * @return a node for an long constant
      */
     public static ConstantNode forLong(long i, StructuredGraph graph) {
-        return unique(graph, createPrimitive(Constant.forLong(i)));
+        return unique(graph, createPrimitive(JavaConstant.forLong(i)));
     }
 
     /**
@@ -244,7 +244,7 @@
      * @return a node for an long constant
      */
     public static ConstantNode forLong(long i) {
-        return createPrimitive(Constant.forLong(i));
+        return createPrimitive(JavaConstant.forLong(i));
     }
 
     /**
@@ -254,7 +254,7 @@
      * @return a node for an integer constant
      */
     public static ConstantNode forInt(int i, StructuredGraph graph) {
-        return unique(graph, createPrimitive(Constant.forInt(i)));
+        return unique(graph, createPrimitive(JavaConstant.forInt(i)));
     }
 
     /**
@@ -264,7 +264,7 @@
      * @return a node for an integer constant
      */
     public static ConstantNode forInt(int i) {
-        return createPrimitive(Constant.forInt(i));
+        return createPrimitive(JavaConstant.forInt(i));
     }
 
     /**
@@ -274,7 +274,7 @@
      * @return a node representing the boolean
      */
     public static ConstantNode forBoolean(boolean i, StructuredGraph graph) {
-        return unique(graph, createPrimitive(Constant.forInt(i ? 1 : 0)));
+        return unique(graph, createPrimitive(JavaConstant.forInt(i ? 1 : 0)));
     }
 
     /**
@@ -284,7 +284,7 @@
      * @return a node representing the boolean
      */
     public static ConstantNode forBoolean(boolean i) {
-        return createPrimitive(Constant.forInt(i ? 1 : 0));
+        return createPrimitive(JavaConstant.forInt(i ? 1 : 0));
     }
 
     /**
@@ -294,7 +294,7 @@
      * @return a node representing the byte
      */
     public static ConstantNode forByte(byte i, StructuredGraph graph) {
-        return unique(graph, createPrimitive(Constant.forInt(i)));
+        return unique(graph, createPrimitive(JavaConstant.forInt(i)));
     }
 
     /**
@@ -304,7 +304,7 @@
      * @return a node representing the char
      */
     public static ConstantNode forChar(char i, StructuredGraph graph) {
-        return unique(graph, createPrimitive(Constant.forInt(i)));
+        return unique(graph, createPrimitive(JavaConstant.forInt(i)));
     }
 
     /**
@@ -314,14 +314,14 @@
      * @return a node representing the short
      */
     public static ConstantNode forShort(short i, StructuredGraph graph) {
-        return unique(graph, createPrimitive(Constant.forInt(i)));
+        return unique(graph, createPrimitive(JavaConstant.forInt(i)));
     }
 
     private static ConstantNode unique(StructuredGraph graph, ConstantNode node) {
         return graph.unique(node);
     }
 
-    private static ConstantNode forIntegerBits(int bits, Constant constant, StructuredGraph graph) {
+    private static ConstantNode forIntegerBits(int bits, JavaConstant constant, StructuredGraph graph) {
         long value = constant.asLong();
         long bounds = CodeUtil.signExtend(value, bits);
         return unique(graph, ConstantNode.create(constant, StampFactory.forInteger(bits, bounds, bounds)));
@@ -332,10 +332,10 @@
      * (e.g. short).
      */
     public static ConstantNode forIntegerBits(int bits, long value, StructuredGraph graph) {
-        return forIntegerBits(bits, Constant.forPrimitiveInt(bits, value), graph);
+        return forIntegerBits(bits, JavaConstant.forPrimitiveInt(bits, value), graph);
     }
 
-    private static ConstantNode forIntegerBits(int bits, Constant constant) {
+    private static ConstantNode forIntegerBits(int bits, JavaConstant constant) {
         long value = constant.asLong();
         long bounds = CodeUtil.signExtend(value, bits);
         return ConstantNode.create(constant, StampFactory.forInteger(bits, bounds, bounds));
@@ -346,7 +346,7 @@
      * (e.g. short).
      */
     public static ConstantNode forIntegerBits(int bits, long value) {
-        return forIntegerBits(bits, Constant.forPrimitiveInt(bits, value));
+        return forIntegerBits(bits, JavaConstant.forPrimitiveInt(bits, value));
     }
 
     /**
@@ -391,9 +391,9 @@
             case Byte:
             case Short:
             case Int:
-                return createPrimitive(Constant.forInt((int) value));
+                return createPrimitive(JavaConstant.forInt((int) value));
             case Long:
-                return createPrimitive(Constant.forLong(value));
+                return createPrimitive(JavaConstant.forLong(value));
             default:
                 throw GraalInternalError.shouldNotReachHere("unknown kind " + kind);
         }
@@ -450,7 +450,7 @@
             case Long:
                 return ConstantNode.forLong(0L, graph);
             case Object:
-                return ConstantNode.forConstant(Constant.NULL_OBJECT, null, graph);
+                return ConstantNode.forConstant(JavaConstant.NULL_OBJECT, null, graph);
             default:
                 return null;
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,21 +32,21 @@
     protected final DeoptimizationAction action;
     protected final DeoptimizationReason reason;
     protected final int debugId;
-    protected final Constant speculation;
+    protected final JavaConstant speculation;
 
     public static DeoptimizeNode create(DeoptimizationAction action, DeoptimizationReason reason) {
         return new DeoptimizeNode(action, reason);
     }
 
     protected DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason) {
-        this(action, reason, 0, Constant.NULL_OBJECT, null);
+        this(action, reason, 0, JavaConstant.NULL_OBJECT, null);
     }
 
-    public static DeoptimizeNode create(DeoptimizationAction action, DeoptimizationReason reason, int debugId, Constant speculation, FrameState stateBefore) {
+    public static DeoptimizeNode create(DeoptimizationAction action, DeoptimizationReason reason, int debugId, JavaConstant speculation, FrameState stateBefore) {
         return new DeoptimizeNode(action, reason, debugId, speculation, stateBefore);
     }
 
-    protected DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason, int debugId, Constant speculation, FrameState stateBefore) {
+    protected DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason, int debugId, JavaConstant speculation, FrameState stateBefore) {
         super(stateBefore);
         assert action != null;
         assert reason != null;
@@ -85,7 +85,7 @@
         return ConstantNode.forConstant(speculation, metaAccess, graph());
     }
 
-    public Constant getSpeculation() {
+    public JavaConstant getSpeculation() {
         return speculation;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DynamicDeoptimizeNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DynamicDeoptimizeNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -72,8 +72,8 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (actionAndReason.isConstant() && speculation.isConstant()) {
-            Constant constant = actionAndReason.asConstant();
-            Constant speculationConstant = speculation.asConstant();
+            JavaConstant constant = actionAndReason.asJavaConstant();
+            JavaConstant speculationConstant = speculation.asJavaConstant();
             DeoptimizeNode newDeopt = DeoptimizeNode.create(tool.getMetaAccess().decodeDeoptAction(constant), tool.getMetaAccess().decodeDeoptReason(constant),
                             tool.getMetaAccess().decodeDebugId(constant), speculationConstant, stateBefore());
             return newDeopt;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,15 +46,15 @@
 
     @Input(InputType.Condition) protected LogicNode condition;
     protected final DeoptimizationReason reason;
-    protected Constant speculation;
+    protected JavaConstant speculation;
     protected DeoptimizationAction action;
     protected boolean negated;
 
-    public static GuardNode create(LogicNode condition, AnchoringNode anchor, DeoptimizationReason reason, DeoptimizationAction action, boolean negated, Constant speculation) {
+    public static GuardNode create(LogicNode condition, AnchoringNode anchor, DeoptimizationReason reason, DeoptimizationAction action, boolean negated, JavaConstant speculation) {
         return new GuardNode(condition, anchor, reason, action, negated, speculation);
     }
 
-    protected GuardNode(LogicNode condition, AnchoringNode anchor, DeoptimizationReason reason, DeoptimizationAction action, boolean negated, Constant speculation) {
+    protected GuardNode(LogicNode condition, AnchoringNode anchor, DeoptimizationReason reason, DeoptimizationAction action, boolean negated, JavaConstant speculation) {
         super(StampFactory.forVoid(), anchor);
         this.condition = condition;
         this.reason = reason;
@@ -82,11 +82,11 @@
         return action;
     }
 
-    public Constant getSpeculation() {
+    public JavaConstant getSpeculation() {
         return speculation;
     }
 
-    public void setSpeculation(Constant speculation) {
+    public void setSpeculation(JavaConstant speculation) {
         this.speculation = speculation;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -279,7 +279,7 @@
         assert trueSuccessor().usages().isEmpty() && falseSuccessor().usages().isEmpty();
         if (condition() instanceof IntegerLessThanNode) {
             IntegerLessThanNode lessThan = (IntegerLessThanNode) condition();
-            Constant y = lessThan.getY().stamp().asConstant();
+            JavaConstant y = lessThan.getY().stamp().asConstant();
             if (y != null && y.asLong() == 0 && falseSuccessor().next() instanceof IfNode) {
                 IfNode ifNode2 = (IfNode) falseSuccessor().next();
                 if (ifNode2.condition() instanceof IntegerLessThanNode) {
@@ -305,7 +305,7 @@
                          * constants since there isn't a IntegerBelowEqualThanNode but that doesn't
                          * appear to be interesting.
                          */
-                        Constant positive = lessThan2.getX().asConstant();
+                        JavaConstant positive = lessThan2.getX().asJavaConstant();
                         if (positive != null && positive.asLong() > 0 && positive.asLong() < positive.getKind().getMaxValue()) {
                             ConstantNode newLimit = ConstantNode.forIntegerKind(positive.getKind(), positive.asLong() + 1, graph());
                             below = graph().unique(IntegerBelowNode.create(lessThan.getX(), newLimit));
@@ -483,7 +483,7 @@
 
     private static boolean valuesDistinct(ConstantReflectionProvider constantReflection, ValueNode a, ValueNode b) {
         if (a.isConstant() && b.isConstant()) {
-            Boolean equal = constantReflection.constantEquals(a.asConstant(), b.asConstant());
+            Boolean equal = constantReflection.constantEquals(a.asJavaConstant(), b.asJavaConstant());
             if (equal != null) {
                 return !equal.booleanValue();
             }
@@ -696,8 +696,8 @@
         List<AbstractEndNode> mergePredecessors = merge.cfgPredecessors().snapshot();
         assert phi.valueCount() == merge.forwardEndCount();
 
-        Constant[] xs = constantValues(compare.getX(), merge, false);
-        Constant[] ys = constantValues(compare.getY(), merge, false);
+        JavaConstant[] xs = constantValues(compare.getX(), merge, false);
+        JavaConstant[] ys = constantValues(compare.getY(), merge, false);
         if (xs == null || ys == null) {
             return false;
         }
@@ -889,23 +889,23 @@
      * @return null if {@code node} is neither a {@link ConstantNode} nor a {@link PhiNode} whose
      *         input values are all constants
      */
-    public static Constant[] constantValues(ValueNode node, MergeNode merge, boolean allowNull) {
+    public static JavaConstant[] constantValues(ValueNode node, MergeNode merge, boolean allowNull) {
         if (node.isConstant()) {
-            Constant[] result = new Constant[merge.forwardEndCount()];
-            Arrays.fill(result, node.asConstant());
+            JavaConstant[] result = new JavaConstant[merge.forwardEndCount()];
+            Arrays.fill(result, node.asJavaConstant());
             return result;
         }
 
         if (node instanceof PhiNode) {
             PhiNode phi = (PhiNode) node;
             if (phi.merge() == merge && phi instanceof ValuePhiNode && phi.valueCount() == merge.forwardEndCount()) {
-                Constant[] result = new Constant[merge.forwardEndCount()];
+                JavaConstant[] result = new JavaConstant[merge.forwardEndCount()];
                 int i = 0;
                 for (ValueNode n : phi.values()) {
                     if (!allowNull && !n.isConstant()) {
                         return null;
                     }
-                    result[i++] = n.asConstant();
+                    result[i++] = n.asJavaConstant();
                 }
                 return result;
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -251,9 +251,9 @@
             if (input != null && input instanceof AddNode && input.stamp() instanceof IntegerStamp) {
                 AddNode add = (AddNode) input;
                 if (add.getX() == phi && add.getY().isConstant()) {
-                    increment = add.getY().asConstant().asLong();
+                    increment = add.getY().asJavaConstant().asLong();
                 } else if (add.getY() == phi && add.getX().isConstant()) {
-                    increment = add.getX().asConstant().asLong();
+                    increment = add.getX().asJavaConstant().asLong();
                 }
             } else if (input == phi) {
                 increment = 0;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -105,20 +105,22 @@
      * @return {@code true} if this value represents the null constant
      */
     public final boolean isNullConstant() {
-        return this instanceof ConstantNode && ((ConstantNode) this).getValue().isNull();
+        JavaConstant value = asJavaConstant();
+        return value != null && value.isNull();
     }
 
     /**
      * Convert this value to a constant if it is a constant, otherwise return null.
      *
-     * @return the {@link Constant} represented by this value if it is a constant; {@code null}
+     * @return the {@link JavaConstant} represented by this value if it is a constant; {@code null}
      *         otherwise
      */
-    public final Constant asConstant() {
+    public final JavaConstant asJavaConstant() {
         if (this instanceof ConstantNode) {
             return ((ConstantNode) this).getValue();
+        } else {
+            return null;
         }
-        return null;
     }
 
     public ValueNode asNode() {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AddNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AddNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -72,7 +72,7 @@
             }
         }
         if (forY.isConstant()) {
-            Constant c = forY.asConstant();
+            JavaConstant c = forY.asJavaConstant();
             if (op.isNeutral(c)) {
                 return forX;
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -58,7 +58,7 @@
             return AndNode.create(forY, forX);
         }
         if (forY.isConstant()) {
-            Constant c = forY.asConstant();
+            JavaConstant c = forY.asJavaConstant();
             if (getOp(forX, forY).isNeutral(c)) {
                 return forX;
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -58,7 +58,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
         if (forX.isConstant() && forY.isConstant()) {
-            Constant ret = getOp(forX, forY).foldConstant(forX.asConstant(), forY.asConstant());
+            JavaConstant ret = getOp(forX, forY).foldConstant(forX.asJavaConstant(), forY.asJavaConstant());
             return ConstantNode.forPrimitive(stamp(), ret);
         }
         return this;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -62,9 +62,9 @@
      */
     public abstract boolean unorderedIsTrue();
 
-    private ValueNode optimizeConditional(Constant constant, ConditionalNode conditionalNode, ConstantReflectionProvider constantReflection, Condition cond) {
-        Constant trueConstant = conditionalNode.trueValue().asConstant();
-        Constant falseConstant = conditionalNode.falseValue().asConstant();
+    private ValueNode optimizeConditional(JavaConstant constant, ConditionalNode conditionalNode, ConstantReflectionProvider constantReflection, Condition cond) {
+        JavaConstant trueConstant = conditionalNode.trueValue().asJavaConstant();
+        JavaConstant falseConstant = conditionalNode.falseValue().asJavaConstant();
 
         if (falseConstant != null && trueConstant != null && constantReflection != null) {
             boolean trueResult = cond.foldCondition(trueConstant, constant, constantReflection, unorderedIsTrue());
@@ -86,22 +86,22 @@
         return this;
     }
 
-    protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
+    protected ValueNode optimizeNormalizeCmp(JavaConstant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
         throw new GraalInternalError("NormalizeCompareNode connected to %s (%s %s %s)", this, constant, normalizeNode, mirrored);
     }
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
         if (forX.isConstant() && forY.isConstant()) {
-            return LogicConstantNode.forBoolean(condition().foldCondition(forX.asConstant(), forY.asConstant(), tool.getConstantReflection(), unorderedIsTrue()));
+            return LogicConstantNode.forBoolean(condition().foldCondition(forX.asJavaConstant(), forY.asJavaConstant(), tool.getConstantReflection(), unorderedIsTrue()));
         }
         ValueNode result;
         if (forX.isConstant()) {
-            if ((result = canonicalizeSymmetricConstant(tool, forX.asConstant(), forY, true)) != this) {
+            if ((result = canonicalizeSymmetricConstant(tool, forX.asJavaConstant(), forY, true)) != this) {
                 return result;
             }
         } else if (forY.isConstant()) {
-            if ((result = canonicalizeSymmetricConstant(tool, forY.asConstant(), forX, false)) != this) {
+            if ((result = canonicalizeSymmetricConstant(tool, forY.asJavaConstant(), forX, false)) != this) {
                 return result;
             }
         } else if (forX instanceof ConvertNode && forY instanceof ConvertNode) {
@@ -116,7 +116,7 @@
 
     protected abstract CompareNode duplicateModified(ValueNode newX, ValueNode newY);
 
-    protected ValueNode canonicalizeSymmetricConstant(CanonicalizerTool tool, Constant constant, ValueNode nonConstant, boolean mirrored) {
+    protected ValueNode canonicalizeSymmetricConstant(CanonicalizerTool tool, JavaConstant constant, ValueNode nonConstant, boolean mirrored) {
         if (nonConstant instanceof ConditionalNode) {
             return optimizeConditional(constant, (ConditionalNode) nonConstant, tool.getConstantReflection(), mirrored ? condition().mirror() : condition());
         } else if (nonConstant instanceof NormalizeCompareNode) {
@@ -135,9 +135,9 @@
         return this;
     }
 
-    private ConstantNode canonicalConvertConstant(CanonicalizerTool tool, ConvertNode convert, Constant constant) {
+    private ConstantNode canonicalConvertConstant(CanonicalizerTool tool, ConvertNode convert, JavaConstant constant) {
         if (convert.preservesOrder(condition())) {
-            Constant reverseConverted = convert.reverse(constant);
+            JavaConstant reverseConverted = convert.reverse(constant);
             if (convert.convert(reverseConverted).equals(constant)) {
                 return ConstantNode.forConstant(convert.getValue().stamp(), reverseConverted, tool.getMetaAccess());
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -91,10 +91,10 @@
         // this optimizes the case where a value that can only be 0 or 1 is materialized to 0 or 1
         if (trueValue().isConstant() && falseValue().isConstant() && condition instanceof IntegerEqualsNode) {
             IntegerEqualsNode equals = (IntegerEqualsNode) condition;
-            if (equals.getY().isConstant() && equals.getY().asConstant().equals(Constant.INT_0) && equals.getX().stamp() instanceof IntegerStamp) {
+            if (equals.getY().isConstant() && equals.getY().asJavaConstant().equals(JavaConstant.INT_0) && equals.getX().stamp() instanceof IntegerStamp) {
                 IntegerStamp equalsXStamp = (IntegerStamp) equals.getX().stamp();
                 if (equalsXStamp.upMask() == 1) {
-                    if (trueValue().asConstant().equals(Constant.INT_0) && falseValue().asConstant().equals(Constant.INT_1)) {
+                    if (trueValue().asJavaConstant().equals(JavaConstant.INT_0) && falseValue().asJavaConstant().equals(JavaConstant.INT_1)) {
                         return IntegerConvertNode.convertUnsigned(equals.getX(), stamp());
                     }
                 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,9 +35,9 @@
 
     ValueNode getValue();
 
-    Constant convert(Constant c);
+    JavaConstant convert(JavaConstant c);
 
-    Constant reverse(Constant c);
+    JavaConstant reverse(JavaConstant c);
 
     /**
      * Check whether a conversion is lossless.
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -51,7 +51,7 @@
         }
 
         if (forY.isConstant()) {
-            Constant c = forY.asConstant();
+            JavaConstant c = forY.asJavaConstant();
             if (getOp(forX, forY).isNeutral(c)) {
                 return forX;
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,12 +55,12 @@
     }
 
     @Override
-    public Constant convert(Constant c) {
+    public JavaConstant convert(JavaConstant c) {
         return getOp(getValue()).foldConstant(c);
     }
 
     @Override
-    public Constant reverse(Constant c) {
+    public JavaConstant reverse(JavaConstant c) {
         FloatConvertOp reverse = ArithmeticOpTable.forStamp(stamp()).getFloatConvert(op.reverse());
         return reverse.foldConstant(c);
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -77,7 +77,7 @@
                 }
             }
         }
-        if (forX.isConstant() && forX.asConstant().asLong() == 0) {
+        if (forX.isConstant() && forX.asJavaConstant().asLong() == 0) {
             // 0 |<| y is the same as 0 != y
             return LogicNegationNode.create(CompareNode.createCompareNode(Condition.EQ, forX, forY));
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,12 +66,12 @@
     }
 
     @Override
-    public Constant convert(Constant c) {
+    public JavaConstant convert(JavaConstant c) {
         return getOp(getValue()).foldConstant(getInputBits(), getResultBits(), c);
     }
 
     @Override
-    public Constant reverse(Constant c) {
+    public JavaConstant reverse(JavaConstant c) {
         IntegerConvertOp<REV> reverse = getReverseOp.apply(ArithmeticOpTable.forStamp(stamp()));
         return reverse.foldConstant(getResultBits(), getInputBits(), c);
     }
@@ -86,7 +86,7 @@
         if (inputBits == resultBits) {
             return value;
         } else if (value.isConstant()) {
-            return ConstantNode.forPrimitive(stamp(), convert(forValue.asConstant()));
+            return ConstantNode.forPrimitive(stamp(), convert(forValue.asJavaConstant()));
         } else {
             return this;
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -52,13 +52,13 @@
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
         if (forX.isConstant() && forY.isConstant()) {
             @SuppressWarnings("hiding")
-            long y = forY.asConstant().asLong();
+            long y = forY.asJavaConstant().asLong();
             if (y == 0) {
                 return this; // this will trap, can not canonicalize
             }
-            return ConstantNode.forIntegerStamp(stamp(), forX.asConstant().asLong() / y);
+            return ConstantNode.forIntegerStamp(stamp(), forX.asJavaConstant().asLong() / y);
         } else if (forY.isConstant()) {
-            long c = forY.asConstant().asLong();
+            long c = forY.asJavaConstant().asLong();
             if (c == 1) {
                 return forX;
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -61,7 +61,7 @@
     }
 
     @Override
-    protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
+    protected ValueNode optimizeNormalizeCmp(JavaConstant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
         if (constant.getKind() == Kind.Int && constant.asInt() == 0) {
             ValueNode a = mirrored ? normalizeNode.getY() : normalizeNode.getX();
             ValueNode b = mirrored ? normalizeNode.getX() : normalizeNode.getY();
@@ -96,7 +96,7 @@
     }
 
     @Override
-    protected ValueNode canonicalizeSymmetricConstant(CanonicalizerTool tool, Constant constant, ValueNode nonConstant, boolean mirrored) {
+    protected ValueNode canonicalizeSymmetricConstant(CanonicalizerTool tool, JavaConstant constant, ValueNode nonConstant, boolean mirrored) {
         if (constant.asLong() == 0) {
             if (nonConstant instanceof AndNode) {
                 AndNode andNode = (AndNode) nonConstant;
@@ -106,7 +106,7 @@
                     LeftShiftNode shift = (LeftShiftNode) nonConstant;
                     if (shift.getY().isConstant()) {
                         int mask = shift.getShiftAmountMask();
-                        int amount = shift.getY().asConstant().asInt() & mask;
+                        int amount = shift.getY().asJavaConstant().asInt() & mask;
                         if (shift.getX().getKind() == Kind.Int) {
                             return IntegerTestNode.create(shift.getX(), ConstantNode.forInt(-1 >>> amount));
                         } else {
@@ -118,7 +118,7 @@
                     RightShiftNode shift = (RightShiftNode) nonConstant;
                     if (shift.getY().isConstant() && ((IntegerStamp) shift.getX().stamp()).isPositive()) {
                         int mask = shift.getShiftAmountMask();
-                        int amount = shift.getY().asConstant().asInt() & mask;
+                        int amount = shift.getY().asJavaConstant().asInt() & mask;
                         if (shift.getX().getKind() == Kind.Int) {
                             return IntegerTestNode.create(shift.getX(), ConstantNode.forInt(-1 << amount));
                         } else {
@@ -130,7 +130,7 @@
                     UnsignedRightShiftNode shift = (UnsignedRightShiftNode) nonConstant;
                     if (shift.getY().isConstant()) {
                         int mask = shift.getShiftAmountMask();
-                        int amount = shift.getY().asConstant().asInt() & mask;
+                        int amount = shift.getY().asJavaConstant().asInt() & mask;
                         if (shift.getX().getKind() == Kind.Int) {
                             return IntegerTestNode.create(shift.getX(), ConstantNode.forInt(-1 << amount));
                         } else {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -61,7 +61,7 @@
     }
 
     @Override
-    protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
+    protected ValueNode optimizeNormalizeCmp(JavaConstant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
         assert condition() == Condition.LT;
         if (constant.getKind() == Kind.Int && constant.asInt() == 0) {
             ValueNode a = mirrored ? normalizeNode.getY() : normalizeNode.getX();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -49,13 +49,13 @@
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
         if (forX.isConstant() && forY.isConstant()) {
             @SuppressWarnings("hiding")
-            long y = forY.asConstant().asLong();
+            long y = forY.asJavaConstant().asLong();
             if (y == 0) {
                 return this; // this will trap, can not canonicalize
             }
-            return ConstantNode.forIntegerStamp(stamp(), forX.asConstant().asLong() % y);
+            return ConstantNode.forIntegerStamp(stamp(), forX.asJavaConstant().asLong() % y);
         } else if (forY.isConstant()) {
-            long c = forY.asConstant().asLong();
+            long c = forY.asJavaConstant().asLong();
             if (c == 1 || c == -1) {
                 return ConstantNode.forIntegerStamp(stamp(), 0);
             } else if (c > 0 && CodeUtil.isPowerOf2(c) && forX.stamp() instanceof IntegerStamp && ((IntegerStamp) forX.stamp()).isPositive()) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerTestNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerTestNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -52,7 +52,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
         if (forX.isConstant() && forY.isConstant()) {
-            return LogicConstantNode.forBoolean((forX.asConstant().asLong() & forY.asConstant().asLong()) == 0);
+            return LogicConstantNode.forBoolean((forX.asJavaConstant().asLong() & forY.asJavaConstant().asLong()) == 0);
         }
         if (getX().stamp() instanceof IntegerStamp && getY().stamp() instanceof IntegerStamp) {
             IntegerStamp xStamp = (IntegerStamp) forX.stamp();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -63,7 +63,7 @@
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
-        Constant constant = forValue.asConstant();
+        JavaConstant constant = forValue.asJavaConstant();
         if (constant != null) {
             assert constant.getKind() == Kind.Object;
             return LogicConstantNode.forBoolean(constant.isNull());
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -46,21 +46,21 @@
         return updateStamp(StampTool.leftShift(getX().stamp(), getY().stamp()));
     }
 
-    private static Constant evalConst(Constant a, Constant b) {
+    private static JavaConstant evalConst(JavaConstant a, JavaConstant b) {
         if (a.getKind() == Kind.Int) {
-            return Constant.forInt(a.asInt() << b.asInt());
+            return JavaConstant.forInt(a.asInt() << b.asInt());
         } else {
             assert a.getKind() == Kind.Long;
-            return Constant.forLong(a.asLong() << b.asLong());
+            return JavaConstant.forLong(a.asLong() << b.asLong());
         }
     }
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
         if (forX.isConstant() && forY.isConstant()) {
-            return ConstantNode.forPrimitive(evalConst(forX.asConstant(), forY.asConstant()));
+            return ConstantNode.forPrimitive(evalConst(forX.asJavaConstant(), forY.asJavaConstant()));
         } else if (forY.isConstant()) {
-            int amount = forY.asConstant().asInt();
+            int amount = forY.asJavaConstant().asInt();
             int originalAmout = amount;
             int mask = getShiftAmountMask();
             amount &= mask;
@@ -70,7 +70,7 @@
             if (forX instanceof ShiftNode) {
                 ShiftNode other = (ShiftNode) forX;
                 if (other.getY().isConstant()) {
-                    int otherAmount = other.getY().asConstant().asInt() & mask;
+                    int otherAmount = other.getY().asJavaConstant().asInt() & mask;
                     if (other instanceof LeftShiftNode) {
                         int total = amount + otherAmount;
                         if (total != (total & mask)) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/MulNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/MulNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -56,7 +56,7 @@
         }
         if (forY.isConstant()) {
             BinaryOp<Mul> op = getOp(forX, forY);
-            Constant c = forY.asConstant();
+            JavaConstant c = forY.asJavaConstant();
             if (op.isNeutral(c)) {
                 return forX;
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -82,7 +82,7 @@
     private void virtualizeNonVirtualComparison(State state, ValueNode other, VirtualizerTool tool) {
         if (!state.getVirtualObject().hasIdentity() && state.getVirtualObject().entryKind(0) == Kind.Boolean) {
             if (other.isConstant()) {
-                Constant otherUnboxed = tool.getConstantReflectionProvider().unboxPrimitive(other.asConstant());
+                JavaConstant otherUnboxed = tool.getConstantReflectionProvider().unboxPrimitive(other.asJavaConstant());
                 if (otherUnboxed != null && otherUnboxed.getKind() == Kind.Boolean) {
                     int expectedValue = otherUnboxed.asBoolean() ? 1 : 0;
                     IntegerEqualsNode equals = IntegerEqualsNode.create(state.getEntry(0), ConstantNode.forInt(expectedValue, graph()));
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -58,7 +58,7 @@
             return create(forY, forX);
         }
         if (forY.isConstant()) {
-            Constant c = forY.asConstant();
+            JavaConstant c = forY.asJavaConstant();
             if (getOp(forX, forY).isNeutral(c)) {
                 return forX;
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ReinterpretNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ReinterpretNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -56,30 +56,30 @@
         assert to instanceof PrimitiveStamp;
     }
 
-    private Constant evalConst(Constant c) {
+    private JavaConstant evalConst(JavaConstant c) {
         assert c.getKind().getBitCount() == ((PrimitiveStamp) stamp()).getBits();
         switch (c.getKind()) {
             case Int:
                 if (stamp() instanceof FloatStamp) {
-                    return Constant.forFloat(Float.intBitsToFloat(c.asInt()));
+                    return JavaConstant.forFloat(Float.intBitsToFloat(c.asInt()));
                 } else {
                     return c;
                 }
             case Long:
                 if (stamp() instanceof FloatStamp) {
-                    return Constant.forDouble(Double.longBitsToDouble(c.asLong()));
+                    return JavaConstant.forDouble(Double.longBitsToDouble(c.asLong()));
                 } else {
                     return c;
                 }
             case Float:
                 if (stamp() instanceof IntegerStamp) {
-                    return Constant.forInt(Float.floatToRawIntBits(c.asFloat()));
+                    return JavaConstant.forInt(Float.floatToRawIntBits(c.asFloat()));
                 } else {
                     return c;
                 }
             case Double:
                 if (stamp() instanceof IntegerStamp) {
-                    return Constant.forLong(Double.doubleToRawLongBits(c.asDouble()));
+                    return JavaConstant.forLong(Double.doubleToRawLongBits(c.asDouble()));
                 } else {
                     return c;
                 }
@@ -90,7 +90,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         if (forValue.isConstant()) {
-            return ConstantNode.forConstant(evalConst(forValue.asConstant()), null);
+            return ConstantNode.forConstant(evalConst(forValue.asJavaConstant()), null);
         }
         if (stamp().isCompatible(forValue.stamp())) {
             return forValue;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -47,12 +47,12 @@
         return updateStamp(StampTool.rightShift(getX().stamp(), getY().stamp()));
     }
 
-    private static Constant evalConst(Constant a, Constant b) {
+    private static JavaConstant evalConst(JavaConstant a, JavaConstant b) {
         if (a.getKind() == Kind.Int) {
-            return Constant.forInt(a.asInt() >> b.asInt());
+            return JavaConstant.forInt(a.asInt() >> b.asInt());
         } else {
             assert a.getKind() == Kind.Long;
-            return Constant.forLong(a.asLong() >> b.asLong());
+            return JavaConstant.forLong(a.asLong() >> b.asLong());
         }
     }
 
@@ -62,9 +62,9 @@
             return UnsignedRightShiftNode.create(forX, forY);
         }
         if (forX.isConstant() && forY.isConstant()) {
-            return ConstantNode.forPrimitive(evalConst(forX.asConstant(), forY.asConstant()));
+            return ConstantNode.forPrimitive(evalConst(forX.asJavaConstant(), forY.asJavaConstant()));
         } else if (forY.isConstant()) {
-            int amount = forY.asConstant().asInt();
+            int amount = forY.asJavaConstant().asInt();
             int originalAmout = amount;
             int mask = getShiftAmountMask();
             amount &= mask;
@@ -74,7 +74,7 @@
             if (forX instanceof ShiftNode) {
                 ShiftNode other = (ShiftNode) forX;
                 if (other.getY().isConstant()) {
-                    int otherAmount = other.getY().asConstant().asInt() & mask;
+                    int otherAmount = other.getY().asJavaConstant().asInt() & mask;
                     if (other instanceof RightShiftNode) {
                         int total = amount + otherAmount;
                         if (total != (total & mask)) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -54,7 +54,7 @@
 
         BinaryOp<Sub> op = getOp(forX, forY);
         if (GraphUtil.unproxify(forX) == GraphUtil.unproxify(forY)) {
-            Constant zero = op.getZero(forX.stamp());
+            JavaConstant zero = op.getZero(forX.stamp());
             if (zero != null) {
                 return ConstantNode.forPrimitive(stamp(), zero);
             }
@@ -97,7 +97,7 @@
             }
         }
         if (forY.isConstant()) {
-            Constant c = forY.asConstant();
+            JavaConstant c = forY.asJavaConstant();
             if (op.isNeutral(c)) {
                 return forX;
             }
@@ -116,7 +116,7 @@
                 }
             }
         } else if (forX.isConstant()) {
-            Constant c = forX.asConstant();
+            JavaConstant c = forX.asJavaConstant();
             if (ArithmeticOpTable.forStamp(stamp()).getAdd().isNeutral(c)) {
                 /*
                  * Note that for floating point numbers, + and - have different neutral elements. We
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnaryArithmeticNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnaryArithmeticNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -53,7 +53,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         if (forValue.isConstant()) {
-            return ConstantNode.forPrimitive(stamp(), getOp(forValue).foldConstant(forValue.asConstant()));
+            return ConstantNode.forPrimitive(stamp(), getOp(forValue).foldConstant(forValue.asJavaConstant()));
         }
         return this;
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedDivNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedDivNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -43,13 +43,13 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
         if (forX.isConstant() && forY.isConstant()) {
-            long yConst = forY.asConstant().asLong();
+            long yConst = forY.asJavaConstant().asLong();
             if (yConst == 0) {
                 return this; // this will trap, cannot canonicalize
             }
-            return ConstantNode.forIntegerStamp(stamp(), UnsignedMath.divide(forX.asConstant().asLong(), yConst));
+            return ConstantNode.forIntegerStamp(stamp(), UnsignedMath.divide(forX.asJavaConstant().asLong(), yConst));
         } else if (forY.isConstant()) {
-            long c = forY.asConstant().asLong();
+            long c = forY.asJavaConstant().asLong();
             if (c == 1) {
                 return forX;
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRemNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRemNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -43,13 +43,13 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
         if (forX.isConstant() && forY.isConstant()) {
-            long yConst = forY.asConstant().asLong();
+            long yConst = forY.asJavaConstant().asLong();
             if (yConst == 0) {
                 return this; // this will trap, cannot canonicalize
             }
-            return ConstantNode.forIntegerStamp(stamp(), UnsignedMath.remainder(forX.asConstant().asLong(), yConst));
+            return ConstantNode.forIntegerStamp(stamp(), UnsignedMath.remainder(forX.asJavaConstant().asLong(), yConst));
         } else if (forY.isConstant()) {
-            long c = forY.asConstant().asLong();
+            long c = forY.asJavaConstant().asLong();
             if (c == 1) {
                 return ConstantNode.forIntegerStamp(stamp(), 0);
             } else if (CodeUtil.isPowerOf2(c)) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -46,21 +46,21 @@
         return updateStamp(StampTool.unsignedRightShift(getX().stamp(), getY().stamp()));
     }
 
-    private static Constant evalConst(Constant a, Constant b) {
+    private static JavaConstant evalConst(JavaConstant a, JavaConstant b) {
         if (a.getKind() == Kind.Int) {
-            return Constant.forInt(a.asInt() >>> b.asInt());
+            return JavaConstant.forInt(a.asInt() >>> b.asInt());
         } else {
             assert a.getKind() == Kind.Long;
-            return Constant.forLong(a.asLong() >>> b.asLong());
+            return JavaConstant.forLong(a.asLong() >>> b.asLong());
         }
     }
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
         if (forX.isConstant() && forY.isConstant()) {
-            return ConstantNode.forPrimitive(evalConst(forX.asConstant(), forY.asConstant()));
+            return ConstantNode.forPrimitive(evalConst(forX.asJavaConstant(), forY.asJavaConstant()));
         } else if (forY.isConstant()) {
-            int amount = forY.asConstant().asInt();
+            int amount = forY.asJavaConstant().asInt();
             int originalAmout = amount;
             int mask = getShiftAmountMask();
             amount &= mask;
@@ -70,7 +70,7 @@
             if (forX instanceof ShiftNode) {
                 ShiftNode other = (ShiftNode) forX;
                 if (other.getY().isConstant()) {
-                    int otherAmount = other.getY().asConstant().asInt() & mask;
+                    int otherAmount = other.getY().asJavaConstant().asInt() & mask;
                     if (other instanceof UnsignedRightShiftNode) {
                         int total = amount + otherAmount;
                         if (total != (total & mask)) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -59,7 +59,7 @@
             return XorNode.create(forY, forX);
         }
         if (forY.isConstant()) {
-            Constant c = forY.asConstant();
+            JavaConstant c = forY.asJavaConstant();
             if (getOp(forX, forY).isNeutral(c)) {
                 return forX;
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BranchProbabilityNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BranchProbabilityNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@
     @Override
     public void simplify(SimplifierTool tool) {
         if (probability.isConstant()) {
-            double probabilityValue = probability.asConstant().asDouble();
+            double probabilityValue = probability.asJavaConstant().asDouble();
             if (probabilityValue < 0.0) {
                 throw new GraalInternalError("A negative probability of " + probabilityValue + " is not allowed!");
             } else if (probabilityValue > 1.0) {
@@ -89,7 +89,7 @@
                     }
                     if (other.isConstant()) {
                         double probabilityToSet = probabilityValue;
-                        if (other.asConstant().asInt() == 0) {
+                        if (other.asJavaConstant().asInt() == 0) {
                             probabilityToSet = 1.0 - probabilityToSet;
                         }
                         for (IfNode ifNodeUsages : node.usages().filter(IfNode.class)) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -98,7 +98,7 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (index.isConstant()) {
-            return ConstantLocationNode.create(getLocationIdentity(), getValueKind(), index.asConstant().asLong() * indexScaling + displacement);
+            return ConstantLocationNode.create(getLocationIdentity(), getValueKind(), index.asJavaConstant().asLong() * indexScaling + displacement);
         }
         return this;
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IntegerSwitchNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IntegerSwitchNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -101,8 +101,8 @@
      * @return the key at that index
      */
     @Override
-    public Constant keyAt(int i) {
-        return Constant.forInt(keys[i]);
+    public JavaConstant keyAt(int i) {
+        return JavaConstant.forInt(keys[i]);
     }
 
     @Override
@@ -130,7 +130,7 @@
             tool.addToWorkList(defaultSuccessor());
             graph().removeSplitPropagate(this, defaultSuccessor());
         } else if (value() instanceof ConstantNode) {
-            int constant = value().asConstant().asInt();
+            int constant = value().asJavaConstant().asInt();
 
             int survivingEdge = keySuccessorIndex(keyCount());
             for (int i = 0; i < keyCount(); i++) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -100,7 +100,7 @@
     public void virtualize(VirtualizerTool tool) {
         State state = tool.getObjectState(value);
         if (state != null) {
-            Constant constantHub = state.getVirtualObject().type().getEncoding(Representation.ObjectHub);
+            JavaConstant constantHub = state.getVirtualObject().type().getEncoding(Representation.ObjectHub);
             tool.replaceWithValue(ConstantNode.forConstant(constantHub, tool.getMetaAccessProvider(), graph()));
         }
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -81,7 +81,7 @@
             }
         }
         if (hub.isConstant()) {
-            return resolveExactMethod(tool, tool.getConstantReflection().asJavaType(hub.asConstant()));
+            return resolveExactMethod(tool, tool.getConstantReflection().asJavaType(hub.asJavaConstant()));
         }
 
         return this;
@@ -102,7 +102,7 @@
              * This really represent a misuse of LoadMethod since we're loading from a class which
              * isn't known to implement the original method but for now at least fold it away.
              */
-            return ConstantNode.forConstant(Constant.NULL_OBJECT, null);
+            return ConstantNode.forConstant(JavaConstant.NULL_OBJECT, null);
         } else {
             return ConstantNode.forConstant(newMethod.getEncoding(), tool.getMetaAccess());
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -123,9 +123,9 @@
                 if ((location.getLocationIdentity() == LocationIdentity.FINAL_LOCATION || location.getLocationIdentity() == LocationIdentity.ARRAY_LENGTH_LOCATION) &&
                                 location instanceof ConstantLocationNode) {
                     long displacement = ((ConstantLocationNode) location).getDisplacement();
-                    Constant base = object.asConstant();
+                    JavaConstant base = object.asJavaConstant();
                     if (base != null) {
-                        Constant constant;
+                        JavaConstant constant;
                         if (read.stamp() instanceof PrimitiveStamp) {
                             PrimitiveStamp stamp = (PrimitiveStamp) read.stamp();
                             constant = tool.getConstantReflection().readRawConstant(stamp.getStackKind(), base, displacement, stamp.getBits());
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -74,7 +74,7 @@
     protected boolean assertValues() {
         Kind kind = value.getKind();
         for (int i = 0; i < keyCount(); i++) {
-            Constant key = keyAt(i);
+            JavaConstant key = keyAt(i);
             assert key.getKind() == kind;
         }
         return true;
@@ -105,7 +105,7 @@
     /**
      * The key at the specified position, encoded in a Constant.
      */
-    public abstract Constant keyAt(int i);
+    public abstract JavaConstant keyAt(int i);
 
     public boolean structureEquals(SwitchNode switchNode) {
         return Arrays.equals(keySuccessors, switchNode.keySuccessors) && equalKeys(switchNode);
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -68,8 +68,8 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         if (forValue.isConstant()) {
-            Constant constant = forValue.asConstant();
-            Constant unboxed = tool.getConstantReflection().unboxPrimitive(constant);
+            JavaConstant constant = forValue.asJavaConstant();
+            JavaConstant unboxed = tool.getConstantReflection().unboxPrimitive(constant);
             if (unboxed != null && unboxed.getKind() == boxingKind) {
                 return ConstantNode.forConstant(unboxed, tool.getMetaAccess());
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (this.getLocationIdentity() == LocationIdentity.ANY_LOCATION && offset().isConstant()) {
-            long constantOffset = offset().asConstant().asLong();
+            long constantOffset = offset().asJavaConstant().asLong();
 
             // Try to canonicalize to a field access.
             ResolvedJavaType receiverType = StampTool.typeOrNull(object());
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -71,7 +71,7 @@
         if (state != null && state.getState() == EscapeState.Virtual) {
             ValueNode offsetValue = tool.getReplacedValue(offset());
             if (offsetValue.isConstant()) {
-                long off = offsetValue.asConstant().asLong();
+                long off = offsetValue.asJavaConstant().asLong();
                 int entryIndex = state.getVirtualObject().entryIndexForOffset(off);
                 if (entryIndex != -1) {
                     ValueNode entry = state.getEntry(entryIndex);
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,7 @@
         if (state != null && state.getState() == EscapeState.Virtual) {
             ValueNode indexValue = tool.getReplacedValue(offset());
             if (indexValue.isConstant()) {
-                long off = indexValue.asConstant().asLong();
+                long off = indexValue.asJavaConstant().asLong();
                 int entryIndex = state.getVirtualObject().entryIndexForOffset(off);
                 if (entryIndex != -1) {
                     Kind entryKind = state.getVirtualObject().entryKind(entryIndex);
@@ -104,7 +104,7 @@
                                 Kind nextKind = state.getVirtualObject().entryKind(nextIndex);
                                 if (nextKind == Kind.Int) {
                                     tool.setVirtualEntry(state, entryIndex, value(), true);
-                                    tool.setVirtualEntry(state, nextIndex, ConstantNode.forConstant(Constant.forIllegal(), tool.getMetaAccessProvider(), graph()), true);
+                                    tool.setVirtualEntry(state, nextIndex, ConstantNode.forConstant(JavaConstant.forIllegal(), tool.getMetaAccessProvider(), graph()), true);
                                     tool.delete();
                                 }
                             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -99,7 +99,7 @@
         }
         ValueNode array = GraphUtil.unproxify(originalArray);
         if (constantReflection != null && array.isConstant() && !array.isNullConstant()) {
-            Constant constantValue = array.asConstant();
+            JavaConstant constantValue = array.asJavaConstant();
             if (constantValue != null && constantValue.isNonNull()) {
                 Integer constantLength = constantReflection.readArrayLength(constantValue);
                 if (constantLength != null) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastDynamicNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastDynamicNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -99,7 +99,7 @@
             return forObject;
         }
         if (forHub.isConstant()) {
-            ResolvedJavaType t = tool.getConstantReflection().asJavaType(forHub.asConstant());
+            ResolvedJavaType t = tool.getConstantReflection().asJavaType(forHub.asJavaConstant());
             if (t != null) {
                 return CheckCastNode.create(t, forObject, null, forStoreCheck);
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewArrayNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewArrayNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@
     @Override
     public void simplify(SimplifierTool tool) {
         if (isAlive() && elementType.isConstant()) {
-            ResolvedJavaType javaType = tool.getConstantReflection().asJavaType(elementType.asConstant());
+            ResolvedJavaType javaType = tool.getConstantReflection().asJavaType(elementType.asJavaConstant());
             if (javaType != null && !javaType.equals(tool.getMetaAccess().lookupJavaType(void.class))) {
                 ValueNode len = length();
                 NewArrayNode newArray = graph().add(NewArrayNode.create(javaType, len.isAlive() ? len : graph().addOrUniqueWithInputs(len), fillContents()));
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewInstanceNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewInstanceNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (clazz.isConstant()) {
-            ResolvedJavaType type = tool.getConstantReflection().asJavaType(clazz.asConstant());
+            ResolvedJavaType type = tool.getConstantReflection().asJavaType(clazz.asJavaConstant());
             if (type != null && type.isInitialized() && !type.isArray() && !type.isInterface() && !type.isPrimitive()) {
                 return NewInstanceNode.create(type, fillContents());
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfDynamicNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfDynamicNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -63,7 +63,7 @@
 
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forObject, ValueNode forMirror) {
         if (forMirror.isConstant()) {
-            ResolvedJavaType t = tool.getConstantReflection().asJavaType(forMirror.asConstant());
+            ResolvedJavaType t = tool.getConstantReflection().asJavaType(forMirror.asJavaConstant());
             if (t != null) {
                 if (t.isPrimitive()) {
                     return LogicConstantNode.contradiction();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -91,11 +91,11 @@
      * Gets a constant value for this load if possible.
      */
     public ConstantNode asConstant(MetaAccessProvider metaAccess, ValueNode forObject) {
-        Constant constant = null;
+        JavaConstant constant = null;
         if (isStatic()) {
             constant = field().readConstantValue(null);
         } else if (forObject.isConstant() && !forObject.isNullConstant()) {
-            constant = field().readConstantValue(forObject.asConstant());
+            constant = field().readConstantValue(forObject.asJavaConstant());
         }
         if (constant != null) {
             return ConstantNode.forConstant(constant, metaAccess);
@@ -106,9 +106,9 @@
     private PhiNode asPhi(MetaAccessProvider metaAccess, ValueNode forObject) {
         if (!isStatic() && field.isFinal() && forObject instanceof ValuePhiNode && ((ValuePhiNode) forObject).values().filter(isNotA(ConstantNode.class)).isEmpty()) {
             PhiNode phi = (PhiNode) forObject;
-            Constant[] constants = new Constant[phi.valueCount()];
+            JavaConstant[] constants = new JavaConstant[phi.valueCount()];
             for (int i = 0; i < phi.valueCount(); i++) {
-                Constant constantValue = field().readConstantValue(phi.valueAt(i).asConstant());
+                JavaConstant constantValue = field().readConstantValue(phi.valueAt(i).asJavaConstant());
                 if (constantValue == null) {
                     return null;
                 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@
         State arrayState = tool.getObjectState(array());
         if (arrayState != null && arrayState.getState() == EscapeState.Virtual) {
             ValueNode indexValue = tool.getReplacedValue(index());
-            int idx = indexValue.isConstant() ? indexValue.asConstant().asInt() : -1;
+            int idx = indexValue.isConstant() ? indexValue.asJavaConstant().asInt() : -1;
             if (idx >= 0 && idx < arrayState.getVirtualObject().entryCount()) {
                 tool.replaceWith(arrayState.getEntry(idx));
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredCompareAndSwapNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredCompareAndSwapNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@
     public void generate(NodeLIRBuilderTool gen) {
         assert getNewValue().stamp().isCompatible(getExpectedValue().stamp());
         Value address = location().generateAddress(gen, gen.getLIRGeneratorTool(), gen.operand(object()));
-        Value result = gen.getLIRGeneratorTool().emitCompareAndSwap(address, gen.operand(getExpectedValue()), gen.operand(getNewValue()), Constant.INT_1, Constant.INT_0);
+        Value result = gen.getLIRGeneratorTool().emitCompareAndSwap(address, gen.operand(getExpectedValue()), gen.operand(getNewValue()), JavaConstant.INT_1, JavaConstant.INT_0);
         gen.setResult(this, result);
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,8 +74,8 @@
 
     @Override
     public void virtualize(VirtualizerTool tool) {
-        if (length().asConstant() != null) {
-            final int constantLength = length().asConstant().asInt();
+        if (length().asJavaConstant() != null) {
+            final int constantLength = length().asJavaConstant().asInt();
             if (constantLength >= 0 && constantLength < tool.getMaximumEntryCount()) {
                 ValueNode[] state = new ValueNode[constantLength];
                 ConstantNode defaultForKind = constantLength == 0 ? null : defaultElementValue();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@
         State arrayState = tool.getObjectState(array());
         if (arrayState != null && arrayState.getState() == EscapeState.Virtual) {
             ValueNode indexValue = tool.getReplacedValue(index());
-            int idx = indexValue.isConstant() ? indexValue.asConstant().asInt() : -1;
+            int idx = indexValue.isConstant() ? indexValue.asJavaConstant().asInt() : -1;
             if (idx >= 0 && idx < arrayState.getVirtualObject().entryCount()) {
                 ResolvedJavaType componentType = arrayState.getVirtualObject().type().getComponentType();
                 if (componentType.isPrimitive() || StampTool.isObjectAlwaysNull(value) || componentType.getSuperclass() == null ||
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,9 +85,9 @@
     public boolean isSorted() {
         Kind kind = value().getKind();
         if (kind.isNumericInteger()) {
-            Constant lastKey = null;
+            JavaConstant lastKey = null;
             for (int i = 0; i < keyCount(); i++) {
-                Constant key = keyAt(i);
+                JavaConstant key = keyAt(i);
                 if (lastKey != null && key.asLong() <= lastKey.asLong()) {
                     return false;
                 }
@@ -105,7 +105,7 @@
     }
 
     @Override
-    public Constant keyAt(int index) {
+    public JavaConstant keyAt(int index) {
         return keys[index].getEncoding(Representation.ObjectHub);
     }
 
@@ -130,11 +130,11 @@
     @Override
     public void simplify(SimplifierTool tool) {
         if (value() instanceof ConstantNode) {
-            Constant constant = value().asConstant();
+            JavaConstant constant = value().asJavaConstant();
 
             int survivingEdge = keySuccessorIndex(keyCount());
             for (int i = 0; i < keyCount(); i++) {
-                Constant typeHub = keyAt(i);
+                JavaConstant typeHub = keyAt(i);
                 assert constant.getKind() == typeHub.getKind();
                 Boolean equal = tool.getConstantReflection().constantEquals(constant, typeHub);
                 if (equal == null) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/VirtualizerTool.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/VirtualizerTool.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
 
     /**
      * @return the {@link ConstantReflectionProvider} associated with the current compilation, which
-     *         can be used to access {@link Constant}s.
+     *         can be used to access {@link JavaConstant}s.
      */
     ConstantReflectionProvider getConstantReflectionProvider();
 
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -196,7 +196,7 @@
                         if (node instanceof ValueNode) {
                             ValueNode valueNode = (ValueNode) node;
                             boolean improvedStamp = tryInferStamp(valueNode);
-                            Constant constant = valueNode.stamp().asConstant();
+                            JavaConstant constant = valueNode.stamp().asConstant();
                             if (constant != null && !(node instanceof ConstantNode)) {
                                 valueNode.replaceAtUsages(InputType.Value, ConstantNode.forConstant(valueNode.stamp(), constant, context.getMetaAccess(), graph));
                                 GraphUtil.tryKillUnused(valueNode);
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -555,7 +555,7 @@
                 GuardedStamp cstamp = state.valueConstraints.get(equals.getY());
                 if (cstamp != null && equals.getX().isConstant()) {
                     IntegerStamp stamp = (IntegerStamp) cstamp.getStamp();
-                    if (!stamp.contains(equals.getX().asConstant().asLong())) {
+                    if (!stamp.contains(equals.getX().asJavaConstant().asLong())) {
                         // x != n is true if n is outside the range of the stamp
                         existingGuard = cstamp.getGuard();
                         Debug.log("existing guard %s %1s proves !%1s", existingGuard, existingGuard.condition(), guard.condition());
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,11 +75,11 @@
                     CompareNode compare = (CompareNode) fixedGuard.condition();
                     List<AbstractEndNode> mergePredecessors = merge.cfgPredecessors().snapshot();
 
-                    Constant[] xs = IfNode.constantValues(compare.getX(), merge, true);
+                    JavaConstant[] xs = IfNode.constantValues(compare.getX(), merge, true);
                     if (xs == null) {
                         continue;
                     }
-                    Constant[] ys = IfNode.constantValues(compare.getY(), merge, true);
+                    JavaConstant[] ys = IfNode.constantValues(compare.getY(), merge, true);
                     if (ys == null) {
                         continue;
                     }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
 
         private void processGuard(Node node) {
             GuardNode guard = (GuardNode) node;
-            if (guard.negated() && guard.condition() instanceof IsNullNode && (guard.getSpeculation() == null || guard.getSpeculation().equals(Constant.NULL_OBJECT))) {
+            if (guard.negated() && guard.condition() instanceof IsNullNode && (guard.getSpeculation() == null || guard.getSpeculation().equals(JavaConstant.NULL_OBJECT))) {
                 ValueNode obj = ((IsNullNode) guard.condition()).getValue();
                 nullGuarded.put(obj, guard);
             }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -150,7 +150,7 @@
                 handle.safeDelete();
                 return result;
             } else {
-                GuardNode newGuard = graph.unique(GuardNode.create(condition, guardAnchor, deoptReason, action, negated, Constant.NULL_OBJECT));
+                GuardNode newGuard = graph.unique(GuardNode.create(condition, guardAnchor, deoptReason, action, negated, JavaConstant.NULL_OBJECT));
                 if (OptEliminateGuards.getValue()) {
                     activeGuards.markAndGrow(newGuard);
                 }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -100,20 +100,20 @@
             for (AbstractEndNode end : merge.cfgPredecessors().snapshot()) {
                 ValueNode thisReason = reasons != null ? reasons.get(index) : reason;
                 ValueNode thisSpeculation = speculations != null ? speculations.get(index++) : speculation;
-                if (!thisReason.isConstant() || !thisSpeculation.isConstant() || !thisSpeculation.asConstant().equals(Constant.NULL_OBJECT)) {
+                if (!thisReason.isConstant() || !thisSpeculation.isConstant() || !thisSpeculation.asJavaConstant().equals(JavaConstant.NULL_OBJECT)) {
                     continue;
                 }
-                DeoptimizationReason deoptimizationReason = metaAccessProvider.decodeDeoptReason(thisReason.asConstant());
+                DeoptimizationReason deoptimizationReason = metaAccessProvider.decodeDeoptReason(thisReason.asJavaConstant());
                 tryUseTrappingNullCheck(deopt, end.predecessor(), deoptimizationReason, null);
             }
         }
     }
 
-    private static void tryUseTrappingNullCheck(AbstractDeoptimizeNode deopt, Node predecessor, DeoptimizationReason deoptimizationReason, Constant speculation) {
+    private static void tryUseTrappingNullCheck(AbstractDeoptimizeNode deopt, Node predecessor, DeoptimizationReason deoptimizationReason, JavaConstant speculation) {
         if (deoptimizationReason != DeoptimizationReason.NullCheckException && deoptimizationReason != DeoptimizationReason.UnreachedCode) {
             return;
         }
-        if (speculation != null && !speculation.equals(Constant.NULL_OBJECT)) {
+        if (speculation != null && !speculation.equals(JavaConstant.NULL_OBJECT)) {
             return;
         }
         if (predecessor instanceof MergeNode) {
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -211,7 +211,7 @@
             return "the invoke is marked to be not used for inlining";
         }
         ValueNode receiver = callTarget.receiver();
-        if (receiver != null && receiver.isConstant() && receiver.asConstant().isNull()) {
+        if (receiver != null && receiver.isConstant() && receiver.asJavaConstant().isNull()) {
             return "receiver is null";
         }
         return null;
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -355,7 +355,7 @@
             double[] probability = new double[concretes.size()];
             for (int i = 0; i < concretes.size(); ++i) {
                 ResolvedJavaMethod firstMethod = concretes.get(i);
-                Constant firstMethodConstant = firstMethod.getEncoding();
+                JavaConstant firstMethodConstant = firstMethod.getEncoding();
 
                 ConstantNode firstMethodConstantNode = ConstantNode.forConstant(firstMethodConstant, metaAccess, graph);
                 constantMethods[i] = firstMethodConstantNode;
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -198,7 +198,7 @@
             if (param.usages().isNotEmpty()) {
                 ValueNode arg = args.get(param.index());
                 if (arg.isConstant()) {
-                    Constant constant = arg.asConstant();
+                    JavaConstant constant = arg.asJavaConstant();
                     parameterUsages = trackParameterUsages(param, parameterUsages);
                     // collect param usages before replacing the param
                     graph.replaceFloating(param, ConstantNode.forConstant(constant, context.getMetaAccess(), graph));
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
     }
 
     private static boolean isNullConstant(ValueNode node) {
-        return node.isConstant() && node.asConstant().isNull();
+        return node.isConstant() && node.asJavaConstant().isNull();
     }
 
     private boolean checkUsage(ValueNode x, ValueNode y, MetaAccessProvider metaAccess) {
--- a/graal/com.oracle.graal.replacements.hsail/src/com/oracle/graal/replacements/hsail/HSAILMathIntrinsicsNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements.hsail/src/com/oracle/graal/replacements/hsail/HSAILMathIntrinsicsNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -121,7 +121,7 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (getParameter().isConstant()) {
-            double ret = compute(getParameter().asConstant().asDouble(), operation());
+            double ret = compute(getParameter().asJavaConstant().asDouble(), operation());
             return ConstantNode.forDouble(ret);
         }
         return this;
--- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ArraysSubstitutionsTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ArraysSubstitutionsTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -336,7 +336,7 @@
         new InliningPhase(new CanonicalizerPhase(true)).apply(graph, context);
         new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), assumptions));
 
-        Assert.assertTrue(graph.getNodes(ReturnNode.class).first().result().asConstant().asLong() == 0);
+        Assert.assertTrue(graph.getNodes(ReturnNode.class).first().result().asJavaConstant().asLong() == 0);
     }
 
     public static final int[] constantArray3 = new int[]{1, 2, 3};
@@ -353,7 +353,7 @@
         new InliningPhase(new CanonicalizerPhase(true)).apply(graph, context);
         new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), assumptions));
 
-        Assert.assertTrue(graph.getNodes(ReturnNode.class).first().result().asConstant().asLong() == 1);
+        Assert.assertTrue(graph.getNodes(ReturnNode.class).first().result().asJavaConstant().asLong() == 1);
     }
 
     public static boolean testCanonicalEqualSnippet() {
@@ -370,7 +370,7 @@
         new PartialEscapePhase(false, new CanonicalizerPhase(false)).apply(graph, context);
         new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), assumptions));
 
-        Assert.assertTrue(graph.getNodes(ReturnNode.class).first().result().asConstant().asLong() == 1);
+        Assert.assertTrue(graph.getNodes(ReturnNode.class).first().result().asJavaConstant().asLong() == 1);
     }
 
     public static boolean testVirtualEqualSnippet() {
@@ -389,7 +389,7 @@
         new PartialEscapePhase(false, new CanonicalizerPhase(false)).apply(graph, context);
         new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), assumptions));
 
-        Assert.assertTrue(graph.getNodes(ReturnNode.class).first().result().asConstant().asLong() == 0);
+        Assert.assertTrue(graph.getNodes(ReturnNode.class).first().result().asJavaConstant().asLong() == 0);
     }
 
     public static boolean testVirtualNotEqualSnippet(int x) {
--- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/BitOpNodesTest.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/BitOpNodesTest.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
     @Test
     public void testBitCountIntConstant() {
         ValueNode result = parseAndInline("bitCountIntConstantSnippet");
-        Assert.assertEquals(7, result.asConstant().asInt());
+        Assert.assertEquals(7, result.asJavaConstant().asInt());
     }
 
     public static int bitCountLongConstantSnippet() {
@@ -88,7 +88,7 @@
     @Test
     public void testBitCountLongConstant() {
         ValueNode result = parseAndInline("bitCountLongConstantSnippet");
-        Assert.assertEquals(7, result.asConstant().asInt());
+        Assert.assertEquals(7, result.asJavaConstant().asInt());
     }
 
     public static int bitCountLongSnippet(long v) {
@@ -122,7 +122,7 @@
     @Test
     public void testScanForwardIntConstant() {
         ValueNode result = parseAndInline("scanForwardIntConstantSnippet");
-        Assert.assertEquals(40, result.asConstant().asInt());
+        Assert.assertEquals(40, result.asJavaConstant().asInt());
     }
 
     public static int scanForwardIntSnippet(int v) {
@@ -142,7 +142,7 @@
     @Test
     public void testScanForwardLongConstant() {
         ValueNode result = parseAndInline("scanForwardLongConstantSnippet");
-        Assert.assertEquals(72, result.asConstant().asInt());
+        Assert.assertEquals(72, result.asJavaConstant().asInt());
     }
 
     public static int scanForwardLongSnippet(long v) {
@@ -178,7 +178,7 @@
     @Test
     public void testScanReverseIntConstant() {
         ValueNode result = parseAndInline("scanReverseIntConstantSnippet");
-        Assert.assertEquals(47, result.asConstant().asInt());
+        Assert.assertEquals(47, result.asJavaConstant().asInt());
     }
 
     public static int scanReverseIntSnippet(int v) {
@@ -201,7 +201,7 @@
     @Test
     public void testScanReverseLongConstant() {
         ValueNode result = parseAndInline("scanReverseLongConstantSnippet");
-        Assert.assertEquals(111, result.asConstant().asInt());
+        Assert.assertEquals(111, result.asJavaConstant().asInt());
     }
 
     public static int scanReverseLongSnippet(long v) {
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -176,8 +176,8 @@
     public static FloatingNode canonicalizeBoxing(BoxNode box, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection) {
         ValueNode value = box.getValue();
         if (value.isConstant()) {
-            Constant sourceConstant = value.asConstant();
-            Constant boxedConstant = constantReflection.boxPrimitive(sourceConstant);
+            JavaConstant sourceConstant = value.asJavaConstant();
+            JavaConstant boxedConstant = constantReflection.boxPrimitive(sourceConstant);
             if (boxedConstant != null && boxedConstant.getKind() == box.getBoxingKind()) {
                 return ConstantNode.forConstant(boxedConstant, metaAccess, box.graph());
             }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java	Thu Oct 30 12:21:07 2014 +0100
@@ -277,7 +277,7 @@
         Kind readKind = load.accessKind();
         ValueNode[] base = null;
         ValueNode object = load.object();
-        if (object.isConstant() && object.asConstant().isDefaultForKind()) {
+        if (object.isConstant() && object.asJavaConstant().isDefaultForKind()) {
             base = new ValueNode[1];
         }
         LocationNode location = createLocation(load, base);
@@ -295,7 +295,7 @@
         StructuredGraph graph = store.graph();
         ValueNode object = store.object();
         ValueNode[] base = null;
-        if (object.isConstant() && object.asConstant().isDefaultForKind()) {
+        if (object.isConstant() && object.asJavaConstant().isDefaultForKind()) {
             base = new ValueNode[1];
         }
         LocationNode location = createLocation(store, base);
@@ -360,7 +360,7 @@
                     }
                     if (value == null) {
                         omittedValues.set(valuePos);
-                    } else if (!(value.isConstant() && value.asConstant().isDefaultForKind())) {
+                    } else if (!(value.isConstant() && value.asJavaConstant().isDefaultForKind())) {
                         // Constant.illegal is always the defaultForKind, so it is skipped
                         Kind valueKind = value.getKind();
                         Kind entryKind = virtual.entryKind(i);
@@ -402,7 +402,7 @@
                         ValueNode value = commit.getValues().get(valuePos);
                         assert value instanceof VirtualObjectNode;
                         ValueNode allocValue = allocations[commit.getVirtualObjects().indexOf(value)];
-                        if (!(allocValue.isConstant() && allocValue.asConstant().isDefaultForKind())) {
+                        if (!(allocValue.isConstant() && allocValue.asJavaConstant().isDefaultForKind())) {
                             assert virtual.entryKind(i) == Kind.Object && allocValue.getKind() == Kind.Object;
                             LocationNode location;
                             BarrierType barrierType;
@@ -611,7 +611,7 @@
     protected LocationNode createLocation(ValueNode offsetNode, LocationIdentity locationIdentity, Kind accessKind, ValueNode[] base) {
         ValueNode offset = offsetNode;
         if (offset.isConstant()) {
-            long offsetValue = offset.asConstant().asLong();
+            long offsetValue = offset.asJavaConstant().asLong();
             return ConstantLocationNode.create(locationIdentity, accessKind, offsetValue, offset.graph());
         }
 
@@ -628,7 +628,7 @@
         if (offset instanceof AddNode) {
             AddNode integerAddNode = (AddNode) offset;
             if (integerAddNode.getY() instanceof ConstantNode) {
-                displacement = integerAddNode.getY().asConstant().asLong();
+                displacement = integerAddNode.getY().asJavaConstant().asLong();
                 offset = integerAddNode.getX();
             }
         }
@@ -648,7 +648,7 @@
             if (offset instanceof AddNode) {
                 integerAddNode = (AddNode) offset;
                 if (integerAddNode.getY() instanceof ConstantNode) {
-                    displacement = integerAddNode.getY().asConstant().asLong();
+                    displacement = integerAddNode.getY().asJavaConstant().asLong();
                     offset = integerAddNode.getX();
                 }
             }
@@ -656,7 +656,7 @@
         if (offset instanceof LeftShiftNode) {
             LeftShiftNode leftShiftNode = (LeftShiftNode) offset;
             if (leftShiftNode.getY() instanceof ConstantNode) {
-                long shift = leftShiftNode.getY().asConstant().asLong();
+                long shift = leftShiftNode.getY().asJavaConstant().asLong();
                 if (shift >= 1 && shift <= 3) {
                     if (shift == 1) {
                         indexScaling = 2;
@@ -696,8 +696,8 @@
         }
 
         if (arrayLength.isConstant() && n.index().isConstant()) {
-            int l = arrayLength.asConstant().asInt();
-            int i = n.index().asConstant().asInt();
+            int l = arrayLength.asJavaConstant().asInt();
+            int i = n.index().asJavaConstant().asInt();
             if (i >= 0 && i < l) {
                 // unneeded range check
                 return null;
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@
             assert isInitialized();
             if (result.isConstant()) {
                 assert testValue.isConstant();
-                return LogicConstantNode.forBoolean(result.asConstant().equals(testValue.asConstant()), result.graph());
+                return LogicConstantNode.forBoolean(result.asJavaConstant().equals(testValue.asJavaConstant()), result.graph());
             }
             if (condition == null || condition.getY() != testValue) {
                 // Re-use previously generated condition if the trueValue for the test is the same
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,7 +86,7 @@
             ResolvedJavaType[] parameterTypes = resolveJavaTypes(target.toParameterTypes(), declaringClass);
 
             // Prepare the arguments for the reflective factory method call on the node class.
-            Constant[] nodeFactoryArguments = prepareArguments(methodCallTargetNode, parameterTypes, target, false);
+            JavaConstant[] nodeFactoryArguments = prepareArguments(methodCallTargetNode, parameterTypes, target, false);
             if (nodeFactoryArguments == null) {
                 return false;
             }
@@ -105,11 +105,11 @@
             ResolvedJavaType[] parameterTypes = resolveJavaTypes(target.toParameterTypes(), declaringClass);
 
             // Prepare the arguments for the reflective method call
-            Constant[] arguments = prepareArguments(methodCallTargetNode, parameterTypes, target, true);
+            JavaConstant[] arguments = prepareArguments(methodCallTargetNode, parameterTypes, target, true);
             if (arguments == null) {
                 return false;
             }
-            Constant receiver = null;
+            JavaConstant receiver = null;
             if (!methodCallTargetNode.isStatic()) {
                 receiver = arguments[0];
                 arguments = Arrays.copyOfRange(arguments, 1, arguments.length);
@@ -117,7 +117,7 @@
             }
 
             // Call the method
-            Constant constant = target.invoke(receiver, arguments);
+            JavaConstant constant = target.invoke(receiver, arguments);
 
             if (constant != null) {
                 // Replace the invoke with the result of the call
@@ -156,9 +156,9 @@
      * @return the arguments for the reflective invocation or null if an argument of {@code invoke}
      *         that is expected to be constant isn't
      */
-    private Constant[] prepareArguments(MethodCallTargetNode methodCallTargetNode, ResolvedJavaType[] parameterTypes, ResolvedJavaMethod target, boolean folding) {
+    private JavaConstant[] prepareArguments(MethodCallTargetNode methodCallTargetNode, ResolvedJavaType[] parameterTypes, ResolvedJavaMethod target, boolean folding) {
         NodeInputList<ValueNode> arguments = methodCallTargetNode.arguments();
-        Constant[] reflectionCallArguments = new Constant[arguments.size()];
+        JavaConstant[] reflectionCallArguments = new JavaConstant[arguments.size()];
         for (int i = 0; i < reflectionCallArguments.length; ++i) {
             int parameterIndex = i;
             if (!methodCallTargetNode.isStatic()) {
@@ -170,7 +170,7 @@
                     return null;
                 }
                 ConstantNode constantNode = (ConstantNode) argument;
-                Constant constant = constantNode.asConstant();
+                JavaConstant constant = constantNode.asJavaConstant();
                 ResolvedJavaType type = providers.getConstantReflection().asJavaType(constant);
                 if (type != null) {
                     reflectionCallArguments[i] = snippetReflection.forObject(type);
@@ -209,13 +209,13 @@
     }
 
     protected Node createNodeInstance(StructuredGraph graph, ResolvedJavaType nodeClass, ResolvedJavaType[] parameterTypes, Stamp invokeStamp, boolean setStampFromReturnType,
-                    Constant[] nodeFactoryArguments) {
+                    JavaConstant[] nodeFactoryArguments) {
         ResolvedJavaMethod factory = null;
-        Constant[] arguments = null;
+        JavaConstant[] arguments = null;
 
         for (ResolvedJavaMethod m : nodeClass.getDeclaredMethods()) {
             if (m.getName().equals("create") && !m.isSynthetic()) {
-                Constant[] match = match(graph, m, parameterTypes, nodeFactoryArguments);
+                JavaConstant[] match = match(graph, m, parameterTypes, nodeFactoryArguments);
 
                 if (match != null) {
                     if (factory == null) {
@@ -244,7 +244,7 @@
         }
     }
 
-    protected Constant invokeFactory(ResolvedJavaMethod factory, Constant[] arguments) {
+    protected JavaConstant invokeFactory(ResolvedJavaMethod factory, JavaConstant[] arguments) {
         return factory.invoke(null, arguments);
     }
 
@@ -268,15 +268,15 @@
         return false;
     }
 
-    private Constant[] match(StructuredGraph graph, ResolvedJavaMethod m, ResolvedJavaType[] parameterTypes, Constant[] nodeFactoryArguments) {
-        Constant[] arguments = null;
-        Constant[] injected = null;
+    private JavaConstant[] match(StructuredGraph graph, ResolvedJavaMethod m, ResolvedJavaType[] parameterTypes, JavaConstant[] nodeFactoryArguments) {
+        JavaConstant[] arguments = null;
+        JavaConstant[] injected = null;
 
         ResolvedJavaType[] signature = resolveJavaTypes(m.getSignature().toParameterTypes(null), m.getDeclaringClass());
         MetaAccessProvider metaAccess = providers.getMetaAccess();
         for (int i = 0; i < signature.length; i++) {
             if (m.getParameterAnnotation(InjectedNodeParameter.class, i) != null) {
-                injected = injected == null ? new Constant[1] : Arrays.copyOf(injected, injected.length + 1);
+                injected = injected == null ? new JavaConstant[1] : Arrays.copyOf(injected, injected.length + 1);
                 if (signature[i].equals(metaAccess.lookupJavaType(MetaAccessProvider.class))) {
                     injected[injected.length - 1] = snippetReflection.forObject(metaAccess);
                 } else if (signature[i].equals(metaAccess.lookupJavaType(StructuredGraph.class))) {
@@ -333,7 +333,7 @@
         }
 
         if (injected != null) {
-            Constant[] copy = new Constant[injected.length + arguments.length];
+            JavaConstant[] copy = new JavaConstant[injected.length + arguments.length];
             System.arraycopy(injected, 0, copy, 0, injected.length);
             System.arraycopy(arguments, 0, copy, injected.length, arguments.length);
             arguments = copy;
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -575,9 +575,9 @@
             if (args.info.isConstantParameter(i)) {
                 Object arg = args.values[i];
                 Kind kind = signature.getParameterKind(i);
-                Constant constantArg;
-                if (arg instanceof Constant) {
-                    constantArg = (Constant) arg;
+                JavaConstant constantArg;
+                if (arg instanceof JavaConstant) {
+                    constantArg = (JavaConstant) arg;
                 } else {
                     constantArg = snippetReflection.forBoxed(kind, arg);
                 }
@@ -772,7 +772,7 @@
     private static boolean checkConstantArgument(MetaAccessProvider metaAccess, final ResolvedJavaMethod method, Signature signature, int i, String name, Object arg, Kind kind) {
         ResolvedJavaType type = signature.getParameterType(i, method.getDeclaringClass()).resolve(method.getDeclaringClass());
         if (metaAccess.lookupJavaType(WordBase.class).isAssignableFrom(type)) {
-            assert arg instanceof Constant : method + ": word constant parameters must be passed boxed in a Constant value: " + arg;
+            assert arg instanceof JavaConstant : method + ": word constant parameters must be passed boxed in a Constant value: " + arg;
             return true;
         }
         if (kind != Kind.Object) {
@@ -862,7 +862,7 @@
                 } else {
                     Kind kind = ((ParameterNode) parameter).getKind();
                     assert argument != null || kind == Kind.Object : this + " cannot accept null for non-object parameter named " + args.info.getParameterName(i);
-                    Constant constant = forBoxed(argument, kind);
+                    JavaConstant constant = forBoxed(argument, kind);
                     replacements.put((ParameterNode) parameter, ConstantNode.forConstant(constant, metaAccess, replaceeGraph));
                 }
             } else if (parameter instanceof ParameterNode[]) {
@@ -887,7 +887,7 @@
                     if (value instanceof ValueNode) {
                         replacements.put(param, (ValueNode) value);
                     } else {
-                        Constant constant = forBoxed(value, param.getKind());
+                        JavaConstant constant = forBoxed(value, param.getKind());
                         ConstantNode element = ConstantNode.forConstant(constant, metaAccess, replaceeGraph);
                         replacements.put(param, element);
                     }
@@ -900,17 +900,17 @@
     }
 
     /**
-     * Converts a Java boxed value to a {@link Constant} of the right kind. This adjusts for the
+     * Converts a Java boxed value to a {@link JavaConstant} of the right kind. This adjusts for the
      * limitation that a {@link Local}'s kind is a {@linkplain Kind#getStackKind() stack kind} and
      * so cannot be used for re-boxing primitives smaller than an int.
      *
      * @param argument a Java boxed value
      * @param localKind the kind of the {@link Local} to which {@code argument} will be bound
      */
-    protected Constant forBoxed(Object argument, Kind localKind) {
+    protected JavaConstant forBoxed(Object argument, Kind localKind) {
         assert localKind == localKind.getStackKind();
         if (localKind == Kind.Int) {
-            return Constant.forBoxedPrimitive(argument);
+            return JavaConstant.forBoxedPrimitive(argument);
         }
         return snippetReflection.forBoxed(localKind, argument);
     }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/AssertionNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/AssertionNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@
 
     @Override
     public Node canonical(CanonicalizerTool tool) {
-        if (value.isConstant() && value.asConstant().asInt() != 0) {
+        if (value.isConstant() && value.asJavaConstant().asInt() != 0) {
             return null;
         }
         /*
@@ -82,7 +82,7 @@
 
     public void generate(NodeLIRBuilderTool generator) {
         assert compileTimeAssertion;
-        if (value.isConstant() && value.asConstant().asInt() == 0) {
+        if (value.isConstant() && value.asJavaConstant().asInt() == 0) {
             throw new GraalInternalError("%s: failed compile-time assertion: %s", this, message);
         } else {
             throw new GraalInternalError("%s: failed compile-time assertion (value %s): %s", this, value, message);
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicArrayCopyNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicArrayCopyNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -91,9 +91,9 @@
     @Override
     public void virtualize(VirtualizerTool tool) {
         if (getSourcePosition().isConstant() && getDestinationPosition().isConstant() && getLength().isConstant()) {
-            int srcPos = getSourcePosition().asConstant().asInt();
-            int destPos = getDestinationPosition().asConstant().asInt();
-            int length = getLength().asConstant().asInt();
+            int srcPos = getSourcePosition().asJavaConstant().asInt();
+            int destPos = getDestinationPosition().asJavaConstant().asInt();
+            int length = getLength().asJavaConstant().asInt();
             State srcState = tool.getObjectState(getSource());
             State destState = tool.getObjectState(getDestination());
 
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitCountNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitCountNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -54,7 +54,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         if (forValue.isConstant()) {
-            Constant c = forValue.asConstant();
+            JavaConstant c = forValue.asJavaConstant();
             return ConstantNode.forInt(forValue.getKind() == Kind.Int ? bitCount(c.asInt()) : bitCount(c.asLong()));
         }
         return this;
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanForwardNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanForwardNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -69,7 +69,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         if (forValue.isConstant()) {
-            Constant c = forValue.asConstant();
+            JavaConstant c = forValue.asJavaConstant();
             if (c.asLong() != 0) {
                 return ConstantNode.forInt(forValue.getKind() == Kind.Int ? scan(c.asInt()) : scan(c.asLong()));
             }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanReverseNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanReverseNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -67,7 +67,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         if (forValue.isConstant()) {
-            Constant c = forValue.asConstant();
+            JavaConstant c = forValue.asJavaConstant();
             if (c.asLong() != 0) {
                 return ConstantNode.forInt(forValue.getKind() == Kind.Int ? scan(c.asInt()) : scan(c.asLong()));
             }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DeferredPiNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DeferredPiNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (type.isConstant()) {
-            ResolvedJavaType javaType = tool.getConstantReflection().asJavaType(type.asConstant());
+            ResolvedJavaType javaType = tool.getConstantReflection().asJavaType(type.asJavaConstant());
             ObjectStamp objectStamp = (ObjectStamp) stamp();
             return PiNode.create(object, javaType, objectStamp.isExactType(), objectStamp.nonNull());
         }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/LoadSnippetVarargParameterNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/LoadSnippetVarargParameterNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (index.isConstant()) {
-            return parameters.get(index.asConstant().asInt());
+            return parameters.get(index.asJavaConstant().asInt());
         }
         return this;
     }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MathIntrinsicNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MathIntrinsicNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -96,7 +96,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         if (forValue.isConstant()) {
-            double ret = doCompute(forValue.asConstant().asDouble(), operation());
+            double ret = doCompute(forValue.asJavaConstant().asDouble(), operation());
             return ConstantNode.forDouble(ret);
         }
         return this;
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/PureFunctionMacroNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/PureFunctionMacroNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@
      * This method should return either a constant that represents the result of the function, or
      * null if no such result could be determined.
      */
-    protected abstract Constant evaluate(Constant param, MetaAccessProvider metaAccess);
+    protected abstract JavaConstant evaluate(JavaConstant param, MetaAccessProvider metaAccess);
 
     @Override
     public Node canonical(CanonicalizerTool tool) {
@@ -52,7 +52,7 @@
         } else {
             ValueNode param = arguments.get(0);
             if (param.isConstant()) {
-                Constant constant = evaluate(param.asConstant(), tool.getMetaAccess());
+                JavaConstant constant = evaluate(param.asJavaConstant(), tool.getMetaAccess());
                 if (constant != null) {
                     return ConstantNode.forConstant(constant, tool.getMetaAccess());
                 }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReverseBytesNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReverseBytesNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -61,7 +61,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         if (forValue.isConstant()) {
-            Constant c = forValue.asConstant();
+            JavaConstant c = forValue.asJavaConstant();
             return ConstantNode.forIntegerKind(getKind(), getKind() == Kind.Int ? reverse(c.asInt()) : reverse(c.asLong()));
         }
         return this;
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@
 
     private final Providers providers;
     private final CanonicalizerPhase canonicalizer;
-    private Set<Constant> constantReceivers;
+    private Set<JavaConstant> constantReceivers;
     private final TruffleCache truffleCache;
     private final SnippetReflectionProvider snippetReflection;
     private final ResolvedJavaMethod callDirectMethod;
@@ -205,7 +205,7 @@
 
     private void createHistogram() {
         DebugHistogram histogram = Debug.createHistogram("Expanded Truffle Nodes");
-        for (Constant c : constantReceivers) {
+        for (JavaConstant c : constantReceivers) {
             String javaName = providers.getMetaAccess().lookupJavaType(c).toJavaName(false);
 
             // The DSL uses nested classes with redundant names - only show the inner class
@@ -231,7 +231,7 @@
                 try (Indent id1 = Debug.logAndIndent("try inlining %s, kind = %s", methodCallTargetNode.targetMethod(), kind)) {
                     if (kind == InvokeKind.Static || kind == InvokeKind.Special) {
                         if ((TraceTruffleCompilationHistogram.getValue() || TraceTruffleCompilationDetails.getValue()) && kind == InvokeKind.Special && methodCallTargetNode.receiver().isConstant()) {
-                            constantReceivers.add(methodCallTargetNode.receiver().asConstant());
+                            constantReceivers.add(methodCallTargetNode.receiver().asJavaConstant());
                         }
 
                         Replacements replacements = providers.getReplacements();
@@ -296,7 +296,7 @@
             for (ParameterNode param : graphCopy.getNodes(ParameterNode.class).snapshot()) {
                 ValueNode arg = arguments.get(param.index());
                 if (arg.isConstant()) {
-                    Constant constant = arg.asConstant();
+                    JavaConstant constant = arg.asJavaConstant();
                     param.usages().snapshotTo(modifiedNodes);
                     param.replaceAndDelete(ConstantNode.forConstant(constant, phaseContext.getMetaAccess(), graphCopy));
                 } else {
@@ -304,7 +304,7 @@
                     if (length != null && length.isConstant()) {
                         param.usages().snapshotTo(modifiedNodes);
                         ParameterNode newParam = graphCopy.addWithoutUnique(ParameterNode.create(param.index(), param.stamp()));
-                        param.replaceAndDelete(graphCopy.addWithoutUnique(PiArrayNode.create(newParam, ConstantNode.forInt(length.asConstant().asInt(), graphCopy), param.stamp())));
+                        param.replaceAndDelete(graphCopy.addWithoutUnique(PiArrayNode.create(newParam, ConstantNode.forInt(length.asJavaConstant().asInt(), graphCopy), param.stamp())));
                     }
                 }
             }
@@ -434,7 +434,7 @@
             throw new AssertionError(String.format("Method argument for method '%s' is not constant.", callDirectMethod.toString()));
         }
 
-        Constant constantCallNode = node.asConstant();
+        JavaConstant constantCallNode = node.asJavaConstant();
         Object value = snippetReflection.asObject(constantCallNode);
 
         if (!(value instanceof OptimizedDirectCallNode)) {
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluatorCanonicalizer.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluatorCanonicalizer.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
         if (!loadFieldNode.isStatic() && loadFieldNode.object().isConstant() && !loadFieldNode.object().isNullConstant()) {
             if (loadFieldNode.field().isFinal() || (loadFieldNode.getKind() == Kind.Object && loadFieldNode.field().getAnnotation(Child.class) != null) ||
                             loadFieldNode.field().getAnnotation(CompilerDirectives.CompilationFinal.class) != null) {
-                Constant constant = loadFieldNode.field().readValue(loadFieldNode.object().asConstant());
+                JavaConstant constant = loadFieldNode.field().readValue(loadFieldNode.object().asJavaConstant());
                 assert verifyFieldValue(loadFieldNode.field(), constant);
                 return ConstantNode.forConstant(constant, metaAccess);
             }
@@ -64,9 +64,9 @@
 
     private Node canonicalizeLoadIndex(LoadIndexedNode loadIndexedNode) {
         if (loadIndexedNode.array().isConstant() && loadIndexedNode.index().isConstant()) {
-            int index = loadIndexedNode.index().asConstant().asInt();
+            int index = loadIndexedNode.index().asJavaConstant().asInt();
 
-            Constant constant = constantReflection.readArrayElement(loadIndexedNode.array().asConstant(), index);
+            JavaConstant constant = constantReflection.readArrayElement(loadIndexedNode.array().asJavaConstant(), index);
             if (constant != null) {
                 return ConstantNode.forConstant(constant, metaAccess);
             }
@@ -74,7 +74,7 @@
         return loadIndexedNode;
     }
 
-    private boolean verifyFieldValue(ResolvedJavaField field, Constant constant) {
+    private boolean verifyFieldValue(ResolvedJavaField field, JavaConstant constant) {
         assert field.getAnnotation(Child.class) == null || constant.isNull() ||
                         metaAccess.lookupJavaType(com.oracle.truffle.api.nodes.Node.class).isAssignableFrom(metaAccess.lookupJavaType(constant)) : "@Child field value must be a Node: " + field +
                         ", but was: " + constant;
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
         ResolvedJavaMethod targetMethod = callTarget.targetMethod();
         ResolvedJavaType targetReceiverType = null;
         if (!sourceMethod.isStatic() && callTarget.receiver() != null && callTarget.receiver().isConstant()) {
-            targetReceiverType = providers.getMetaAccess().lookupJavaType(callTarget.arguments().first().asConstant());
+            targetReceiverType = providers.getMetaAccess().lookupJavaType(callTarget.arguments().first().asJavaConstant());
         }
 
         if (targetReceiverType != null) {
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/AssumptionNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/AssumptionNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -67,7 +67,7 @@
     public void simplify(SimplifierTool tool) {
         ValueNode assumption = getAssumption();
         if (tool.assumptions() != null && assumption.isConstant()) {
-            Constant c = assumption.asConstant();
+            JavaConstant c = assumption.asJavaConstant();
             assert c.getKind() == Kind.Object;
             Object object = getSnippetReflection().asObject(c);
             OptimizedAssumption assumptionObject = (OptimizedAssumption) object;
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/BailoutNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/BailoutNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -54,7 +54,7 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (getMessage().isConstant()) {
-            throw new BailoutException(getMessage().asConstant().toValueString());
+            throw new BailoutException(getMessage().asJavaConstant().toValueString());
         }
         return this;
     }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/LoadIndexedFinalNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/LoadIndexedFinalNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (array().isConstant() && index().isConstant()) {
-            Constant constant = tool.getConstantReflection().readArrayElement(array().asConstant(), index().asConstant().asInt());
+            JavaConstant constant = tool.getConstantReflection().readArrayElement(array().asJavaConstant(), index().asJavaConstant().asInt());
             if (constant != null) {
                 return ConstantNode.forConstant(constant, tool.getMetaAccess());
             }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,11 +31,11 @@
  */
 public final class ObjectLocationIdentity implements LocationIdentity {
 
-    private static HashMap<Constant, LocationIdentity> map = new HashMap<>();
+    private static HashMap<JavaConstant, LocationIdentity> map = new HashMap<>();
 
-    private Constant object;
+    private JavaConstant object;
 
-    public static LocationIdentity create(Constant object) {
+    public static LocationIdentity create(JavaConstant object) {
         assert object.getKind() == Kind.Object && object.isNonNull();
         synchronized (map) {
             if (map.containsKey(object)) {
@@ -48,7 +48,7 @@
         }
     }
 
-    private ObjectLocationIdentity(Constant object) {
+    private ObjectLocationIdentity(JavaConstant object) {
         this.object = object;
     }
 
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerAddExactNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerAddExactNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -61,7 +61,7 @@
         if (forX.isConstant()) {
             return canonicalXconstant(forX, forY);
         } else if (forY.isConstant()) {
-            long c = forY.asConstant().asLong();
+            long c = forY.asJavaConstant().asLong();
             if (c == 0) {
                 return forX;
             }
@@ -70,8 +70,8 @@
     }
 
     private ValueNode canonicalXconstant(ValueNode forX, ValueNode forY) {
-        Constant xConst = forX.asConstant();
-        Constant yConst = forY.asConstant();
+        JavaConstant xConst = forX.asJavaConstant();
+        JavaConstant yConst = forY.asJavaConstant();
         assert xConst.getKind() == yConst.getKind();
         try {
             if (xConst.getKind() == Kind.Int) {
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerMulExactNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerMulExactNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -55,7 +55,7 @@
         if (forX.isConstant()) {
             return canonicalXconstant(forX, forY);
         } else if (forY.isConstant()) {
-            long c = forY.asConstant().asLong();
+            long c = forY.asJavaConstant().asLong();
             if (c == 1) {
                 return forX;
             }
@@ -67,8 +67,8 @@
     }
 
     private ValueNode canonicalXconstant(ValueNode forX, ValueNode forY) {
-        Constant xConst = forX.asConstant();
-        Constant yConst = forY.asConstant();
+        JavaConstant xConst = forX.asJavaConstant();
+        JavaConstant yConst = forY.asJavaConstant();
         assert xConst.getKind() == yConst.getKind();
         try {
             if (xConst.getKind() == Kind.Int) {
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerSubExactNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/arithmetic/IntegerSubExactNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -62,7 +62,7 @@
         if (forX.isConstant() && forY.isConstant()) {
             return canonicalXYconstant(forX, forY);
         } else if (forY.isConstant()) {
-            long c = forY.asConstant().asLong();
+            long c = forY.asJavaConstant().asLong();
             if (c == 0) {
                 return forX;
             }
@@ -71,8 +71,8 @@
     }
 
     private ValueNode canonicalXYconstant(ValueNode forX, ValueNode forY) {
-        Constant xConst = forX.asConstant();
-        Constant yConst = forY.asConstant();
+        JavaConstant xConst = forX.asJavaConstant();
+        JavaConstant yConst = forY.asJavaConstant();
         assert xConst.getKind() == yConst.getKind();
         try {
             if (xConst.getKind() == Kind.Int) {
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,7 +87,7 @@
 
     private FrameDescriptor getConstantFrameDescriptor() {
         assert descriptor.isConstant() && !descriptor.isNullConstant();
-        return (FrameDescriptor) getSnippetReflection().asObject(descriptor.asConstant());
+        return (FrameDescriptor) getSnippetReflection().asObject(descriptor.asJavaConstant());
     }
 
     private int getFrameSize() {
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadFinalNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadFinalNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,8 +63,8 @@
 
     @Override
     public Node canonical(CanonicalizerTool tool) {
-        if (object.isConstant() && !object.isNullConstant() && offset.isConstant() && condition.isConstant() && condition.asConstant().asInt() == 1) {
-            Constant constant = tool.getConstantReflection().readUnsafeConstant(accessKind, object.asConstant(), offset.asConstant().asLong());
+        if (object.isConstant() && !object.isNullConstant() && offset.isConstant() && condition.isConstant() && condition.asJavaConstant().asInt() == 1) {
+            JavaConstant constant = tool.getConstantReflection().readUnsafeConstant(accessKind, object.asJavaConstant(), offset.asJavaConstant().asLong());
             return ConstantNode.forConstant(constant, tool.getMetaAccess());
         }
         return this;
@@ -79,7 +79,7 @@
         if (state != null && state.getState() == EscapeState.Virtual) {
             ValueNode offsetValue = tool.getReplacedValue(offset);
             if (offsetValue.isConstant()) {
-                long constantOffset = offsetValue.asConstant().asLong();
+                long constantOffset = offsetValue.asJavaConstant().asLong();
                 int entryIndex = state.getVirtualObject().entryIndexForOffset(constantOffset);
                 if (entryIndex != -1) {
                     ValueNode entry = state.getEntry(entryIndex);
@@ -95,10 +95,10 @@
     public void lower(LoweringTool tool) {
         CompareNode compare = CompareNode.createCompareNode(graph(), Condition.EQ, condition, ConstantNode.forBoolean(true, graph()));
         LocationIdentity locationIdentity;
-        if (!location.isConstant() || location.asConstant().isNull()) {
+        if (!location.isConstant() || location.asJavaConstant().isNull()) {
             locationIdentity = LocationIdentity.ANY_LOCATION;
         } else {
-            locationIdentity = ObjectLocationIdentity.create(location.asConstant());
+            locationIdentity = ObjectLocationIdentity.create(location.asJavaConstant());
         }
         UnsafeLoadNode result = graph().add(UnsafeLoadNode.create(object, offset, accessKind, locationIdentity, compare));
         graph().replaceFixedWithFixed(this, result);
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadMacroNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadMacroNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -63,10 +63,10 @@
             ValueNode offsetArgument = arguments.get(OFFSET_ARGUMENT_INDEX);
             ValueNode conditionArgument = arguments.get(CONDITION_ARGUMENT_INDEX);
             LocationIdentity locationIdentity;
-            if (locationArgument.asConstant().isNull()) {
+            if (locationArgument.asJavaConstant().isNull()) {
                 locationIdentity = LocationIdentity.ANY_LOCATION;
             } else {
-                locationIdentity = ObjectLocationIdentity.create(locationArgument.asConstant());
+                locationIdentity = ObjectLocationIdentity.create(locationArgument.asJavaConstant());
             }
             CompareNode compare = CompareNode.createCompareNode(Condition.EQ, conditionArgument, ConstantNode.forBoolean(true));
             Kind returnKind = this.getTargetMethod().getSignature().getReturnKind();
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeStoreMacroNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeStoreMacroNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -60,10 +60,10 @@
             ValueNode offsetArgument = arguments.get(OFFSET_ARGUMENT_INDEX);
             ValueNode valueArgument = arguments.get(VALUE_ARGUMENT_INDEX);
             LocationIdentity locationIdentity;
-            if (locationArgument.asConstant().isNull()) {
+            if (locationArgument.asJavaConstant().isNull()) {
                 locationIdentity = LocationIdentity.ANY_LOCATION;
             } else {
-                locationIdentity = ObjectLocationIdentity.create(locationArgument.asConstant());
+                locationIdentity = ObjectLocationIdentity.create(locationArgument.asJavaConstant());
             }
 
             return UnsafeStoreNode.create(objectArgument, offsetArgument, valueArgument, this.getTargetMethod().getSignature().getParameterKind(VALUE_ARGUMENT_INDEX), locationIdentity, stateAfter());
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/UnsafeTypeCastMacroNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/UnsafeTypeCastMacroNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -61,13 +61,13 @@
         if (classArgument.isConstant() && nonNullArgument.isConstant()) {
             ValueNode objectArgument = arguments.get(OBJECT_ARGUMENT_INDEX);
             ValueNode conditionArgument = arguments.get(CONDITION_ARGUMENT_INDEX);
-            ResolvedJavaType lookupJavaType = tool.getConstantReflection().asJavaType(classArgument.asConstant());
+            ResolvedJavaType lookupJavaType = tool.getConstantReflection().asJavaType(classArgument.asJavaConstant());
             tool.addToWorkList(usages());
             if (lookupJavaType == null) {
                 replaceAtUsages(objectArgument);
                 GraphUtil.removeFixedWithUnusedInputs(this);
             } else {
-                Stamp piStamp = StampFactory.declared(lookupJavaType, nonNullArgument.asConstant().asInt() != 0, true);
+                Stamp piStamp = StampFactory.declared(lookupJavaType, nonNullArgument.asJavaConstant().asInt() != 0, true);
                 ConditionAnchorNode valueAnchorNode = graph().add(
                                 ConditionAnchorNode.create(CompareNode.createCompareNode(graph(), Condition.EQ, conditionArgument, ConstantNode.forBoolean(true, graph()))));
                 PiNode piCast = graph().unique(PiNode.create(objectArgument, piStamp, valueAnchorNode));
--- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -436,10 +436,10 @@
                             Kind valueKind = value.getKind();
                             if (valueKind != twoSlotKinds[valueIndex]) {
                                 ValueNode nextValue = objStates[i].getEntry(valueIndex + 1);
-                                if (value.isConstant() && value.asConstant().equals(Constant.INT_0) && nextValue.isConstant() && nextValue.asConstant().equals(Constant.INT_0)) {
+                                if (value.isConstant() && value.asJavaConstant().equals(JavaConstant.INT_0) && nextValue.isConstant() && nextValue.asJavaConstant().equals(JavaConstant.INT_0)) {
                                     // rewrite to a zero constant of the larger kind
                                     objStates[i].setEntry(valueIndex, ConstantNode.defaultForKind(twoSlotKinds[valueIndex], merge.graph()));
-                                    objStates[i].setEntry(valueIndex + 1, ConstantNode.forConstant(Constant.forIllegal(), tool.getMetaAccessProvider(), merge.graph()));
+                                    objStates[i].setEntry(valueIndex + 1, ConstantNode.forConstant(JavaConstant.forIllegal(), tool.getMetaAccessProvider(), merge.graph()));
                                 } else {
                                     compatible = false;
                                     break outer;
@@ -468,7 +468,7 @@
                         // skip an entry after a long/double value that occupies two int slots
                         valueIndex++;
                         phis[valueIndex] = null;
-                        values[valueIndex] = ConstantNode.forConstant(Constant.forIllegal(), tool.getMetaAccessProvider(), merge.graph());
+                        values[valueIndex] = ConstantNode.forConstant(JavaConstant.forIllegal(), tool.getMetaAccessProvider(), merge.graph());
                     }
                     valueIndex++;
                 }
--- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@
     @Override
     public Kind getValueKind() {
         if (valueKind.isConstant()) {
-            return (Kind) snippetReflection.asObject(valueKind.asConstant());
+            return (Kind) snippetReflection.asObject(valueKind.asJavaConstant());
         }
         throw new GraalInternalError("Cannot access kind yet because it is not constant: " + valueKind);
     }
@@ -93,7 +93,7 @@
     @Override
     public LocationIdentity getLocationIdentity() {
         if (locationIdentity.isConstant()) {
-            return (LocationIdentity) snippetReflection.asObject(locationIdentity.asConstant());
+            return (LocationIdentity) snippetReflection.asObject(locationIdentity.asJavaConstant());
         }
         // We do not know our actual location identity yet, so be conservative.
         return ANY_LOCATION;
@@ -102,15 +102,15 @@
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (valueKind.isConstant() && locationIdentity.isConstant() && displacement.isConstant() && (indexScaling == null || indexScaling.isConstant())) {
-            Kind constKind = (Kind) snippetReflection.asObject(valueKind.asConstant());
-            LocationIdentity constLocation = (LocationIdentity) snippetReflection.asObject(locationIdentity.asConstant());
-            long constDisplacement = displacement.asConstant().asLong();
-            int constIndexScaling = indexScaling == null ? 0 : indexScaling.asConstant().asInt();
+            Kind constKind = (Kind) snippetReflection.asObject(valueKind.asJavaConstant());
+            LocationIdentity constLocation = (LocationIdentity) snippetReflection.asObject(locationIdentity.asJavaConstant());
+            long constDisplacement = displacement.asJavaConstant().asLong();
+            int constIndexScaling = indexScaling == null ? 0 : indexScaling.asJavaConstant().asInt();
 
             if (index == null || constIndexScaling == 0) {
                 return ConstantLocationNode.create(constLocation, constKind, constDisplacement, graph());
             } else if (index.isConstant()) {
-                return ConstantLocationNode.create(constLocation, constKind, index.asConstant().asLong() * constIndexScaling + constDisplacement, graph());
+                return ConstantLocationNode.create(constLocation, constKind, index.asJavaConstant().asLong() * constIndexScaling + constDisplacement, graph());
             } else {
                 return IndexedLocationNode.create(constLocation, constKind, constDisplacement, index, graph(), constIndexScaling);
             }
--- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java	Thu Oct 30 11:18:48 2014 +0100
+++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java	Thu Oct 30 12:21:07 2014 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -234,7 +234,7 @@
                 assert arguments.size() == 3;
                 Kind readKind = asKind(callTargetNode.returnType());
                 LocationNode location = makeLocation(graph, arguments.get(1), readKind, ANY_LOCATION);
-                BarrierType barrierType = (BarrierType) snippetReflection.asObject(arguments.get(2).asConstant());
+                BarrierType barrierType = (BarrierType) snippetReflection.asObject(arguments.get(2).asJavaConstant());
                 replace(invoke, readOp(graph, arguments.get(0), invoke, location, barrierType, true));
                 break;
             }
@@ -374,7 +374,7 @@
 
     private LocationNode makeLocation(StructuredGraph graph, ValueNode offset, Kind readKind, ValueNode locationIdentity) {
         if (locationIdentity.isConstant()) {
-            return makeLocation(graph, offset, readKind, (LocationIdentity) snippetReflection.asObject(locationIdentity.asConstant()));
+            return makeLocation(graph, offset, readKind, (LocationIdentity) snippetReflection.asObject(locationIdentity.asJavaConstant()));
         }
         return SnippetLocationNode.create(snippetReflection, locationIdentity, ConstantNode.forConstant(snippetReflection.forObject(readKind), metaAccess, graph), ConstantNode.forLong(0, graph),
                         fromSigned(graph, offset), ConstantNode.forInt(1, graph), graph);
--- a/src/share/vm/classfile/systemDictionary.hpp	Thu Oct 30 11:18:48 2014 +0100
+++ b/src/share/vm/classfile/systemDictionary.hpp	Thu Oct 30 12:21:07 2014 +0100
@@ -233,7 +233,7 @@
   GRAAL_ONLY(do_klass(StackSlot_klass,                       com_oracle_graal_api_code_StackSlot,                          Graal)) \
   GRAAL_ONLY(do_klass(VirtualObject_klass,                   com_oracle_graal_api_code_VirtualObject,                      Graal)) \
   GRAAL_ONLY(do_klass(SpeculationLog_klass,                  com_oracle_graal_api_code_SpeculationLog,                     Graal)) \
-  GRAAL_ONLY(do_klass(Constant_klass,                        com_oracle_graal_api_meta_Constant,                           Graal)) \
+  GRAAL_ONLY(do_klass(JavaConstant_klass,                    com_oracle_graal_api_meta_JavaConstant,                       Graal)) \
   GRAAL_ONLY(do_klass(PrimitiveConstant_klass,               com_oracle_graal_api_meta_PrimitiveConstant,                  Graal)) \
   GRAAL_ONLY(do_klass(RawConstant_klass,                     com_oracle_graal_api_meta_RawConstant,                        Graal)) \
   GRAAL_ONLY(do_klass(NullConstant_klass,                    com_oracle_graal_api_meta_NullConstant,                       Graal)) \
--- a/src/share/vm/classfile/vmSymbols.hpp	Thu Oct 30 11:18:48 2014 +0100
+++ b/src/share/vm/classfile/vmSymbols.hpp	Thu Oct 30 12:21:07 2014 +0100
@@ -312,7 +312,7 @@
   GRAAL_ONLY(template(com_oracle_graal_hotspot_meta_HotSpotMetaspaceConstant,   "com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstant"))        \
   GRAAL_ONLY(template(com_oracle_graal_hotspot_HotSpotStackFrameReference,      "com/oracle/graal/hotspot/HotSpotStackFrameReference"))           \
   GRAAL_ONLY(template(com_oracle_graal_hotspot_CompilationTask,                 "com/oracle/graal/hotspot/CompilationTask"))                      \
-  GRAAL_ONLY(template(com_oracle_graal_api_meta_Constant,                       "com/oracle/graal/api/meta/Constant"))                            \
+  GRAAL_ONLY(template(com_oracle_graal_api_meta_JavaConstant,                   "com/oracle/graal/api/meta/JavaConstant"))                        \
   GRAAL_ONLY(template(com_oracle_graal_api_meta_PrimitiveConstant,              "com/oracle/graal/api/meta/PrimitiveConstant"))                   \
   GRAAL_ONLY(template(com_oracle_graal_api_meta_RawConstant,                    "com/oracle/graal/api/meta/RawConstant"))                         \
   GRAAL_ONLY(template(com_oracle_graal_api_meta_NullConstant,                   "com/oracle/graal/api/meta/NullConstant"))                        \
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Thu Oct 30 11:18:48 2014 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Thu Oct 30 12:21:07 2014 +0100
@@ -191,7 +191,7 @@
   if (constant->is_a(HotSpotMetaspaceConstant::klass())) {
     oop obj = HotSpotMetaspaceConstant::metaspaceObject(constant);
     jlong prim = HotSpotMetaspaceConstant::primitive(constant);
-    assert(Kind::typeChar(Constant::kind(constant)) == 'j', "must have word kind");
+    assert(Kind::typeChar(Value::kind(constant)) == 'j', "must have word kind");
     assert(obj != NULL, "must have an object");
     assert(prim != 0, "must have a primitive value");
 
@@ -288,7 +288,7 @@
       second = value;
     }
     return value;
-  } else if (value->is_a(Constant::klass())){
+  } else if (value->is_a(JavaConstant::klass())){
     record_metadata_in_constant(value, oop_recorder);
     if (value->is_a(PrimitiveConstant::klass())) {
       assert(!reference, "unexpected primitive constant type");
--- a/src/share/vm/graal/graalJavaAccess.hpp	Thu Oct 30 11:18:48 2014 +0100
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Thu Oct 30 12:21:07 2014 +0100
@@ -190,8 +190,7 @@
     oop_field(BytecodePosition, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;")                                                                      \
     int_field(BytecodePosition, bci)                                                                                                                           \
   end_class                                                                                                                                                    \
-  start_class(Constant)                                                                                                                                        \
-    oop_field(Constant, kind, "Lcom/oracle/graal/api/meta/Kind;")                                                                                              \
+  start_class(JavaConstant)                                                                                                                                    \
   end_class                                                                                                                                                    \
   start_class(PrimitiveConstant)                                                                                                                               \
     long_field(PrimitiveConstant, primitive)                                                                                                                   \
@@ -201,7 +200,7 @@
   end_class                                                                                                                                                    \
   start_class(NullConstant)                                                                                                                                    \
   end_class                                                                                                                                                    \
-  start_class(HotSpotCompressedNullConstant)                                                                                                                                    \
+  start_class(HotSpotCompressedNullConstant)                                                                                                                   \
   end_class                                                                                                                                                    \
   start_class(HotSpotObjectConstant)                                                                                                                           \
     oop_field(HotSpotObjectConstant, object, "Ljava/lang/Object;")                                                                                             \