mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8152634: generalize exception throwing routines in JVMCIRuntime
Reviewed-by: twisti
This commit is contained in:
parent
d39c84770b
commit
49558c8d6e
21 changed files with 198 additions and 41 deletions
|
@ -40,6 +40,8 @@ package compiler.jvmci.code;
|
|||
import jdk.vm.ci.code.Register;
|
||||
import jdk.vm.ci.code.site.DataSectionReference;
|
||||
import jdk.vm.ci.hotspot.HotSpotConstant;
|
||||
import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider;
|
||||
import jdk.vm.ci.hotspot.HotSpotSymbol;
|
||||
import jdk.vm.ci.hotspot.HotSpotVMConfig;
|
||||
import jdk.vm.ci.meta.ResolvedJavaType;
|
||||
|
||||
|
@ -155,4 +157,33 @@ public class DataPatchTest extends CodeInstallationTest {
|
|||
asm.emitPointerRet(ret);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static long getConstSymbol(HotSpotMetaAccessProvider meta) {
|
||||
HotSpotSymbol symbol = meta.lookupSymbol("java/lang/Object");
|
||||
return symbol.getMetaspacePointer();
|
||||
}
|
||||
|
||||
private void testSymbol(TestCompiler compiler) {
|
||||
test(compiler, getMethod("getConstSymbol", HotSpotMetaAccessProvider.class), (HotSpotMetaAccessProvider) metaAccess);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInlineSymbol() {
|
||||
testSymbol(asm -> {
|
||||
HotSpotSymbol symbol = ((HotSpotMetaAccessProvider) metaAccess).lookupSymbol("java/lang/Object");
|
||||
Register ret = asm.emitLoadPointer((HotSpotConstant) symbol.asConstant());
|
||||
asm.emitPointerRet(ret);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSymbolInDataSection() {
|
||||
testSymbol(asm -> {
|
||||
HotSpotSymbol symbol = ((HotSpotMetaAccessProvider) metaAccess).lookupSymbol("java/lang/Object");
|
||||
DataSectionReference ref = asm.emitDataItem((HotSpotConstant) symbol.asConstant());
|
||||
Register ret = asm.emitLoadPointer(ref);
|
||||
asm.emitPointerRet(ret);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue