Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sdk/mx.sdk/mx_sdk_vm_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,9 +1308,10 @@ def contents(self):
'--no-fallback',
'-march=compatibility', # Target maximum portability of all GraalVM images.
'-H:+AssertInitializationSpecifiedForAllClasses',
'-H:+EnforceMaxRuntimeCompileMethods',
'-Dorg.graalvm.version={}'.format(_suite.release_version()),
]
if has_component('LibGraal'):
build_args += ['-H:+EnforceMaxRuntimeCompileMethods']
if _debug_images():
build_args += ['-ea', '-O0', '-H:+PreserveFramePointer', '-H:-DeleteLocalSymbols']
if _get_svm_support().generate_debug_info(image_config):
Expand Down
4 changes: 3 additions & 1 deletion substratevm/mx.substratevm/mx_substratevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ def vm_executable_path(executable, config=None):
@contextmanager
def native_image_context(common_args=None, hosted_assertions=True, native_image_cmd='', config=None, build_if_missing=False):
common_args = [] if common_args is None else common_args
base_args = ['--no-fallback', '-H:+EnforceMaxRuntimeCompileMethods', '-H:+ReportExceptionStackTraces']
base_args = ['--no-fallback', '-H:+ReportExceptionStackTraces']
if mx_sdk_vm_impl.has_component('LibGraal'):
base_args += ['-H:+EnforceMaxRuntimeCompileMethods']
base_args += ['-H:Path=' + svmbuild_dir()]
if mx.get_opts().verbose:
base_args += ['--verbose']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ public List<Path> getBuilderModulePath() {
if (libJvmciDir != null) {
result.addAll(getJars(libJvmciDir, "graal-sdk", "enterprise-graal"));
}
result.addAll(getJars(rootDir.resolve(Paths.get("lib", "truffle")), "truffle-api", "truffle-compiler", "truffle-runtime", "truffle-enterprise"));
result.addAll(getJars(rootDir.resolve(Paths.get("lib", "truffle")), true, "truffle-api", "truffle-compiler", "truffle-runtime", "truffle-enterprise"));
if (modulePathBuild) {
result.addAll(getJars(rootDir.resolve(Paths.get("lib", "svm", "builder"))));
}
Expand Down Expand Up @@ -2044,6 +2044,10 @@ private static void show(Consumer<String> printFunc, String message) {
}

protected static List<Path> getJars(Path dir, String... jarBaseNames) {
return getJars(dir, false, jarBaseNames);
}

private static List<Path> getJars(Path dir, boolean optional, String... jarBaseNames) {
try {
List<String> baseNameList = Arrays.asList(jarBaseNames);
return Files.list(dir)
Expand All @@ -2061,7 +2065,12 @@ protected static List<Path> getJars(Path dir, String... jarBaseNames) {
})
.collect(Collectors.toList());
} catch (IOException e) {
throw showError("Unable to use jar-files from directory " + dir, e);
if (optional) {
LogUtils.warning("Unable to use jar-files from directory " + dir);
return Collections.emptyList();
} else {
throw showError("Unable to use jar-files from directory " + dir, e);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@

/**
* A helper to pass information for installing code in the compilation client through a Truffle
* compilation. It does not implement {@link InstalledCode} or {@link OptimizedAssumptionDependency}
* in any meaningful way.
* compilation. It does not implement {@link InstalledCode} in any meaningful way.
*/
public final class IsolatedCodeInstallBridge extends InstalledCode implements OptimizedAssumptionDependency {
public class IsolatedCodeInstallBridge extends InstalledCode {
private final ClientHandle<? extends SubstrateInstalledCode.Factory> factoryHandle;
private ClientHandle<? extends SubstrateInstalledCode> installedCodeHandle;

Expand All @@ -58,7 +57,7 @@ public ClientHandle<? extends SubstrateInstalledCode> getSubstrateInstalledCodeH
return installedCodeHandle;
}

private static final String DO_NOT_CALL_REASON = IsolatedCodeInstallBridge.class.getSimpleName() +
protected static final String DO_NOT_CALL_REASON = IsolatedCodeInstallBridge.class.getSimpleName() +
" only acts as an accessor for cross-isolate data. None of the implemented methods may be called.";

@Override
Expand Down Expand Up @@ -86,19 +85,9 @@ public byte[] getCode() {
throw VMError.shouldNotReachHere(DO_NOT_CALL_REASON);
}

@Override
public void onAssumptionInvalidated(Object source, CharSequence reason) {
throw VMError.shouldNotReachHere(DO_NOT_CALL_REASON);
}

@Override
public Object executeVarargs(Object... args) {
throw VMError.shouldNotReachHere(DO_NOT_CALL_REASON);
}

@Override
public TruffleCompilable getCompilable() {
throw VMError.shouldNotReachHere(DO_NOT_CALL_REASON);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import com.oracle.svm.graal.isolated.ClientIsolateThread;
import com.oracle.svm.graal.isolated.CompilerHandle;
import com.oracle.svm.graal.isolated.CompilerIsolateThread;
import com.oracle.svm.graal.isolated.IsolatedCodeInstallBridge;
import com.oracle.svm.graal.isolated.IsolatedCompileClient;
import com.oracle.svm.graal.isolated.IsolatedCompileContext;
import com.oracle.svm.graal.isolated.IsolatedObjectConstant;
Expand Down Expand Up @@ -138,7 +137,7 @@ public SubstrateInstalledCode createSubstrateInstalledCode() {

@Override
public InstalledCode createPreliminaryInstalledCode() {
return new IsolatedCodeInstallBridge(handle);
return new IsolatedTruffleCodeInstallBridge(handle);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2022, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2022, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.truffle.isolated;

import com.oracle.svm.core.deopt.SubstrateInstalledCode;
import com.oracle.svm.core.util.VMError;
import com.oracle.svm.graal.isolated.ClientHandle;
import com.oracle.svm.graal.isolated.IsolatedCodeInstallBridge;
import jdk.vm.ci.code.InstalledCode;
import org.graalvm.compiler.truffle.common.OptimizedAssumptionDependency;
import org.graalvm.compiler.truffle.common.TruffleCompilable;

/**
* A helper to pass information for installing code in the compilation client through a Truffle
* compilation. It does not implement {@link InstalledCode} or {@link OptimizedAssumptionDependency}
* in any meaningful way.
*/
public final class IsolatedTruffleCodeInstallBridge extends IsolatedCodeInstallBridge implements OptimizedAssumptionDependency {
public IsolatedTruffleCodeInstallBridge(ClientHandle<? extends SubstrateInstalledCode.Factory> factoryHandle) {
super(factoryHandle);
}

@Override
public void onAssumptionInvalidated(Object source, CharSequence reason) {
throw VMError.shouldNotReachHere(DO_NOT_CALL_REASON);
}

@Override
public TruffleCompilable getCompilable() {
throw VMError.shouldNotReachHere(DO_NOT_CALL_REASON);
}
}