Skip to content

Commit

Permalink
[GR-10195] Adopt libgraal JVMCI API changes.
Browse files Browse the repository at this point in the history
PullRequest: graal/1617
  • Loading branch information
dougxc committed Jul 3, 2018
2 parents 80a90ba + 49889ce commit 9423a9e
Show file tree
Hide file tree
Showing 166 changed files with 915 additions and 897 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jdk:

env:
global:
- JVMCI_VERSION="jvmci-0.45"
- JVMCI_VERSION="jvmci-0.46"
- JDK8_UPDATE_VERSION="172"
matrix:
- JDK="jdk8" GATE="style,fullbuild"
Expand Down
19 changes: 8 additions & 11 deletions common.hocon
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ overlay = 1deeaf6e01f16b72271b066cfc8d73d8ab3977d9
# openjdk8 JDKs on Linux are built by Oracle Labs
# openjdk8 JDKs on macOS are based on AdoptOpenJDK binaries
jdks: {
labsjdk8: {name : labsjdk, version : "8u172-jvmci-0.45", platformspecific: true}
openjdk8: {name : openjdk, version : "8u172-jvmci-0.45", platformspecific: true}
labsjdk8Debug: {name : labsjdk, version : "8u172-jvmci-0.45-fastdebug", platformspecific: true}
oraclejdk9: {name : oraclejdk, version : "9.0.4+11", platformspecific: true}
oraclejdk10: {name : oraclejdk, version : "10+46", platformspecific: true}
labsjdk8: {name : labsjdk, version : "8u172-jvmci-0.46", platformspecific: true}
openjdk8: {name : openjdk, version : "8u172-jvmci-0.46", platformspecific: true}
labsjdk8Debug: {name : labsjdk, version : "8u172-jvmci-0.46-fastdebug", platformspecific: true}
oraclejdk11: {name : oraclejdk, version : "11+20", platformspecific: true}

# Snapshot of http://hg.openjdk.java.net/jdk/jdk
oraclejdkSNAPSHOT : {name : labsjdk, version : "20180618-110011", platformspecific: true}
oraclejdkSNAPSHOT : {name : labsjdk, version : "20180629-011203", platformspecific: true}

}

Expand All @@ -25,14 +24,12 @@ mx : {
}
}

labsjdk8 : { downloads : { JAVA_HOME : ${jdks.labsjdk8}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.oraclejdk9} ]} }}
labsjdk8Debug : { downloads : { JAVA_HOME : ${jdks.labsjdk8Debug}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.oraclejdk9} ]} }}
labsjdk8 : { downloads : { JAVA_HOME : ${jdks.labsjdk8}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.oraclejdk11} ]} }}
labsjdk8Debug : { downloads : { JAVA_HOME : ${jdks.labsjdk8Debug}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.oraclejdk11} ]} }}

openjdk8 : { downloads : { JAVA_HOME : ${jdks.openjdk8} }}

oraclejdk9 : { downloads : { JAVA_HOME : ${jdks.oraclejdk9}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.labsjdk8} ]} }}
oraclejdk10 : { downloads : { JAVA_HOME : ${jdks.oraclejdk10}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.labsjdk8}, ${jdks.oraclejdk9} ]} }}
oraclejdk11 : { downloads : { JAVA_HOME : ${jdks.oraclejdkSNAPSHOT}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.labsjdk8}, ${jdks.oraclejdk10} ]} }}
oraclejdk11 : { downloads : { JAVA_HOME : ${jdks.oraclejdk11}, EXTRA_JAVA_HOMES : { pathlist :[ ${jdks.labsjdk8} ]} }}

common : ${mx} {
timelimit : "30:00"
Expand Down
12 changes: 6 additions & 6 deletions compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ git clone https://github.com/graalvm/mx.git
export PATH=$PWD/mx:$PATH
```

Graal depends on a JDK that supports JVMCI ([JVM Compiler Interface](https://bugs.openjdk.java.net/browse/JDK-8062493)). There is a JVMCI
[port](https://github.com/graalvm/graal-jvmci-8) for JDK 8 and JVMCI is built into the JDK as of JDK 9.
Graal depends on a JDK that supports a compatible version of JVMCI ([JVM Compiler Interface](https://bugs.openjdk.java.net/browse/JDK-8062493)). There is a JVMCI
[port](https://github.com/graalvm/graal-jvmci-8) for JDK 8 and the required JVMCI version is built into the JDK as of JDK 11-ea+20.

Graal currently requires a JVMCI-enabled JDK 8 (download from [OTN](http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html) or [build](#building-jvmci-jdk8) yourself) and will do so until all JDK 8 specific Graal code is factored out as [versioned sources](https://github.com/graalvm/mx#versioning-sources-for-different-jdk-releases).
Developing versioned sources specific to other JDKs requires them to be made
available on the `EXTRA_JAVA_HOMES` environment variable. At the time of writing, this means JDK 9
and JDK 11 ([early access builds](http://jdk.java.net/11/) should work but a build from
available on the `EXTRA_JAVA_HOMES` environment variable. At the time of writing, this
JDK 11-ea+20 ([early access build](http://jdk.java.net/11/) should work but a build from
the [latest bits](http://hg.openjdk.java.net/jdk/jdk/) is required if Graal targets features not yet in an early access build).

Here is a typical set up for specifying multiple JDKs on Linux:
```
export JAVA_HOME=/usr/lib/jvm/labsjdk1.8.0_172-jvmci-0.44
export EXTRA_JAVA_HOMES=/usr/lib/jvm/jdk-9.0.4:/usr/lib/jvm/jdk-11
export EXTRA_JAVA_HOMES=/usr/lib/jvm/jdk-11
```
And on macOS:
```
export JAVA_HOME=/Library/Java/JavaVirtualMachines/labsjdk1.8.0_172-jvmci-0.44/Contents/Home
export EXTRA_JAVA_HOMES=/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home:/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
export EXTRA_JAVA_HOMES=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
```
If you omit `EXTRA_JAVA_HOMES`, the associated sources will not be built. Note that `JAVA_HOME` defines the *primary* JDK for development. For instance, when running `mx vm`, this is the JDK that will be used so if you want to run on JDK 11, swap JDK 8 and JDK 11 in `JAVA_HOME` and `EXTRA_JAVA_HOMES`.

Expand Down
10 changes: 0 additions & 10 deletions compiler/ci_common/gate_tasks.hocon
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,17 @@ builds += [
# Darwin AMD64
${gateTest} ${labsjdk8} ${gateDarwinAMD64} {name: "weekly-test-compiler-test-8-darwin-amd64"} ${graalWeekly}
${gateTest} ${openjdk8} ${gateDarwinAMD64} {name: "weekly-test-compiler-test-openjdk8-darwin-amd64"} ${graalWeekly}
${gateTest} ${oraclejdk9} ${gateDarwinAMD64} {name: "weekly-test-compiler-test-9-darwin-amd64"} ${graalWeekly}
${gateTest} ${oraclejdk10} ${gateDarwinAMD64} {name: "weekly-test-compiler-test-10-darwin-amd64"} ${graalWeekly}
${gateTest} ${oraclejdk11} ${gateDarwinAMD64} {name: "weekly-test-compiler-test-11-darwin-amd64"} ${graalWeekly}
# ${gateTestBenchmark} ${labsjdk8} ${gateDarwinAMD64} {name: "weekly-test-compiler-benchmarktest-8-darwin-amd64"} ${graalWeekly}

# Linux AMD64
${gateTest} ${labsjdk8} ${gateLinuxAMD64} {name: "gate-compiler-test-8-linux-amd64"}
${gateTest} ${openjdk8} ${gateLinuxAMD64} {name: "weekly-test-compiler-test-openjdk8-linux-amd64"} ${graalWeekly}
${gateTestMaxVS} ${labsjdk8} ${gateLinuxAMD64} {name: "weekly-test-compiler-test-8-linux-amd64-maxvectorsize"} ${graalWeekly}
${gateTest} ${oraclejdk9} ${gateLinuxAMD64} {name: "weekly-test-compiler-test-9-linux-amd64"} ${graalWeekly} {capabilities: ${gateLinuxAMD64.capabilities} ["!x4150"]}
${gateTest} ${oraclejdk10} ${gateLinuxAMD64} {name: "weekly-test-compiler-test-10-linux-amd64"} ${graalWeekly} {capabilities: ${gateLinuxAMD64.capabilities} ["!x4150"]}
${gateTest} ${oraclejdk11} ${gateLinuxAMD64} {name: "gate-compiler-test-11-linux-amd64"} {capabilities: ${gateLinuxAMD64.capabilities} ["!x4150"]}
${gateJavaBaseTest} ${oraclejdk11} ${gateLinuxAMD64} {name: "weekly-test-compiler-javabasetest-11-linux-amd64"} ${graalWeekly} {capabilities: ${gateLinuxAMD64.capabilities} ["!x4150"]}
${gateTestCTW} ${labsjdk8} ${gateLinuxAMD64} {name: "gate-compiler-ctw-8-linux-amd64"}
${gateTestCTW} ${openjdk8} ${gateLinuxAMD64} {name: "weekly-test-compiler-ctw-openjdk8-linux-amd64"} ${graalWeekly}
${gateTestCTW} ${oraclejdk9} ${gateLinuxAMD64} {name: "weekly-test-compiler-ctw-9-linux-amd64"} ${graalWeekly}
${gateTestCTW} ${oraclejdk10} ${gateLinuxAMD64} {name: "weekly-test-compiler-ctw-10-linux-amd64"} ${graalWeekly}
${gateTestCTW} ${oraclejdk11} ${gateLinuxAMD64} {name: "weekly-test-compiler-ctw-11-linux-amd64"} ${graalWeekly}
${gateTest} ${labsjdk8Debug} ${gateLinuxAMD64} {name: "weekly-test-compiler-test-8-linux-amd64-fastdebug", timelimit: "1:50:00"} ${graalWeekly}
${gateTestBenchmark} ${labsjdk8} ${gateLinuxAMD64} {name: "gate-compiler-benchmarktest-8-linux-amd64"}
Expand All @@ -29,12 +23,8 @@ builds += [

# Solaris SPARC
${gateTest} ${labsjdk8} ${gateSolarisSPARC} {name: "gate-compiler-test-8-solaris-sparcv9", timelimit: "1:00:00"}
${gateTest} ${oraclejdk9} ${gateSolarisSPARC} {name: "weekly-test-compiler-test-9-solaris-sparcv9", timelimit: "1:50:00"} ${graalWeekly}
${gateTest} ${oraclejdk10} ${gateSolarisSPARC} {name: "weekly-test-compiler-test-10-solaris-sparcv9", timelimit: "1:50:00"} ${graalWeekly}
${gateTest} ${oraclejdk11} ${gateSolarisSPARC} {name: "gate-compiler-test-11-solaris-sparcv9", timelimit: "1:00:00"}
${gateTestCTW} ${labsjdk8} ${gateSolarisSPARC} {name: "gate-compiler-ctw-8-solaris-sparcv9", timelimit: "1:00:00"}
${gateTestCTW} ${oraclejdk9} ${gateSolarisSPARC} {name: "weekly-test-compiler-ctw-9-solaris-sparcv9", timelimit: "1:50:00"} ${graalWeekly}
${gateTestCTW} ${oraclejdk10} ${gateSolarisSPARC} {name: "weekly-test-compiler-ctw-10-solaris-sparcv9", timelimit: "1:50:00"} ${graalWeekly}
${gateTestCTW} ${oraclejdk11} ${gateSolarisSPARC} {name: "weekly-test-compiler-ctw-11-solaris-sparcv9", timelimit: "1:50:00"} ${graalWeekly}
${gateTest} ${labsjdk8Debug} ${gateSolarisSPARC} {name: "weekly-test-compiler-test-8-solaris-sparcv9-fastdebug", timelimit: "1:50:00"} ${graalWeekly}
${gateTestBenchmark} ${labsjdk8} ${gateSolarisSPARC} {name: "gate-compiler-benchmarktest-8-solaris-sparcv9", timelimit: "1:00:00"}
Expand Down
7 changes: 1 addition & 6 deletions compiler/ci_common/gate_tasks_bootstrap.hocon
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@
builds += [
# Darwin AMD64
${gateBootstrapLite} ${labsjdk8} ${gateDarwinAMD64Bootstrap} {name: "gate-compiler-bootstraplite-8-darwin-amd64"}
${gateBootstrapLite} ${oraclejdk9} ${gateDarwinAMD64Bootstrap} {name: "weekly-test-compiler-bootstraplite-9-darwin-amd64"} ${graalWeekly}
${gateBootstrapLite} ${oraclejdk10} ${gateDarwinAMD64Bootstrap} {name: "weekly-test-compiler-bootstraplite-10-darwin-amd64"} ${graalWeekly}
${gateBootstrapLite} ${oraclejdk11} ${gateDarwinAMD64Bootstrap} {name: "weekly-test-compiler-bootstraplite-11-darwin-amd64"} ${graalWeekly}

# Linux AMD64
${gateBootstrap} ${labsjdk8} ${gateLinuxAMD64Bootstrap} {name: "gate-compiler-bootstrap-8-linux-amd64"}
${gateBootstrapFullVerify} ${labsjdk8} ${gateLinuxAMD64Bootstrap} {name: "gate-compiler-bootstrapfullverify-8-linux-amd64"}
${gateBootstrap} ${oraclejdk9} ${gateLinuxAMD64Bootstrap} {name: "weekly-test-compiler-bootstrap-9-linux-amd64"} ${graalWeekly}
${gateBootstrap} ${oraclejdk10} ${gateLinuxAMD64Bootstrap} {name: "weekly-test-compiler-bootstrap-10-linux-amd64"} ${graalWeekly}
${gateBootstrap} ${oraclejdk11} ${gateLinuxAMD64Bootstrap} {name: "gate-compiler-bootstrap-11-linux-amd64"}

# Solaris SPARC
${gateBootstrap} ${labsjdk8} ${gateSolarisSPARCBootstrap} {name: "gate-compiler-bootstrap-8-solaris-sparcv9", timelimit: "1:00:00"}
${gateBootstrap} ${oraclejdk9} ${gateSolarisSPARCBootstrap} {name: "weekly-test-compiler-bootstrap-9-solaris-sparcv9", timelimit: "1:00:00"} ${graalWeekly}
${gateBootstrap} ${oraclejdk10} ${gateSolarisSPARCBootstrap} {name: "weekly-test-compiler-bootstrap-10-solaris-sparcv9", timelimit: "1:00:00"} ${graalWeekly}
${gateBootstrap} ${oraclejdk11} ${gateSolarisSPARCBootstrap} {name: "weekly-test-compiler-bootstrap-11-solaris-sparcv9", timelimit: "1:00:00"} ${graalWeekly}

# Linux SPARC
${gateBootstrap} ${labsjdk8} ${gateLinuxSPARCBootstrap} {name: "weekly-test-compiler-bootstrap-labsjdk8-linux-sparcv9", timelimit: "1:00:00"} ${graalWeekly}
Expand Down
1 change: 0 additions & 1 deletion compiler/mx.compiler/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,6 @@
"jdk.tools.jaotc.binformat",
"org.graalvm.compiler.asm.amd64",
"org.graalvm.compiler.asm.aarch64",
"org.graalvm.compiler.hotspot",
],

"checkstyle" : "org.graalvm.compiler.graph",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,22 @@ public final class BinaryContainer implements SymbolTable {
*/
private static final HashMap<String, String> functionNamesToAOTSymbols = new HashMap<>();

//@formatter:off
private static final String[][] map = {
//@formatter:off
{"CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", "_aot_deopt_blob_unpack"},
{"CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", "_aot_deopt_blob_uncommon_trap"},
{"CompilerToVM::Data::SharedRuntime_ic_miss_stub", "_aot_ic_miss_stub"},
{"CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", "_aot_handle_wrong_method_stub"},
{"SharedRuntime::exception_handler_for_return_address", "_aot_exception_handler_for_return_address"},
{"SharedRuntime::register_finalizer", "_aot_register_finalizer"},
{"SharedRuntime::OSR_migration_end", "_aot_OSR_migration_end"},
{"CompilerRuntime::resolve_dynamic_invoke", "_aot_resolve_dynamic_invoke"},
{"CompilerRuntime::resolve_string_by_symbol", "_aot_resolve_string_by_symbol"},
{"CompilerRuntime::resolve_klass_by_symbol", "_aot_resolve_klass_by_symbol"},
{"CompilerRuntime::resolve_method_by_symbol_and_load_counters","_aot_resolve_method_by_symbol_and_load_counters"},
{"CompilerRuntime::initialize_klass_by_symbol", "_aot_initialize_klass_by_symbol"},
{"CompilerRuntime::invocation_event", "_aot_invocation_event"},
{"CompilerRuntime::backedge_event", "_aot_backedge_event"},
{"CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", "_aot_deopt_blob_unpack"},
{"CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", "_aot_deopt_blob_uncommon_trap"},
{"CompilerToVM::Data::SharedRuntime_ic_miss_stub", "_aot_ic_miss_stub"},
{"CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", "_aot_handle_wrong_method_stub"},
{"SharedRuntime::exception_handler_for_return_address", "_aot_exception_handler_for_return_address"},
{"SharedRuntime::register_finalizer", "_aot_register_finalizer"},
{"SharedRuntime::OSR_migration_end", "_aot_OSR_migration_end"},
{"CompilerRuntime::resolve_dynamic_invoke", "_aot_resolve_dynamic_invoke"},
{"CompilerRuntime::resolve_string_by_symbol", "_aot_resolve_string_by_symbol"},
{"CompilerRuntime::resolve_klass_by_symbol", "_aot_resolve_klass_by_symbol"},
{"CompilerRuntime::resolve_method_by_symbol_and_load_counters", "_aot_resolve_method_by_symbol_and_load_counters"},
{"CompilerRuntime::initialize_klass_by_symbol", "_aot_initialize_klass_by_symbol"},
{"CompilerRuntime::invocation_event", "_aot_invocation_event"},
{"CompilerRuntime::backedge_event", "_aot_backedge_event"},

{"CompilerToVM::Data::dpow", "_aot_shared_runtime_dpow"},
{"CompilerToVM::Data::dexp", "_aot_shared_runtime_dexp"},
Expand Down Expand Up @@ -215,6 +215,7 @@ public final class BinaryContainer implements SymbolTable {

{"StubRoutines::_counterMode_AESCrypt", "_aot_stub_routines_counterMode_AESCrypt" },
{"StubRoutines::_ghash_processBlocks", "_aot_stub_routines_ghash_processBlocks" },
{"StubRoutines::_base64_encodeBlock", "_aot_stub_routines_base64_encodeBlock" },
{"StubRoutines::_crc32c_table_addr", "_aot_stub_routines_crc32c_table_addr" },
{"StubRoutines::_updateBytesCRC32C", "_aot_stub_routines_updateBytesCRC32C" },
{"StubRoutines::_updateBytesAdler32", "_aot_stub_routines_updateBytesAdler32" },
Expand Down Expand Up @@ -256,8 +257,8 @@ public final class BinaryContainer implements SymbolTable {

{"JVMCIRuntime::vm_error", "_aot_jvmci_runtime_vm_error"},
{"JVMCIRuntime::new_array", "_aot_jvmci_runtime_new_array"}
//@formatter:on
};
//@formatter:on

static {
for (String[] entry : map) {
Expand Down Expand Up @@ -320,6 +321,7 @@ public BinaryContainer(OptionValues graalOptions, GraalHotSpotVMConfig graalHotS
}

private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig) {
// @Checkstyle: stop
// @formatter:off
boolean[] booleanFlags = { graalHotSpotVMConfig.cAssertions, // Debug VM
graalHotSpotVMConfig.useCompressedOops,
Expand All @@ -343,6 +345,7 @@ private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, Grap
graalHotSpotVMConfig.codeSegmentSize,
};
// @formatter:on
// @Checkstyle: resume

byte[] booleanFlagsAsBytes = flagsToByteArray(booleanFlags);
int size0 = configContainer.getByteStreamSize();
Expand Down Expand Up @@ -541,8 +544,9 @@ public void createBinary(String outputFileName) throws IOException {
JPECoffRelocObject pecoffobj = new JPECoffRelocObject(this, outputFileName);
pecoffobj.createPECoffRelocObject(relocationTable, symbolTable.values());
break;
} else
} else {
throw new InternalError("Unsupported platform: " + osName);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import jdk.tools.jaotc.binformat.Symbol.Binding;
import jdk.tools.jaotc.binformat.Symbol.Kind;
import jdk.tools.jaotc.binformat.Container;

import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
package jdk.tools.jaotc.binformat;

/**
* This class represents ia native OS specific Symbol
* This class represents a native OS specific Symbol.
*/
public abstract class NativeSymbol {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

public final class Relocation {

public enum RelocType
{
// @formatter:off (workaround for Eclipse formatting bug)
public enum RelocType {
UNDEFINED,
JAVA_CALL_INDIRECT,
JAVA_CALL_DIRECT,
Expand All @@ -38,6 +38,7 @@ public enum RelocType
EXTERNAL_GOT_TO_PLT,
EXTERNAL_PLT_TO_GOT
}
// @formatter:on

private final RelocType type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,23 @@

import java.util.Objects;

import jdk.tools.jaotc.binformat.NativeSymbol;

public class Symbol {

public enum Binding
{
// @formatter:off (workaround for Eclipse formatting bug)
public enum Binding {
UNDEFINED,
LOCAL,
GLOBAL
}

public enum Kind
{
public enum Kind {
UNDEFINED,
NATIVE_FUNCTION,
JAVA_FUNCTION,
OBJECT,
NOTYPE
}
// @formatter:on

private final String name;
private final int size;
Expand Down
Loading

0 comments on commit 9423a9e

Please sign in to comment.