Skip to content
This repository has been archived by the owner before Nov 9, 2022. It is now read-only.
Permalink
Browse files
8257143: Enable JVMCI code installation tests on AArch64
Reviewed-by: burban, kvn
  • Loading branch information
nick-arm committed Dec 3, 2020
1 parent a5a034b commit 4169d96e249bee6e9c467d4f1d27da533321a8d9
Show file tree
Hide file tree
Showing 10 changed files with 573 additions and 17 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -31,8 +31,8 @@
enum {
// Relocations are byte-aligned.
offset_unit = 1,
// We don't use format().
format_width = 0
// Must be at least 1 for RelocInfo::narrow_oop_in_const.
format_width = 1
};

public:
@@ -22,12 +22,15 @@
*/
package jdk.vm.ci.code.test;

import jdk.vm.ci.aarch64.AArch64;
import jdk.vm.ci.amd64.AMD64;
import jdk.vm.ci.code.Architecture;
import jdk.vm.ci.code.CodeCacheProvider;
import jdk.vm.ci.code.InstalledCode;
import jdk.vm.ci.code.TargetDescription;
import jdk.vm.ci.code.test.aarch64.AArch64TestAssembler;
import jdk.vm.ci.code.test.amd64.AMD64TestAssembler;
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider;
import jdk.vm.ci.hotspot.HotSpotCompiledCode;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
@@ -44,6 +47,8 @@
*/
public class CodeInstallationTest {

private static final boolean DEBUG = false;

protected final MetaAccessProvider metaAccess;
protected final CodeCacheProvider codeCache;
protected final TargetDescription target;
@@ -68,6 +73,8 @@ private TestAssembler createAssembler() {
Architecture arch = codeCache.getTarget().arch;
if (arch instanceof AMD64) {
return new AMD64TestAssembler(codeCache, config);
} else if (arch instanceof AArch64) {
return new AArch64TestAssembler(codeCache, config);
} else {
Assert.fail("unsupported architecture");
return null;
@@ -95,6 +102,11 @@ protected void test(TestCompiler compiler, Method method, Object... args) {
HotSpotCompiledCode code = asm.finish(resolvedMethod);
InstalledCode installed = codeCache.addCode(resolvedMethod, code, null, null);

if (DEBUG) {
String str = ((HotSpotCodeCacheProvider) codeCache).disassemble(installed);
System.out.println(str);
}

Object expected = method.invoke(null, args);
Object actual = installed.executeVarargs(args);
Assert.assertEquals(expected, actual);
@@ -24,15 +24,16 @@
/**
* @test
* @requires vm.jvmci
* @requires vm.simpleArch == "x64"
* @requires vm.simpleArch == "x64" | vm.simpleArch == "aarch64"
* @library /
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
* jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.code
* jdk.internal.vm.ci/jdk.vm.ci.code.site
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.aarch64
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java aarch64/AArch64TestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler jdk.vm.ci.code.test.DataPatchTest
*/

@@ -24,15 +24,16 @@
/**
* @test
* @requires vm.jvmci
* @requires vm.simpleArch == "x64"
* @requires vm.simpleArch == "x64" | vm.simpleArch == "aarch64"
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
* jdk.internal.vm.ci/jdk.vm.ci.code
* jdk.internal.vm.ci/jdk.vm.ci.code.site
* jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.common
* jdk.internal.vm.ci/jdk.vm.ci.aarch64
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* @compile CodeInstallationTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java
* @compile CodeInstallationTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java aarch64/AArch64TestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler jdk.vm.ci.code.test.InterpreterFrameSizeTest
*/

@@ -24,16 +24,17 @@
/**
* @test
* @requires vm.jvmci
* @requires vm.simpleArch == "x64"
* @requires vm.simpleArch == "x64" | vm.simpleArch == "aarch64"
* @library /
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
* jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.code
* jdk.internal.vm.ci/jdk.vm.ci.code.site
* jdk.internal.vm.ci/jdk.vm.ci.common
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.aarch64
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java aarch64/AArch64TestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler jdk.vm.ci.code.test.MaxOopMapStackOffsetTest
*/

@@ -24,16 +24,17 @@
/**
* @test
* @requires vm.jvmci
* @requires vm.simpleArch == "x64"
* @requires vm.simpleArch == "x64" | vm.simpleArch == "aarch64"
* @library /test/lib /
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
* jdk.internal.vm.ci/jdk.vm.ci.code
* jdk.internal.vm.ci/jdk.vm.ci.code.site
* jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.common
* jdk.internal.vm.ci/jdk.vm.ci.aarch64
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* @compile CodeInstallationTest.java TestHotSpotVMConfig.java NativeCallTest.java TestAssembler.java amd64/AMD64TestAssembler.java
* @compile CodeInstallationTest.java TestHotSpotVMConfig.java NativeCallTest.java TestAssembler.java amd64/AMD64TestAssembler.java aarch64/AArch64TestAssembler.java
* @run junit/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbootclasspath/a:. jdk.vm.ci.code.test.NativeCallTest
*/
package jdk.vm.ci.code.test;
@@ -24,15 +24,16 @@
/**
* @test
* @requires vm.jvmci
* @requires vm.simpleArch == "x64"
* @requires vm.simpleArch == "x64" | vm.simpleArch == "aarch64"
* @library /
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
* jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.code
* jdk.internal.vm.ci/jdk.vm.ci.code.site
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.aarch64
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java aarch64/AArch64TestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler jdk.vm.ci.code.test.SimpleCodeInstallationTest
*/

@@ -24,15 +24,16 @@
/**
* @test
* @requires vm.jvmci
* @requires vm.simpleArch == "x64"
* @requires vm.simpleArch == "x64" | vm.simpleArch == "aarch64"
* @library /
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
* jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.code
* jdk.internal.vm.ci/jdk.vm.ci.code.site
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.aarch64
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java aarch64/AArch64TestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler jdk.vm.ci.code.test.SimpleDebugInfoTest
*/

@@ -24,15 +24,16 @@
/**
* @test
* @requires vm.jvmci
* @requires vm.simpleArch == "x64"
* @requires vm.simpleArch == "x64" | vm.simpleArch == "aarch64"
* @library /
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
* jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.code
* jdk.internal.vm.ci/jdk.vm.ci.code.site
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.aarch64
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java aarch64/AArch64TestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler jdk.vm.ci.code.test.VirtualObjectDebugInfoTest
*/

0 comments on commit 4169d96

Please sign in to comment.