本文整理匯總了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;
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
}
示例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");
}
示例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");
}
示例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");
}
示例12: readConstant
import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public abstract Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement);
示例13: readConstant
import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement) {
return null;
}
示例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);
}
示例15: getMemoryAccessProvider
import jdk.vm.ci.meta.MemoryAccessProvider; //導入依賴的package包/類
@Override
public MemoryAccessProvider getMemoryAccessProvider() {
return memoryAccess;
}