Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gluon-bot committed Oct 3, 2023
2 parents e499223 + ab85b49 commit 5e44e7a
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 35 deletions.
24 changes: 21 additions & 3 deletions ci/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ local common_json = import "../common.json";
# ***************
local variants(name) = [name, name + "Debug", name + "-llvm"],
# gets the JDK major version from a labsjdk version string (e.g., "ce-21+35-jvmci-23.1-b15" -> 21)
local parse_labsjdk_version(version) =
local parse_labsjdk_version(jdk) =
if jdk.name == "jpg-jdk" then jdk.version else
local version = jdk.version;
assert std.startsWith(version, "ce-") || std.startsWith(version, "ee-") : "Unsupported labsjdk version: " + version;
local number_prefix(str) =
if std.length(str) == 0 || std.length(std.findSubstr(str[0], "0123456789")) == 0 then
Expand All @@ -35,6 +37,12 @@ local common_json = import "../common.json";
;
std.parseInt(number_prefix(version[3:]))
,
# gets the build_id from a labsjdk version string (e.g., "ce-21+35-jvmci-23.1-b15" -> 21)
local get_labsjdk_build_id(jdk) =
local _parts = std.split(jdk.version, "-");
local _version_build_id = std.split(_parts[1], "+");
_version_build_id[1]
,
local jdks_data = {
oraclejdk11: jdk_base + common_json.jdks["oraclejdk11"] + { jdk_version:: 11 },
} + {
Expand All @@ -50,10 +58,18 @@ local common_json = import "../common.json";
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: 21 }
for name in ["oraclejdk21"] + variants("labsjdk-ce-21") + variants("labsjdk-ee-21")
} + {
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: parse_labsjdk_version(self.version), jdk_name:: "jdk-latest"}
for name in variants("labsjdk-ce-latest") + variants("labsjdk-ee-latest")
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: parse_labsjdk_version(self), jdk_name:: "jdk-latest"}
for name in ["oraclejdk-latest"] + variants("labsjdk-ce-latest") + variants("labsjdk-ee-latest")
},
assert std.assertEqual(std.objectFields(common_json.jdks), std.objectFields(jdks_data)),
# Verify oraclejdk-latest and labsjdk-ee-latest versions match
assert
local _labsjdk = common_json.jdks["labsjdk-ee-latest"];
local _oraclejdk = common_json.jdks["oraclejdk-latest"];
local _ov = "ee-%s+%s" % [_oraclejdk.version, _oraclejdk.build_id];
local _lv = _labsjdk.version;
assert std.startsWith(_lv, _ov) : "update oraclejdk-latest to match labsjdk-ee-latest: %s+%s vs %s" % [_oraclejdk.version, _oraclejdk.build_id, _labsjdk.version];
true,

# The raw jdk data, the same as common_json.jdks + { jdk_version:: }
jdks_data: jdks_data,
Expand All @@ -78,6 +94,8 @@ local common_json = import "../common.json";

labsjdkLatestCE: self["labsjdk-ce-21"],
labsjdkLatestEE: self["labsjdk-ee-21"],

oraclejdkLatest: self["oraclejdk-latest"],
},

# The devkits versions reflect those used to build the JVMCI JDKs (e.g., see devkit_platform_revisions in <jdk>/make/conf/jib-profiles.js)
Expand Down
5 changes: 1 addition & 4 deletions ci_includes/publish-javadoc.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

local javadoc_publisher = {
name: 'graal-publish-javadoc-' + utils.prefixed_jdk(self.jdk_version),
environment+: {
JVMCI_VERSION_CHECK: 'ignore',
},
run+: [
["cd", "./sdk"],
["mx", "build"],
Expand Down Expand Up @@ -62,7 +59,7 @@
},

local all_builds = [
common.post_merge + linux_amd64 + common.labsjdk17 + javadoc_publisher,
common.post_merge + linux_amd64 + common.labsjdk21 + javadoc_publisher,
],
// adds a "defined_in" field to all builds mentioning the location of this current file
builds:: [{ defined_in: std.thisFile } + b for b in all_builds]
Expand Down
1 change: 1 addition & 0 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21+35-jvmci-23.1-b15-debug", "platformspecific": true },
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21+35-jvmci-23.1-b15-sulong", "platformspecific": true },

"oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "16", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+16-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+16-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+16-jvmci-b01-sulong", "platformspecific": true },
Expand Down
1 change: 0 additions & 1 deletion docs/reference-manual/native-image/LLVMBackend.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ To enable the LLVM backend, pass the `-H:CompilerBackend=llvm` option to the `na

## Code Generation Options

* `-H:+SpawnIsolates`: enables isolates. (These are disabled by default when using the LLVM backend because they incur a performance penalty.)
* `-H:+BitcodeOptimizations`: enables aggressive optimizations at the LLVM bitcode level. This is experimental and may cause bugs.

## Debugging Options
Expand Down
12 changes: 9 additions & 3 deletions sdk/mx.sdk/mx_sdk_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,12 +1199,13 @@ def _verify_graalvm_configs(args):
parser = ArgumentParser(prog='mx verify-graalvm-configs', description='Verify registered GraalVM configs')
parser.add_argument('--suites', help='comma-separated list of suites')
parser.add_argument('--from', dest='start_from', help='start verification from the indicated env file')
parser.add_argument('--all', dest='all', help='verify all configs, otherwise exit on first error', action='store_true')
args = parser.parse_args(args)
suites = args.suites if args.suites is None else args.suites.split(',')
verify_graalvm_configs(suites=suites, start_from=args.start_from)
verify_graalvm_configs(suites=suites, start_from=args.start_from, check_all=args.all)


def verify_graalvm_configs(suites=None, start_from=None):
def verify_graalvm_configs(suites=None, start_from=None, check_all=False):
"""
Check the consistency of registered GraalVM configs.
:param suites: optionally restrict the check to the configs registered by this list of suites.
Expand All @@ -1217,6 +1218,8 @@ def verify_graalvm_configs(suites=None, start_from=None):
if env_var in child_env:
del child_env[env_var]
started = start_from is None
on_error = mx.warn if check_all else mx.abort
has_errors = False
for dist_name, _, components, suite, env_file in _vm_configs:
if env_file is not False and (suites is None or suite.name in suites):
_env_file = env_file or dist_name
Expand Down Expand Up @@ -1249,7 +1252,8 @@ def verify_graalvm_configs(suites=None, start_from=None):
added = list(got_components_set - components_set)
removed = list(components_set - got_components_set)
diff = ('Added:\n{}\n'.format(added) if added else '') + ('Removed:\n{}\n'.format(removed) if removed else '')
mx.abort("""\
has_errors = True
on_error("""\
Unexpected GraalVM dist name for env file '{}' in suite '{}'.
Expected dist name: '{}'
Actual dist name: '{}'.
Expand All @@ -1258,3 +1262,5 @@ def verify_graalvm_configs(suites=None, start_from=None):
Actual component list:
{}
{}Did you forget to update the registration of the GraalVM config?""".format(_env_file, suite.name, graalvm_dist_name, '\n'.join(out.lines + err.lines), sorted(components), got_components, diff))
if has_errors:
mx.abort("Errors during verification")
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public Collection<AnalysisMethod> getAllCallees() {
}

@Override
public final Collection<AnalysisMethod> getAllComputedCallees() {
public Collection<AnalysisMethod> getCalleesForReturnLinking() {
return getAllCallees();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public final Collection<AnalysisMethod> getAllCallees() {
}

@Override
public final Collection<AnalysisMethod> getAllComputedCallees() {
public final Collection<AnalysisMethod> getCalleesForReturnLinking() {
return getAllCalleesHelper(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ public Collection<AnalysisMethod> getOriginalCallees() {
public abstract Collection<AnalysisMethod> getAllCallees();

/**
* Returns all callees which have been computed for this method. It is possible that these
* callees have yet to have their typeflow created and also they may not be fully linked.
* Returns all callees which have been computed for this method which should be linked to the
* return. It is possible that these callees have yet to have their typeflow created.
*/
public abstract Collection<AnalysisMethod> getAllComputedCallees();
public abstract Collection<AnalysisMethod> getCalleesForReturnLinking();

@Override
public BytecodePosition getPosition() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,14 @@ public void linkActualReturn(PointsToAnalysis bb, boolean isStatic, InvokeTypeFl
* may not be fully linked if they have been {@code DirectInvokeTypeFlow#initializeCallees}
* but not yet processed.
*/
for (AnalysisMethod callee : invoke.getAllComputedCallees()) {
for (AnalysisMethod callee : invoke.getCalleesForReturnLinking()) {
MethodFlowsGraphInfo calleeFlows = ((PointsToAnalysisMethod) callee).getTypeFlow().getOrCreateMethodFlowsGraphInfo(bb, invoke);
invoke.linkReturn(bb, isStatic, calleeFlows);
}
/*
* If the invoke is saturated then we must ensure the actual return is linked to the context
* insensitive invoke.
*/
if (invoke.isSaturated()) {
InvokeTypeFlow contextInsensitiveInvoke = invoke.getTargetMethod().getContextInsensitiveVirtualInvoke(invoke.getCallerMultiMethodKey());
contextInsensitiveInvoke.getActualReturn().addUse(bb, invoke.getActualReturn());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.lang.reflect.Modifier;
import java.util.Collection;
import java.util.Collections;

import com.oracle.graal.pointsto.PointsToAnalysis;
import com.oracle.graal.pointsto.constraints.UnsupportedFeatureException;
Expand Down Expand Up @@ -133,6 +134,10 @@ public void onObservedUpdate(PointsToAnalysis bb) {

@Override
public void onObservedSaturated(PointsToAnalysis bb, TypeFlow<?> observed) {
/* Eagerly ensure context insensitive invoke is created before the saturated flag is set. */
AbstractVirtualInvokeTypeFlow contextInsensitiveInvoke = (AbstractVirtualInvokeTypeFlow) targetMethod.initAndGetContextInsensitiveInvoke(bb, source, false, callerMultiMethodKey);
contextInsensitiveInvoke.addInvokeLocation(getSource());

setSaturated();

/*
Expand Down Expand Up @@ -164,10 +169,6 @@ public void onObservedSaturated(PointsToAnalysis bb, TypeFlow<?> observed) {
}
}

/* Link the saturated invoke. */
AbstractVirtualInvokeTypeFlow contextInsensitiveInvoke = (AbstractVirtualInvokeTypeFlow) targetMethod.initAndGetContextInsensitiveInvoke(bb, source, false, callerMultiMethodKey);
contextInsensitiveInvoke.addInvokeLocation(getSource());

/*
* Link the call site actual parameters to the saturated invoke actual parameters. The
* receiver is already set in the saturated invoke.
Expand Down Expand Up @@ -214,6 +215,15 @@ public Collection<AnalysisMethod> getAllCallees() {
}
}

public Collection<AnalysisMethod> getCalleesForReturnLinking() {
if (isSaturated()) {
/* If the invoke has saturated, then it is not necessary to link the callees. */
return Collections.emptyList();
} else {
return super.getAllCallees();
}
}

@Override
public Collection<MethodFlowsGraph> getAllNonStubCalleesFlows(PointsToAnalysis bb) {
return DefaultInvokeTypeFlowUtil.getAllNonStubCalleesFlows(this);
Expand Down
2 changes: 1 addition & 1 deletion vm/mx.vm/ce-complete
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DYNAMIC_IMPORTS=/compiler,/espresso,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,/wasm,fastr,graalpython,truffleruby
COMPONENTS=antlr4,cmp,cov,dap,ellvm,ejvm,gu,gvm,gwa,icu4j,ins,insight,insightheap,java,js,jsl,jss,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,nfi,ni,nic,nil,njs,njsl,poly,polynative,pro,pyn,pynl,R,rby,rbyl,rgx,sdk,sdkl,svm,svmt,svml,svmnfi,svmsl,tfl,tfla,tflc,tflm,truffle-json,vvm
COMPONENTS=antlr4,cmp,cov,dap,ellvm,ejvm,gu,gvm,gwa,icu4j,xz,ins,insight,insightheap,java,js,jsl,jss,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,nfi,ni,nic,nil,njs,njsl,poly,polynative,pro,pyn,pynl,R,rby,rbyl,rgx,sdk,sdkl,svm,svmt,svml,svmnfi,svmsl,tfl,tfla,tflc,tflm,truffle-json,vvm
NATIVE_IMAGES=lib:pythonvm,graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-flang,graalvm-native-ld,lib:jsvm,lib:javavm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lib:llvmvm,native-image,lib:rubyvm,lib:wasmvm,graalpy-polyglot-get
DISABLE_INSTALLABLES=false
2 changes: 1 addition & 1 deletion vm/mx.vm/ce-darwin-complete
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DYNAMIC_IMPORTS=/compiler,/espresso,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,/wasm,fastr,graalpython,truffleruby
COMPONENTS=antlr4,cmp,cov,dap,ellvm,ejvm,gu,gvm,gwa,icu4j,ins,insight,insightheap,java,js,jsl,jss,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,nfi,ni,nic,nil,njs,njsl,poly,polynative,pro,pyn,pynl,R,rby,rbyl,rgx,sdk,sdkl,svm,svmt,svml,svmnfi,svmsl,tfl,tfla,tflc,tflm,truffle-json,vvm
COMPONENTS=antlr4,cmp,cov,dap,ellvm,ejvm,gu,gvm,gwa,icu4j,xz,ins,insight,insightheap,java,js,jsl,jss,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,nfi,ni,nic,nil,njs,njsl,poly,polynative,pro,pyn,pynl,R,rby,rbyl,rgx,sdk,sdkl,svm,svmt,svml,svmnfi,svmsl,tfl,tfla,tflc,tflm,truffle-json,vvm
NATIVE_IMAGES=lib:pythonvm,graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-flang,graalvm-native-ld,lib:jsvm,lib:javavm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lib:llvmvm,native-image,lib:rubyvm,lib:wasmvm,graalpy-polyglot-get
DISABLE_INSTALLABLES=false
7 changes: 3 additions & 4 deletions vm/mx.vm/ce-python
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Do not modify this env file without updating the Graal.Python benchmark builders
DYNAMIC_IMPORTS=/compiler,/graal-js,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,graalpython
COMPONENTS=antlr4,cmp,cov,dap,dis,gu,gvm,icu4j,ins,insight,insightheap,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,pbm,pmh,poly,polynative,pro,pyn,pynl,rgx,sdk,sdkl,tfl,tfla,tflc,tflm,truffle-json
NATIVE_IMAGES=lib:pythonvm,lib:jvmcicompiler,graalpy-polyglot-get
DYNAMIC_IMPORTS=/compiler,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,graalpython
COMPONENTS=antlr4,cmp,cov,dap,dis,gu,gvm,icu4j,xz,ins,insight,insightheap,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,pbm,pmh,poly,polynative,pro,pyn,pynl,rgx,sdk,sdkl,tfl,tfla,tflc,tflm,truffle-json
NATIVE_IMAGES=lib:pythonvm,lib:jvmcicompiler,graalpy-polyglot-get,graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-flang,graalvm-native-ld
DISABLE_INSTALLABLES=False
Loading

0 comments on commit 5e44e7a

Please sign in to comment.