Search in sources :

Example 11 with GraalHotSpotVMConfig

use of org.graalvm.compiler.hotspot.GraalHotSpotVMConfig in project graal by oracle.

the class DefaultHotSpotLoweringProvider method lowerHubGetClassNode.

private void lowerHubGetClassNode(HubGetClassNode n, LoweringTool tool) {
    if (tool.getLoweringStage() == LoweringTool.StandardLoweringStage.HIGH_TIER) {
        return;
    }
    ValueNode hub = n.getHub();
    GraalHotSpotVMConfig vmConfig = runtime.getVMConfig();
    StructuredGraph graph = n.graph();
    assert !hub.isConstant() || GraalOptions.ImmutableCode.getValue(graph.getOptions());
    AddressNode mirrorAddress = createOffsetAddress(graph, hub, vmConfig.classMirrorOffset);
    FloatingReadNode read = graph.unique(new FloatingReadNode(mirrorAddress, CLASS_MIRROR_LOCATION, null, vmConfig.classMirrorIsHandle ? StampFactory.forKind(target.wordJavaKind) : n.stamp(NodeView.DEFAULT), null, BarrierType.NONE));
    if (vmConfig.classMirrorIsHandle) {
        AddressNode address = createOffsetAddress(graph, read, 0);
        read = graph.unique(new FloatingReadNode(address, CLASS_MIRROR_HANDLE_LOCATION, null, n.stamp(NodeView.DEFAULT), null, BarrierType.NONE));
    }
    n.replaceAtUsagesAndDelete(read);
}
Also used : StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) FloatingReadNode(org.graalvm.compiler.nodes.memory.FloatingReadNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) GetObjectAddressNode(org.graalvm.compiler.hotspot.nodes.GetObjectAddressNode) ComputeObjectAddressNode(org.graalvm.compiler.hotspot.nodes.ComputeObjectAddressNode) AddressNode(org.graalvm.compiler.nodes.memory.address.AddressNode) GraalHotSpotVMConfig(org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)

Example 12 with GraalHotSpotVMConfig

use of org.graalvm.compiler.hotspot.GraalHotSpotVMConfig in project graal by oracle.

the class HotSpotResolvedJavaFieldTest method jvmFieldModifiers.

/**
 * Same as {@code HotSpotModifiers.jvmFieldModifiers()} but works when using a JVMCI version
 * prior to the introduction of that method.
 */
private int jvmFieldModifiers() {
    GraalHotSpotVMConfig config = runtime().getVMConfig();
    int accEnum = config.getConstant("JVM_ACC_ENUM", Integer.class, 0x4000);
    int accSynthetic = config.getConstant("JVM_ACC_SYNTHETIC", Integer.class, 0x1000);
    return PUBLIC | PRIVATE | PROTECTED | STATIC | FINAL | VOLATILE | TRANSIENT | accEnum | accSynthetic;
}
Also used : GraalHotSpotVMConfig(org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)

Example 13 with GraalHotSpotVMConfig

use of org.graalvm.compiler.hotspot.GraalHotSpotVMConfig in project graal by oracle.

the class HotSpotResolvedObjectTypeTest method testKlassLayoutHelper.

@Test
public void testKlassLayoutHelper() {
    Constant klass = HotSpotResolvedObjectType.fromObjectClass(this.getClass()).klass();
    MemoryAccessProvider memoryAccess = getProviders().getConstantReflection().getMemoryAccessProvider();
    GraalHotSpotVMConfig config = runtime().getVMConfig();
    Constant c = StampFactory.forKind(JavaKind.Int).readConstant(memoryAccess, klass, config.klassLayoutHelperOffset);
    assertTrue(c.toString(), c.getClass() == PrimitiveConstant.class);
    PrimitiveConstant pc = (PrimitiveConstant) c;
    assertTrue(pc.toString(), pc.getJavaKind() == JavaKind.Int);
}
Also used : MemoryAccessProvider(jdk.vm.ci.meta.MemoryAccessProvider) Constant(jdk.vm.ci.meta.Constant) PrimitiveConstant(jdk.vm.ci.meta.PrimitiveConstant) PrimitiveConstant(jdk.vm.ci.meta.PrimitiveConstant) GraalHotSpotVMConfig(org.graalvm.compiler.hotspot.GraalHotSpotVMConfig) Test(org.junit.Test)

Aggregations

GraalHotSpotVMConfig (org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)13 TargetDescription (jdk.vm.ci.code.TargetDescription)6 CallingConvention (jdk.vm.ci.code.CallingConvention)3 RegisterValue (jdk.vm.ci.code.RegisterValue)3 HotSpotCodeCacheProvider (jdk.vm.ci.hotspot.HotSpotCodeCacheProvider)3 HotSpotConstantReflectionProvider (jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider)3 HotSpotMetaAccessProvider (jdk.vm.ci.hotspot.HotSpotMetaAccessProvider)3 PlatformKind (jdk.vm.ci.meta.PlatformKind)3 Value (jdk.vm.ci.meta.Value)3 JVMCIBackend (jdk.vm.ci.runtime.JVMCIBackend)3 BytecodeProvider (org.graalvm.compiler.bytecode.BytecodeProvider)3 HotSpotForeignCallLinkageImpl (org.graalvm.compiler.hotspot.HotSpotForeignCallLinkageImpl)3 HotSpotReplacementsImpl (org.graalvm.compiler.hotspot.HotSpotReplacementsImpl)3 HotSpotGraalConstantFieldProvider (org.graalvm.compiler.hotspot.meta.HotSpotGraalConstantFieldProvider)3 HotSpotGraphBuilderPlugins (org.graalvm.compiler.hotspot.meta.HotSpotGraphBuilderPlugins)3 HotSpotLoweringProvider (org.graalvm.compiler.hotspot.meta.HotSpotLoweringProvider)3 HotSpotProviders (org.graalvm.compiler.hotspot.meta.HotSpotProviders)3 HotSpotRegistersProvider (org.graalvm.compiler.hotspot.meta.HotSpotRegistersProvider)3 HotSpotSnippetReflectionProvider (org.graalvm.compiler.hotspot.meta.HotSpotSnippetReflectionProvider)3 HotSpotStampProvider (org.graalvm.compiler.hotspot.meta.HotSpotStampProvider)3