當前位置: 首頁>>代碼示例>>Java>>正文


Java MemoryAccessProvider類代碼示例

本文整理匯總了Java中jdk.vm.ci.meta.MemoryAccessProvider的典型用法代碼示例。如果您正苦於以下問題:Java MemoryAccessProvider類的具體用法?Java MemoryAccessProvider怎麽用?Java MemoryAccessProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MemoryAccessProvider類屬於jdk.vm.ci.meta包,在下文中一共展示了MemoryAccessProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
    try {
        return provider.readObjectConstant(base, displacement);
    } catch (IllegalArgumentException e) {
        /*
         * It's possible that the base and displacement aren't valid together so simply return
         * null.
         */
        return null;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:13,代碼來源:ObjectStamp.java

示例2: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
    try {
        return provider.readPrimitiveConstant(getStackKind(), base, displacement, getBits());
    } catch (IllegalArgumentException e) {
        /*
         * It's possible that the base and displacement aren't valid together so simply return
         * null.
         */
        return null;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:13,代碼來源:PrimitiveStamp.java

示例3: testReadPrimitive

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Ignore("not all JVMCI versions are safe yet")
@Test
public void testReadPrimitive() {
    MemoryAccessProvider memory = getConstantReflection().getMemoryAccessProvider();
    JavaConstant base = getSnippetReflection().forObject("");
    Stamp stamp = StampFactory.forKind(JavaKind.Long);
    assertTrue(stamp.readConstant(memory, base, 128) == null);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:StampMemoryAccessTest.java

示例4: testReadObject

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Ignore("not all JVMCI versions are safe yet")
@Test
public void testReadObject() {
    MemoryAccessProvider memory = getConstantReflection().getMemoryAccessProvider();
    JavaConstant base = getSnippetReflection().forObject("");
    Stamp stamp = StampFactory.forKind(JavaKind.Object);
    assertTrue(stamp.readConstant(memory, base, 128) == null);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:StampMemoryAccessTest.java

示例5: testReadNarrowObject

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Ignore("not all versions are safe yet")
@Test
public void testReadNarrowObject() {
    CompressEncoding oopEncoding = runtime().getVMConfig().getOopEncoding();
    Assume.assumeTrue("Compressed oops must be enabled", runtime().getVMConfig().useCompressedOops);
    MemoryAccessProvider memory = getConstantReflection().getMemoryAccessProvider();
    JavaConstant base = getSnippetReflection().forObject("");
    ObjectStamp stamp = (ObjectStamp) StampFactory.forKind(JavaKind.Object);
    Stamp narrowStamp = HotSpotNarrowOopStamp.compressed(stamp, oopEncoding);
    assertTrue(narrowStamp.readConstant(memory, base, 128) == null);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:12,代碼來源:HotSpotStampMemoryAccessTest.java

示例6: testKlassLayoutHelper

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:11,代碼來源:HotSpotResolvedObjectTypeTest.java

示例7: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
    HotSpotMemoryAccessProvider hsProvider = (HotSpotMemoryAccessProvider) provider;
    if (isCompressed()) {
        return hsProvider.readNarrowKlassPointerConstant(base, displacement);
    } else {
        return hsProvider.readKlassPointerConstant(base, displacement);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:10,代碼來源:KlassPointerStamp.java

示例8: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
    try {
        HotSpotMemoryAccessProvider hsProvider = (HotSpotMemoryAccessProvider) provider;
        return hsProvider.readNarrowOopConstant(base, displacement);
    } catch (IllegalArgumentException e) {
        return null;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:10,代碼來源:HotSpotNarrowOopStamp.java

示例9: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
    throw GraalError.shouldNotReachHere("can't read values of illegal stamp");
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:IllegalStamp.java

示例10: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
    throw GraalError.shouldNotReachHere("can't read raw pointer");
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:RawPointerStamp.java

示例11: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
    throw GraalError.shouldNotReachHere("can't read values of void stamp");
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:VoidStamp.java

示例12: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public abstract Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement);
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:3,代碼來源:NarrowOopStamp.java

示例13: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
    return null;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:MethodCountersPointerStamp.java

示例14: readConstant

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
    HotSpotMemoryAccessProvider hsProvider = (HotSpotMemoryAccessProvider) provider;
    return hsProvider.readMethodPointerConstant(base, displacement);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:6,代碼來源:MethodPointerStamp.java

示例15: getMemoryAccessProvider

import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public MemoryAccessProvider getMemoryAccessProvider() {
    return memoryAccess;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:HotSpotConstantReflectionProvider.java


注:本文中的jdk.vm.ci.meta.MemoryAccessProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。