From 82d5c790219786ada41b8edd1f2b2e9668214b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=C2=B2=20Peterssen?= Date: Tue, 22 Feb 2022 15:27:17 +0100 Subject: [PATCH 1/5] Deep-rename libespresso to libjavavm. --- espresso/mx.espresso/mx_espresso.py | 28 ++-- espresso/mx.espresso/native-ce | 4 +- espresso/mx.espresso/native-ee | 4 +- espresso/mx.espresso/suite.py | 6 +- .../espresso/libjavavm}/Arguments.java | 12 +- .../espresso/libjavavm}/LibEspresso.java | 16 +-- .../truffle/espresso/libjavavm}/OS.java | 2 +- .../arghelper/ArgumentsHandler.java | 10 +- .../arghelper/ModulePropertyCounter.java | 4 +- .../espresso/libjavavm}/arghelper/Native.java | 8 +- .../libjavavm}/arghelper/PolyglotArgs.java | 8 +- .../jniapi/JNIArrayReleaseModes.java | 2 +- .../libjavavm}/jniapi/JNIEnvironment.java | 2 +- .../jniapi/JNIEnvironmentPointer.java | 2 +- .../espresso/libjavavm}/jniapi/JNIErrors.java | 2 +- .../libjavavm}/jniapi/JNIFieldId.java | 2 +- .../jniapi/JNIFunctionPointerTypes.java | 2 +- .../jniapi/JNIHeaderDirectives.java | 4 +- .../libjavavm}/jniapi/JNIInvokeInterface.java | 10 +- .../espresso/libjavavm}/jniapi/JNIJavaVM.java | 2 +- .../jniapi/JNIJavaVMAttachArgs.java | 2 +- .../libjavavm}/jniapi/JNIJavaVMInitArgs.java | 2 +- .../libjavavm}/jniapi/JNIJavaVMOption.java | 2 +- .../libjavavm}/jniapi/JNIJavaVMPointer.java | 2 +- .../libjavavm}/jniapi/JNIMethodId.java | 2 +- .../libjavavm}/jniapi/JNINativeInterface.java | 84 +++++------ .../libjavavm}/jniapi/JNINativeMethod.java | 2 +- .../libjavavm}/jniapi/JNIObjectHandle.java | 2 +- .../libjavavm}/jniapi/JNIObjectRefType.java | 2 +- .../espresso/libjavavm}/jniapi/JNIValue.java | 2 +- .../libjavavm}/jniapi/JNIVersion.java | 2 +- ...espresso_dynamic.h => libjavavm_dynamic.h} | 0 .../include/mokapot.h | 18 +-- .../src/mokapot.c | 130 +++++++++--------- 34 files changed, 191 insertions(+), 191 deletions(-) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/Arguments.java (97%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/LibEspresso.java (91%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/OS.java (97%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/arghelper/ArgumentsHandler.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/arghelper/ModulePropertyCounter.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/arghelper/Native.java (97%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/arghelper/PolyglotArgs.java (98%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIArrayReleaseModes.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIEnvironment.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIEnvironmentPointer.java (95%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIErrors.java (97%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIFieldId.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIFunctionPointerTypes.java (99%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIHeaderDirectives.java (95%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIInvokeInterface.java (83%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIJavaVM.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIJavaVMAttachArgs.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIJavaVMInitArgs.java (97%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIJavaVMOption.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIJavaVMPointer.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIMethodId.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNINativeInterface.java (87%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNINativeMethod.java (97%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIObjectHandle.java (95%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIObjectRefType.java (96%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIValue.java (97%) rename espresso/src/{com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso => com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm}/jniapi/JNIVersion.java (98%) rename espresso/src/com.oracle.truffle.espresso.mokapot/include/{libespresso_dynamic.h => libjavavm_dynamic.h} (100%) diff --git a/espresso/mx.espresso/mx_espresso.py b/espresso/mx.espresso/mx_espresso.py index ef424f471f18..035688dee049 100644 --- a/espresso/mx.espresso/mx_espresso.py +++ b/espresso/mx.espresso/mx_espresso.py @@ -50,7 +50,7 @@ def _espresso_launcher_command(args): def _java_truffle_command(args): - """Java launcher using libespresso in GraalVM + arguments""" + """Java launcher using libjavavm in GraalVM + arguments""" return _espresso_command('java', ['-truffle'] + args) @@ -106,24 +106,24 @@ def _espresso_gate_runner(args, tasks): with Task(mokapot_header_gate_name, tasks, tags=[EspressoTags.verify]) as t: if t: import mx_sdk_vm_impl - run_instructions = "$ mx --dynamicimports=/substratevm --native-images=lib:espresso gate --all-suites --task '{}'".format(mokapot_header_gate_name) + run_instructions = "$ mx --dynamicimports=/substratevm --native-images=lib:javavm gate --all-suites --task '{}'".format(mokapot_header_gate_name) if mx_sdk_vm_impl._skip_libraries(espresso_library_config): mx.abort("""\ -The registration of the Espresso library ('lib:espresso') is skipped. Please run this gate as follows: +The registration of the Espresso library ('lib:javavm') is skipped. Please run this gate as follows: {}""".format(run_instructions)) errors = False mokapot_dir = join(mx.project('com.oracle.truffle.espresso.mokapot').dir, 'include') - libespresso_dir = mx.project(mx_sdk_vm_impl.GraalVmNativeImage.project_name(espresso_library_config)).get_output_root() + libjavavm_dir = mx.project(mx_sdk_vm_impl.GraalVmNativeImage.project_name(espresso_library_config)).get_output_root() - for header in ['libespresso_dynamic.h', 'graal_isolate_dynamic.h']: + for header in ['libjavavm_dynamic.h', 'graal_isolate_dynamic.h']: committed_header = join(mokapot_dir, header) if not mx.exists(committed_header): mx.abort("Cannot locate '{}'. Was the file moved or renamed?".format(committed_header)) - generated_header = join(libespresso_dir, header) + generated_header = join(libjavavm_dir, header) if not mx.exists(generated_header): - mx.abort("Cannot locate '{}'. Did you forget to build? Example:\n'mx --dynamicimports=/substratevm --native-images=lib:espresso build'".format(generated_header)) + mx.abort("Cannot locate '{}'. Did you forget to build? Example:\n'mx --dynamicimports=/substratevm --native-images=lib:javavm build'".format(generated_header)) committed_header_copyright = [] with open(committed_header, 'r') as committed_header_file: @@ -151,7 +151,7 @@ def _espresso_gate_runner(args, tasks): To fix the issue, run this gate locally: {instructions} And adapt the code to the modified headers in '{committed}'. -""".format(committed=os.path.relpath(mokapot_dir, _suite.vc_dir), generated=os.path.relpath(libespresso_dir, _suite.vc_dir), instructions=run_instructions)) +""".format(committed=os.path.relpath(mokapot_dir, _suite.vc_dir), generated=os.path.relpath(libjavavm_dir, _suite.vc_dir), instructions=run_instructions)) # REGISTER MX GATE RUNNER @@ -160,14 +160,14 @@ def _espresso_gate_runner(args, tasks): if mx.is_windows(): - lib_espresso_cp = '%GRAALVM_HOME%\\lib\\graalvm\\lib-espresso.jar' + lib_javavm_cp = '%GRAALVM_HOME%\\lib\\graalvm\\lib-javavm.jar' else: - lib_espresso_cp = '${GRAALVM_HOME}/lib/graalvm/lib-espresso.jar' + lib_javavm_cp = '${GRAALVM_HOME}/lib/graalvm/lib-javavm.jar' espresso_library_config = mx_sdk_vm.LibraryConfig( - destination='lib/', - jar_distributions=['espresso:LIB_ESPRESSO'], + destination='lib/', + jar_distributions=['espresso:LIB_JAVAVM'], build_args=[ '--language:java', '--tool:all', @@ -191,7 +191,7 @@ def _espresso_gate_runner(args, tasks): truffle_jars=['espresso:ESPRESSO'], support_distributions=['espresso:ESPRESSO_SUPPORT'], library_configs=[espresso_library_config], - polyglot_lib_jar_dependencies=['espresso:LIB_ESPRESSO'], + polyglot_lib_jar_dependencies=['espresso:LIB_JAVAVM'], has_polyglot_lib_entrypoints=True, priority=1, post_install_msg=""" @@ -203,7 +203,7 @@ def _espresso_gate_runner(args, tasks): (to execute a jar file) To rebuild the polyglot library: - gu rebuild-images libpolyglot -cp """ + lib_espresso_cp, + gu rebuild-images libpolyglot -cp """ + lib_javavm_cp, stability="supported", )) diff --git a/espresso/mx.espresso/native-ce b/espresso/mx.espresso/native-ce index 727aba409a36..c01d3302b108 100644 --- a/espresso/mx.espresso/native-ce +++ b/espresso/mx.espresso/native-ce @@ -1,6 +1,6 @@ -# mx --dynamicimports=/vm,/substratevm --components="Java on Truffle,SubstrateVM,suite:tools" --native-images=lib:espresso --disable-installables=true graalvm-show +# mx --dynamicimports=/vm,/substratevm --components="Java on Truffle,SubstrateVM,suite:tools" --native-images=lib:javavm --disable-installables=true graalvm-show DYNAMIC_IMPORTS=/vm,/substratevm COMPONENTS=Java on Truffle,SubstrateVM,suite:tools -NATIVE_IMAGES=lib:espresso +NATIVE_IMAGES=lib:javavm DISABLE_INSTALLABLES=true diff --git a/espresso/mx.espresso/native-ee b/espresso/mx.espresso/native-ee index b543601c292c..9e1e2e621152 100644 --- a/espresso/mx.espresso/native-ee +++ b/espresso/mx.espresso/native-ee @@ -1,7 +1,7 @@ -# mx --dynamicimports=/vm-enterprise,/substratevm-enterprise,/tools-enterprise --components="Java on Truffle,SubstrateVM Enterprise,suite:tools,suite:tools-enterprise" --native-images=lib:espresso --disable-installables=true graalvm-show +# mx --dynamicimports=/vm-enterprise,/substratevm-enterprise,/tools-enterprise --components="Java on Truffle,SubstrateVM Enterprise,suite:tools,suite:tools-enterprise" --native-images=lib:javavm --disable-installables=true graalvm-show DYNAMIC_IMPORTS=/vm-enterprise,/substratevm-enterprise,/tools-enterprise COMPONENTS=Java on Truffle,SubstrateVM Enterprise,suite:tools,suite:tools-enterprise -NATIVE_IMAGES=lib:espresso +NATIVE_IMAGES=lib:javavm DISABLE_INSTALLABLES=true EXCLUDE_COMPONENTS=hprf diff --git a/espresso/mx.espresso/suite.py b/espresso/mx.espresso/suite.py index 42d1ac5e1857..67ae99659d79 100644 --- a/espresso/mx.espresso/suite.py +++ b/espresso/mx.espresso/suite.py @@ -179,7 +179,7 @@ "checkstyle": "com.oracle.truffle.espresso", }, - "com.oracle.truffle.espresso.libespresso": { + "com.oracle.truffle.espresso.libjavavm": { "subDir": "src", "sourceDirs": ["src"], "dependencies": [ @@ -348,10 +348,10 @@ "maven": False, }, - "LIB_ESPRESSO": { + "LIB_JAVAVM": { "subDir": "src", "dependencies": [ - "com.oracle.truffle.espresso.libespresso", + "com.oracle.truffle.espresso.libjavavm", ], "distDependencies": [ "sdk:GRAAL_SDK", diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/Arguments.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/Arguments.java similarity index 97% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/Arguments.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/Arguments.java index eb8de9250be4..e0851eec5d23 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/Arguments.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/Arguments.java @@ -20,9 +20,9 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso; +package com.oracle.truffle.espresso.libjavavm; -import static com.oracle.truffle.espresso.libespresso.jniapi.JNIErrors.JNI_ERR; +import static com.oracle.truffle.espresso.libjavavm.jniapi.JNIErrors.JNI_ERR; import java.io.File; import java.io.PrintStream; @@ -37,10 +37,10 @@ import org.graalvm.polyglot.Context; import org.graalvm.word.Pointer; -import com.oracle.truffle.espresso.libespresso.arghelper.ArgumentsHandler; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIErrors; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIJavaVMInitArgs; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIJavaVMOption; +import com.oracle.truffle.espresso.libjavavm.arghelper.ArgumentsHandler; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIErrors; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIJavaVMInitArgs; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIJavaVMOption; public final class Arguments { private static final PrintStream STDERR = System.err; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/LibEspresso.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/LibEspresso.java similarity index 91% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/LibEspresso.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/LibEspresso.java index 8818f8520fac..cd7b3580c73e 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/LibEspresso.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/LibEspresso.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso; +package com.oracle.truffle.espresso.libjavavm; import java.io.PrintStream; @@ -33,13 +33,13 @@ import org.graalvm.polyglot.Value; import org.graalvm.word.WordFactory; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIEnvironmentPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIErrors; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetEnvFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIJavaVM; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIJavaVMInitArgs; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIJavaVMPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIVersion; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIEnvironmentPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIErrors; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetEnvFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIJavaVM; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIJavaVMInitArgs; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIJavaVMPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIVersion; public class LibEspresso { private static final PrintStream STDERR = System.err; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/OS.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/OS.java similarity index 97% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/OS.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/OS.java index 67c9d4ae952a..851eef6c7904 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/OS.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/OS.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso; +package com.oracle.truffle.espresso.libjavavm; public enum OS { Darwin, diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/ArgumentsHandler.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/ArgumentsHandler.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/ArgumentsHandler.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/ArgumentsHandler.java index bcd7e842d71f..48275781edae 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/ArgumentsHandler.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/ArgumentsHandler.java @@ -21,9 +21,9 @@ * questions. */ -package com.oracle.truffle.espresso.libespresso.arghelper; +package com.oracle.truffle.espresso.libjavavm.arghelper; -import static com.oracle.truffle.espresso.libespresso.Arguments.abort; +import static com.oracle.truffle.espresso.libjavavm.Arguments.abort; import java.io.PrintStream; import java.util.function.Consumer; @@ -37,9 +37,9 @@ import org.graalvm.polyglot.Context; import org.graalvm.word.Pointer; -import com.oracle.truffle.espresso.libespresso.Arguments; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIJavaVMInitArgs; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIJavaVMOption; +import com.oracle.truffle.espresso.libjavavm.Arguments; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIJavaVMInitArgs; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIJavaVMOption; /** * A helper class that centralizes different ways of handling option parsing for the java -truffle diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/ModulePropertyCounter.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/ModulePropertyCounter.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/ModulePropertyCounter.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/ModulePropertyCounter.java index 4ab823b46861..910c6ee08ff2 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/ModulePropertyCounter.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/ModulePropertyCounter.java @@ -21,11 +21,11 @@ * questions. */ -package com.oracle.truffle.espresso.libespresso.arghelper; +package com.oracle.truffle.espresso.libjavavm.arghelper; import org.graalvm.polyglot.Context; -import com.oracle.truffle.espresso.libespresso.Arguments; +import com.oracle.truffle.espresso.libjavavm.Arguments; /** * Handles numbered System properties, which may require keeping track of some counters. diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/Native.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/Native.java similarity index 97% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/Native.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/Native.java index 6839d64df2f9..55386fb67b6c 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/Native.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/Native.java @@ -21,10 +21,10 @@ * questions. */ -package com.oracle.truffle.espresso.libespresso.arghelper; +package com.oracle.truffle.espresso.libjavavm.arghelper; -import static com.oracle.truffle.espresso.libespresso.Arguments.abort; -import static com.oracle.truffle.espresso.libespresso.arghelper.ArgumentsHandler.isBooleanOption; +import static com.oracle.truffle.espresso.libjavavm.Arguments.abort; +import static com.oracle.truffle.espresso.libjavavm.arghelper.ArgumentsHandler.isBooleanOption; import java.util.EnumSet; import java.util.Map; @@ -35,7 +35,7 @@ import org.graalvm.options.OptionDescriptor; import org.graalvm.options.OptionDescriptors; -import com.oracle.truffle.espresso.libespresso.Arguments; +import com.oracle.truffle.espresso.libjavavm.Arguments; /** * Handles communication with the host VM for passing arguments from the command line. diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/PolyglotArgs.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/PolyglotArgs.java similarity index 98% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/PolyglotArgs.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/PolyglotArgs.java index 0c98ea8ea05b..6150454274ef 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/arghelper/PolyglotArgs.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/arghelper/PolyglotArgs.java @@ -21,11 +21,11 @@ * questions. */ -package com.oracle.truffle.espresso.libespresso.arghelper; +package com.oracle.truffle.espresso.libjavavm.arghelper; -import static com.oracle.truffle.espresso.libespresso.Arguments.abort; -import static com.oracle.truffle.espresso.libespresso.Arguments.abortExperimental; -import static com.oracle.truffle.espresso.libespresso.arghelper.ArgumentsHandler.isBooleanOption; +import static com.oracle.truffle.espresso.libjavavm.Arguments.abort; +import static com.oracle.truffle.espresso.libjavavm.Arguments.abortExperimental; +import static com.oracle.truffle.espresso.libjavavm.arghelper.ArgumentsHandler.isBooleanOption; import static java.nio.file.StandardOpenOption.APPEND; import static java.nio.file.StandardOpenOption.CREATE; import static java.nio.file.StandardOpenOption.CREATE_NEW; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIArrayReleaseModes.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIArrayReleaseModes.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIArrayReleaseModes.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIArrayReleaseModes.java index d4720e396cb6..2de402d78676 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIArrayReleaseModes.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIArrayReleaseModes.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.constant.CConstant; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIEnvironment.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIEnvironment.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIEnvironment.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIEnvironment.java index f20b0c47b835..d7a6ef9a88cc 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIEnvironment.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIEnvironment.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.struct.CField; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIEnvironmentPointer.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIEnvironmentPointer.java similarity index 95% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIEnvironmentPointer.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIEnvironmentPointer.java index 17490c4a66b9..998eff81459c 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIEnvironmentPointer.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIEnvironmentPointer.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.struct.CPointerTo; import org.graalvm.word.PointerBase; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIErrors.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIErrors.java similarity index 97% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIErrors.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIErrors.java index 5888fd4de0c0..233ce04c834c 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIErrors.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIErrors.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.constant.CConstant; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIFieldId.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIFieldId.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIFieldId.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIFieldId.java index b7607e84b9eb..a40c5fd06aff 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIFieldId.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIFieldId.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.struct.CStruct; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIFunctionPointerTypes.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIFunctionPointerTypes.java similarity index 99% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIFunctionPointerTypes.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIFunctionPointerTypes.java index a174782090d4..59f1715c55cc 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIFunctionPointerTypes.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIFunctionPointerTypes.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.function.CFunctionPointer; import org.graalvm.nativeimage.c.function.InvokeCFunctionPointer; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIHeaderDirectives.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIHeaderDirectives.java similarity index 95% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIHeaderDirectives.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIHeaderDirectives.java index 4e31c7f013f9..1035c792698d 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIHeaderDirectives.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIHeaderDirectives.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import java.nio.file.Files; import java.nio.file.Path; @@ -31,7 +31,7 @@ import org.graalvm.nativeimage.c.CContext; -import com.oracle.truffle.espresso.libespresso.OS; +import com.oracle.truffle.espresso.libjavavm.OS; public class JNIHeaderDirectives implements CContext.Directives { diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIInvokeInterface.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIInvokeInterface.java similarity index 83% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIInvokeInterface.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIInvokeInterface.java index 39d429bdb672..69287b7bf684 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIInvokeInterface.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIInvokeInterface.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.ObjectHandle; import org.graalvm.nativeimage.c.CContext; @@ -28,10 +28,10 @@ import org.graalvm.nativeimage.c.struct.CStruct; import org.graalvm.word.PointerBase; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.AttachCurrentThreadFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.DestroyJavaVMFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.DetachCurrentThreadFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetEnvFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.AttachCurrentThreadFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.DestroyJavaVMFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.DetachCurrentThreadFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetEnvFunctionPointer; @CContext(JNIHeaderDirectives.class) @CStruct(value = "JNIInvokeInterface_", addStructKeyword = true) diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVM.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVM.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVM.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVM.java index 94083a1c8ba5..0a81cd5e9ede 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVM.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVM.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.struct.CField; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMAttachArgs.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMAttachArgs.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMAttachArgs.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMAttachArgs.java index 7c11ac6e06bf..f1301f98279c 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMAttachArgs.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMAttachArgs.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.struct.CField; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMInitArgs.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMInitArgs.java similarity index 97% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMInitArgs.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMInitArgs.java index b48592b3b896..16c7e9f8164c 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMInitArgs.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMInitArgs.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.struct.CField; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMOption.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMOption.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMOption.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMOption.java index 5a6210e6a416..1afdf2627332 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMOption.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMOption.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.struct.CField; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMPointer.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMPointer.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMPointer.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMPointer.java index 3f8faa872571..416708b7a110 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIJavaVMPointer.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIJavaVMPointer.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.struct.CPointerTo; import org.graalvm.word.PointerBase; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIMethodId.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIMethodId.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIMethodId.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIMethodId.java index cca423e47101..3dd77de34023 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIMethodId.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIMethodId.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.struct.CStruct; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNINativeInterface.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNINativeInterface.java similarity index 87% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNINativeInterface.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNINativeInterface.java index e4a71832613b..2d80729122f7 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNINativeInterface.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNINativeInterface.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.function.CFunctionPointer; @@ -29,47 +29,47 @@ import org.graalvm.nativeimage.c.type.WordPointer; import org.graalvm.word.PointerBase; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.CallBooleanMethodAFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.CallIntMethodAFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.CallLongMethodAFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.CallObjectMethodAFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.CallStaticLongMethodAFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.CallStaticObjectMethodAFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.CallVoidMethodAFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.DefineClassFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.DeleteGlobalRefFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.ExceptionCheckFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.ExceptionOccurredFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.ExceptionVoidFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.FindClassFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.FromReflectedFieldFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.FromReflectedMethodFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetArrayLengthFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetBooleanFieldFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetByteArrayElementsFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetFieldIDFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetMethodIDFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetObjectArrayElementFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetObjectClassFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetObjectFieldFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetStaticObjectFieldFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetStringUTFCharsFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.GetSuperclassFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.IsAssignableFromFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.IsSameObjectFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.NewByteArrayFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.NewGlobalRefFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.NewObjectAFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.NewObjectArrayFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.NewStringUTFFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.RegisterNativesFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.ReleaseByteArrayElementsFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.ReleaseStringUTFCharsFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.SetObjectArrayElementFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.ThrowFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.ThrowNewFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.ToReflectedFieldFunctionPointer; -import com.oracle.truffle.espresso.libespresso.jniapi.JNIFunctionPointerTypes.ToReflectedMethodFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.CallBooleanMethodAFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.CallIntMethodAFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.CallLongMethodAFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.CallObjectMethodAFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.CallStaticLongMethodAFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.CallStaticObjectMethodAFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.CallVoidMethodAFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.DefineClassFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.DeleteGlobalRefFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.ExceptionCheckFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.ExceptionOccurredFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.ExceptionVoidFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.FindClassFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.FromReflectedFieldFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.FromReflectedMethodFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetArrayLengthFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetBooleanFieldFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetByteArrayElementsFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetFieldIDFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetMethodIDFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetObjectArrayElementFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetObjectClassFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetObjectFieldFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetStaticObjectFieldFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetStringUTFCharsFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.GetSuperclassFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.IsAssignableFromFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.IsSameObjectFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.NewByteArrayFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.NewGlobalRefFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.NewObjectAFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.NewObjectArrayFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.NewStringUTFFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.RegisterNativesFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.ReleaseByteArrayElementsFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.ReleaseStringUTFCharsFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.SetObjectArrayElementFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.ThrowFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.ThrowNewFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.ToReflectedFieldFunctionPointer; +import com.oracle.truffle.espresso.libjavavm.jniapi.JNIFunctionPointerTypes.ToReflectedMethodFunctionPointer; @CContext(JNIHeaderDirectives.class) @CStruct(value = "JNINativeInterface_", addStructKeyword = true) diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNINativeMethod.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNINativeMethod.java similarity index 97% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNINativeMethod.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNINativeMethod.java index 6f480e7e1eae..5e58c50affd8 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNINativeMethod.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNINativeMethod.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.function.CFunctionPointer; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIObjectHandle.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIObjectHandle.java similarity index 95% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIObjectHandle.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIObjectHandle.java index 9498ffdf1515..ba78d2d3d8aa 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIObjectHandle.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIObjectHandle.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.word.ComparableWord; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIObjectRefType.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIObjectRefType.java similarity index 96% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIObjectRefType.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIObjectRefType.java index 4aeefca6732e..880d9d9e52b3 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIObjectRefType.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIObjectRefType.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.constant.CEnum; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIValue.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIValue.java similarity index 97% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIValue.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIValue.java index 67da22ce344b..60e4ae62c2c2 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIValue.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIValue.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.struct.CField; diff --git a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIVersion.java b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIVersion.java similarity index 98% rename from espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIVersion.java rename to espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIVersion.java index 29f2c5958402..4fd008be8c61 100644 --- a/espresso/src/com.oracle.truffle.espresso.libespresso/src/com/oracle/truffle/espresso/libespresso/jniapi/JNIVersion.java +++ b/espresso/src/com.oracle.truffle.espresso.libjavavm/src/com/oracle/truffle/espresso/libjavavm/jniapi/JNIVersion.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.oracle.truffle.espresso.libespresso.jniapi; +package com.oracle.truffle.espresso.libjavavm.jniapi; import org.graalvm.nativeimage.c.CContext; import org.graalvm.nativeimage.c.constant.CConstant; diff --git a/espresso/src/com.oracle.truffle.espresso.mokapot/include/libespresso_dynamic.h b/espresso/src/com.oracle.truffle.espresso.mokapot/include/libjavavm_dynamic.h similarity index 100% rename from espresso/src/com.oracle.truffle.espresso.mokapot/include/libespresso_dynamic.h rename to espresso/src/com.oracle.truffle.espresso.mokapot/include/libjavavm_dynamic.h diff --git a/espresso/src/com.oracle.truffle.espresso.mokapot/include/mokapot.h b/espresso/src/com.oracle.truffle.espresso.mokapot/include/mokapot.h index dbb28ef76224..2065a9d3f59f 100644 --- a/espresso/src/com.oracle.truffle.espresso.mokapot/include/mokapot.h +++ b/espresso/src/com.oracle.truffle.espresso.mokapot/include/mokapot.h @@ -27,7 +27,7 @@ #include "jni.h" #include "os.h" -#include "libespresso_dynamic.h" +#include "libjavavm_dynamic.h" #include #include @@ -69,7 +69,7 @@ typedef uint64_t julong; /* Usage of the JavaVM reserved fields: * vm type | MOKA_RISTRETTO | MOKA_LATTE | MOKA_AMERICANO | * ----------+----------------+---------------------+----------------+ - * reserved0 | NULL | LibEspressoIsolate* | context handle | + * reserved0 | NULL | LibJavaVMIsolate* | context handle | * reserved1 | MOKA_RISTRETTO | MOKA_LATTE | MOKA_AMERICANO | * reserved2 | NULL | JavaVM* (americano) | JavaVM* (latte)| */ @@ -953,10 +953,10 @@ void add_java_vm(JavaVM* vm); jint remove_java_vm(JavaVM* vm); void gather_java_vms(JavaVM** buf, jsize buf_size, jsize* numVms); -#define LIB_ESPRESSO_PLAIN 0 -#define LIB_ESPRESSO_POLYGLOT 1 +#define LIB_JAVAVM_PLAIN 0 +#define LIB_JAVAVM_POLYGLOT 1 -typedef struct LibEspresso { +typedef struct LibJavaVM { graal_create_isolate_fn_t create_isolate; graal_attach_thread_fn_t attach_thread; graal_detach_thread_fn_t detach_thread; @@ -969,12 +969,12 @@ typedef struct LibEspresso { Espresso_ReleaseContext_fn_t Espresso_ReleaseContext; // release Espresso_CloseContext_fn_t Espresso_CloseContext; // release + leave + close Espresso_Exit_fn_t Espresso_Exit; // leave + close + exit -} LibEspresso; +} LibJavaVM; -typedef struct LibEspressoIsolate { - LibEspresso *lib; +typedef struct LibJavaVMIsolate { + LibJavaVM *lib; graal_isolate_t *isolate; jboolean is_sun_standard_launcher; // -Dsun.java.launcher=SUN_STANDARD -} LibEspressoIsolate; +} LibJavaVMIsolate; #endif // _MOKAPOT_H diff --git a/espresso/src/com.oracle.truffle.espresso.mokapot/src/mokapot.c b/espresso/src/com.oracle.truffle.espresso.mokapot/src/mokapot.c index 456bf13f7cf6..42bbb3cb2dc5 100644 --- a/espresso/src/com.oracle.truffle.espresso.mokapot/src/mokapot.c +++ b/espresso/src/com.oracle.truffle.espresso.mokapot/src/mokapot.c @@ -1574,8 +1574,8 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *args) { return ret; } -static LibEspresso *lib_espresso = NULL; -static LibEspresso *lib_polyglot = NULL; +static LibJavaVM *lib_javavm = NULL; +static LibJavaVM *lib_polyglot = NULL; char *last_sep(const char *start, const char *end) { const char *p = end; @@ -1588,7 +1588,7 @@ char *last_sep(const char *start, const char *end) { return NULL; } -#define LIB_ESPRESSO_PATH "languages" OS_PATHSEP_STR "java" OS_PATHSEP_STR "lib" OS_PATHSEP_STR OS_LIB("espresso") +#define LIB_JAVAVM_PATH "languages" OS_PATHSEP_STR "java" OS_PATHSEP_STR "lib" OS_PATHSEP_STR OS_LIB("javavm") #define LIB_POLYGLOT_PATH "lib" OS_PATHSEP_STR "polyglot" OS_PATHSEP_STR OS_LIB("polyglot") #if defined(_WIN32) @@ -1597,7 +1597,7 @@ char *last_sep(const char *start, const char *end) { #define EXPECT_LIB "lib" #endif -LibEspresso *load_libespresso(const char* lib_path) { +LibJavaVM *load_libjavavm(const char* lib_path) { const char *mokapot_path = os_current_library_path(); if (mokapot_path == NULL) { return NULL; @@ -1606,7 +1606,7 @@ LibEspresso *load_libespresso(const char* lib_path) { // .../lib/truffle/libjvm.so or .../lib//truffle/libjvm.so // "lib" is replaced by "bin" on windows (EXPECT_LIB) // espresso is in - // .../languages/java/lib/libespresso.so + // .../languages/java/lib/libjavavm.so const char* mokapot_path_end = mokapot_path + strlen(mokapot_path); char* pos = last_sep(mokapot_path, mokapot_path_end); if (pos == NULL) { @@ -1644,35 +1644,35 @@ LibEspresso *load_libespresso(const char* lib_path) { strncpy(espresso_path + prefix_len, lib_path, MAX_PATH - prefix_len); espresso_path[prefix_len + lib_name_len] = '\0'; - OS_DL_HANDLE libespresso = os_dl_open(espresso_path); - if (libespresso == NULL) { + OS_DL_HANDLE libjavavm = os_dl_open(espresso_path); + if (libjavavm == NULL) { fprintf(stderr, "Failed to open %s: %s" OS_NEWLINE_STR, espresso_path, os_dl_error()); return NULL; } -#define BIND_LIBESPRESSO(X) \ - X ## _fn_t X = os_dl_sym(libespresso, #X); \ +#define BIND_LIBJAVAVM(X) \ + X ## _fn_t X = os_dl_sym(libjavavm, #X); \ if (X == NULL) { \ - fprintf(stderr, "%s does not contain the expected libespresso interface: missing " #X OS_NEWLINE_STR, espresso_path); \ + fprintf(stderr, "%s does not contain the expected libjavavm interface: missing " #X OS_NEWLINE_STR, espresso_path); \ return NULL; \ } - BIND_LIBESPRESSO(graal_create_isolate) - BIND_LIBESPRESSO(graal_attach_thread) - BIND_LIBESPRESSO(graal_detach_thread) - BIND_LIBESPRESSO(graal_get_current_thread) - BIND_LIBESPRESSO(graal_tear_down_isolate) - BIND_LIBESPRESSO(graal_detach_all_threads_and_tear_down_isolate) - BIND_LIBESPRESSO(Espresso_CreateJavaVM) - BIND_LIBESPRESSO(Espresso_EnterContext) - BIND_LIBESPRESSO(Espresso_LeaveContext) - BIND_LIBESPRESSO(Espresso_ReleaseContext) - BIND_LIBESPRESSO(Espresso_CloseContext) - BIND_LIBESPRESSO(Espresso_Exit) - -#undef BIND_LIBESPRESSO - - LibEspresso *result = malloc(sizeof(LibEspresso)); + BIND_LIBJAVAVM(graal_create_isolate) + BIND_LIBJAVAVM(graal_attach_thread) + BIND_LIBJAVAVM(graal_detach_thread) + BIND_LIBJAVAVM(graal_get_current_thread) + BIND_LIBJAVAVM(graal_tear_down_isolate) + BIND_LIBJAVAVM(graal_detach_all_threads_and_tear_down_isolate) + BIND_LIBJAVAVM(Espresso_CreateJavaVM) + BIND_LIBJAVAVM(Espresso_EnterContext) + BIND_LIBJAVAVM(Espresso_LeaveContext) + BIND_LIBJAVAVM(Espresso_ReleaseContext) + BIND_LIBJAVAVM(Espresso_CloseContext) + BIND_LIBJAVAVM(Espresso_Exit) + +#undef BIND_LIBJAVAVM + + LibJavaVM *result = malloc(sizeof(LibJavaVM)); if (result == NULL) { return NULL; } @@ -1691,16 +1691,16 @@ LibEspresso *load_libespresso(const char* lib_path) { return result; } -LibEspresso *get_libespresso(int type) { - if (type == LIB_ESPRESSO_PLAIN) { - if (lib_espresso == NULL) { - lib_espresso = load_libespresso(LIB_ESPRESSO_PATH); +LibJavaVM *get_libjavavm(int type) { + if (type == LIB_JAVAVM_PLAIN) { + if (lib_javavm == NULL) { + lib_javavm = load_libjavavm(LIB_JAVAVM_PATH); } - return lib_espresso; + return lib_javavm; } - if (type == LIB_ESPRESSO_POLYGLOT) { + if (type == LIB_JAVAVM_POLYGLOT) { if (lib_polyglot == NULL) { - lib_polyglot = load_libespresso(LIB_POLYGLOT_PATH); + lib_polyglot = load_libjavavm(LIB_POLYGLOT_PATH); } return lib_polyglot; } @@ -1709,18 +1709,18 @@ LibEspresso *get_libespresso(int type) { jint AttachCurrentThread_helper(JavaVM *vm, void **penv, void *args, jint (JNICALL *attach_method)(JavaVM *vm, void **penv, void *args)) { JavaVM *espressoJavaVM = (*vm)->reserved2; - LibEspressoIsolate *espressoIsolate = (*vm)->reserved0; + LibJavaVMIsolate *espressoIsolate = (*vm)->reserved0; graal_isolate_t *isolate = espressoIsolate->isolate; - LibEspresso *libespresso = espressoIsolate->lib; + LibJavaVM *libjavavm = espressoIsolate->lib; graal_isolatethread_t *thread; - if (libespresso->attach_thread(isolate, &thread) != 0) { + if (libjavavm->attach_thread(isolate, &thread) != 0) { fprintf(stderr, "AttachCurrentThread: failed to attached to isolate" OS_NEWLINE_STR); return JNI_ERR; } // we must first attach to the polyglot context: // (*espressoJavaVM)->AttachCurrentThread is a NFI closure from this context // and only works correctly if we are attached. - jint ret = libespresso->Espresso_EnterContext(thread, (struct JavaVM_ *)espressoJavaVM); + jint ret = libjavavm->Espresso_EnterContext(thread, (struct JavaVM_ *)espressoJavaVM); if (ret != JNI_OK) { fprintf(stderr, "AttachCurrentThread: failed to attached to polyglot context" OS_NEWLINE_STR); return ret; @@ -1728,7 +1728,7 @@ jint AttachCurrentThread_helper(JavaVM *vm, void **penv, void *args, jint (JNICA ret = attach_method(espressoJavaVM, penv, args); if (ret != JNI_OK) { fprintf(stderr, "AttachCurrentThread: failed to attached to Espresso" OS_NEWLINE_STR); - libespresso->detach_thread(thread); + libjavavm->detach_thread(thread); } return ret; } @@ -1748,10 +1748,10 @@ jint DestroyJavaVM(JavaVM *vm) { return JNI_ERR; } JavaVM *espressoJavaVM = (*vm)->reserved2; - LibEspressoIsolate *espressoIsolate = (*vm)->reserved0; + LibJavaVMIsolate *espressoIsolate = (*vm)->reserved0; graal_isolate_t *isolate = espressoIsolate->isolate; - LibEspresso *libespresso = espressoIsolate->lib; - graal_isolatethread_t *thread = libespresso->get_current_thread(isolate); + LibJavaVM *libjavavm = espressoIsolate->lib; + graal_isolatethread_t *thread = libjavavm->get_current_thread(isolate); if (thread == NULL) { void* env; JavaVMAttachArgs args; @@ -1762,26 +1762,26 @@ jint DestroyJavaVM(JavaVM *vm) { if (result != JNI_OK) { return result; } - thread = libespresso->get_current_thread(isolate); + thread = libjavavm->get_current_thread(isolate); } jint result = (*espressoJavaVM)->DestroyJavaVM(espressoJavaVM); remove_java_vm(vm); jint result2; if (espressoIsolate->is_sun_standard_launcher == JNI_TRUE) { - libespresso->Espresso_Exit(thread, (struct JavaVM_ *) espressoJavaVM); + libjavavm->Espresso_Exit(thread, (struct JavaVM_ *) espressoJavaVM); fprintf(stderr, "Error: Espresso_Exit didn't exit"); result2 = JNI_ERR; } else { - result2 = libespresso->Espresso_CloseContext(thread, (struct JavaVM_ *) espressoJavaVM); + result2 = libjavavm->Espresso_CloseContext(thread, (struct JavaVM_ *) espressoJavaVM); } if (result == JNI_OK && result2 != JNI_OK) { result = result2; } - result2 = libespresso->detach_thread(thread); + result2 = libjavavm->detach_thread(thread); if (result == JNI_OK && result2 != JNI_OK) { result = result2; } - if (libespresso->tear_down_isolate(thread) != 0 && result == JNI_OK) { + if (libjavavm->tear_down_isolate(thread) != 0 && result == JNI_OK) { result = JNI_ERR; } free(espressoIsolate); @@ -1794,19 +1794,19 @@ jint DetachCurrentThread(JavaVM *vm) { return JNI_ERR; } JavaVM *espressoJavaVM = (*vm)->reserved2; - LibEspressoIsolate *espressoIsolate = (*vm)->reserved0; + LibJavaVMIsolate *espressoIsolate = (*vm)->reserved0; graal_isolate_t *isolate = espressoIsolate->isolate; - LibEspresso *libespresso = espressoIsolate->lib; - graal_isolatethread_t *thread = libespresso->get_current_thread(isolate); + LibJavaVM *libjavavm = espressoIsolate->lib; + graal_isolatethread_t *thread = libjavavm->get_current_thread(isolate); if (thread == NULL) { return JNI_OK; } jint ret = (*espressoJavaVM)->DetachCurrentThread(espressoJavaVM); - jint ret2 = libespresso->Espresso_LeaveContext(thread, (struct JavaVM_ *) espressoJavaVM); + jint ret2 = libjavavm->Espresso_LeaveContext(thread, (struct JavaVM_ *) espressoJavaVM); if (ret == JNI_OK && ret2 != JNI_OK) { ret = ret2; } - if (libespresso->detach_thread(thread) != 0 && ret == JNI_OK) { + if (libjavavm->detach_thread(thread) != 0 && ret == JNI_OK) { ret = JNI_ERR; } return ret; @@ -1818,10 +1818,10 @@ jint GetEnv(JavaVM *vm, void **penv, jint version) { return JNI_ERR; } JavaVM *espressoJavaVM = (*vm)->reserved2; - LibEspressoIsolate *espressoIsolate = (*vm)->reserved0; + LibJavaVMIsolate *espressoIsolate = (*vm)->reserved0; graal_isolate_t *isolate = espressoIsolate->isolate; - LibEspresso *libespresso = espressoIsolate->lib; - if (libespresso->get_current_thread(isolate) == NULL) { + LibJavaVM *libjavavm = espressoIsolate->lib; + if (libjavavm->get_current_thread(isolate) == NULL) { return JNI_EDETACHED; } return (*espressoJavaVM)->GetEnv(espressoJavaVM, penv, version); @@ -1838,18 +1838,18 @@ jint AttachCurrentThreadAsDaemon(JavaVM *vm, void **penv, void *args) { _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm_ptr, void **penv, void *args) { JavaVMInitArgs *initArgs = args; - int lib_espresso_type = LIB_ESPRESSO_PLAIN; + int lib_javavm_type = LIB_JAVAVM_PLAIN; jboolean is_sun_standard_launcher = JNI_FALSE; for (int i = 0; i < initArgs->nOptions; i++) { const JavaVMOption* option = initArgs->options + i; if (strcmp("--polyglot", option->optionString) == 0) { - lib_espresso_type = LIB_ESPRESSO_POLYGLOT; + lib_javavm_type = LIB_JAVAVM_POLYGLOT; } else if (strcmp("-Dsun.java.launcher=SUN_STANDARD", option->optionString) == 0) { is_sun_standard_launcher = JNI_TRUE; } } - LibEspresso *libespresso = get_libespresso(lib_espresso_type); - if (libespresso == NULL) { + LibJavaVM *libjavavm = get_libjavavm(lib_javavm_type); + if (libjavavm == NULL) { return JNI_ERR; } graal_isolate_t *isolate; @@ -1858,31 +1858,31 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm_ptr, void **pen params.version = 0; params.reserved_address_space_size = 0; - if (libespresso->create_isolate(¶ms, &isolate, &thread) != 0) { + if (libjavavm->create_isolate(¶ms, &isolate, &thread) != 0) { return JNI_ERR; } struct JavaVM_ *espressoJavaVM; struct JNIEnv_ *espressoJNIEnv; - int ret = libespresso->Espresso_CreateJavaVM(thread, &espressoJavaVM, &espressoJNIEnv, initArgs); + int ret = libjavavm->Espresso_CreateJavaVM(thread, &espressoJavaVM, &espressoJNIEnv, initArgs); if (ret != JNI_OK) { - libespresso->detach_all_threads_and_tear_down_isolate(thread); + libjavavm->detach_all_threads_and_tear_down_isolate(thread); return ret; } ((struct JNIInvokeInterface_ *) espressoJavaVM->functions)->reserved1 = MOKA_AMERICANO; JavaVM *vm = malloc(sizeof(JavaVM)); if (vm == NULL) { - libespresso->detach_all_threads_and_tear_down_isolate(thread); + libjavavm->detach_all_threads_and_tear_down_isolate(thread); return JNI_ENOMEM; } struct JNIInvokeInterface_ *vmInterface = malloc(sizeof(struct JNIInvokeInterface_)); if (vmInterface == NULL) { free(vm); - libespresso->detach_all_threads_and_tear_down_isolate(thread); + libjavavm->detach_all_threads_and_tear_down_isolate(thread); return JNI_ENOMEM; } - LibEspressoIsolate *espressoIsolate = malloc(sizeof(LibEspressoIsolate)); - espressoIsolate->lib = libespresso; + LibJavaVMIsolate *espressoIsolate = malloc(sizeof(LibJavaVMIsolate)); + espressoIsolate->lib = libjavavm; espressoIsolate->isolate = isolate; espressoIsolate->is_sun_standard_launcher = is_sun_standard_launcher; vmInterface->reserved0 = espressoIsolate; From 38abc27ea5b7a6b1dcbfd8e116bcb98fc4acd92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=C2=B2=20Peterssen?= Date: Tue, 22 Feb 2022 23:35:54 +0100 Subject: [PATCH 2/5] Fix lib:espresso/sespresso references. --- espresso/mx.espresso/mx_espresso.py | 10 +++++----- vm/mx.vm/ce-aarch64-complete | 2 +- vm/mx.vm/ce-complete | 2 +- vm/mx.vm/ce-darwin-complete | 2 +- vm/mx.vm/ce-win-complete | 2 +- vm/mx.vm/mx_vm.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/espresso/mx.espresso/mx_espresso.py b/espresso/mx.espresso/mx_espresso.py index 035688dee049..9b644cfd5cd3 100644 --- a/espresso/mx.espresso/mx_espresso.py +++ b/espresso/mx.espresso/mx_espresso.py @@ -302,8 +302,8 @@ def mx_register_dynamic_suite_constituents(register_project, register_distributi # Build configs # pylint: disable=bad-whitespace tools = ['cov', 'dap', 'ins', 'insight', 'insightheap', 'lsp', 'pro', 'vvm'] -mx_sdk_vm.register_vm_config('espresso-jvm', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp' , 'elau' ] + tools, _suite, env_file='jvm') -mx_sdk_vm.register_vm_config('espresso-jvm-ce', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp' , 'svm', 'svmnfi' , 'tflm', 'elau', 'lg', 'bespresso', 'sespresso', 'spolyglot'] + tools, _suite, env_file='jvm-ce') -mx_sdk_vm.register_vm_config('espresso-jvm-ee', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp', 'cmpee', 'svm', 'svmnfi', 'svmee', 'tflm', 'elau', 'lg', 'bespresso', 'sespresso', 'spolyglot'] + tools, _suite, env_file='jvm-ee') -mx_sdk_vm.register_vm_config('espresso-native-ce', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp' , 'svm', 'svmnfi' , 'tflm' , 'spolyglot'] + tools, _suite, env_file='native-ce') -mx_sdk_vm.register_vm_config('espresso-native-ee', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp', 'cmpee', 'svm', 'svmnfi', 'svmee', 'tflm' , 'spolyglot'] + tools, _suite, env_file='native-ee') +mx_sdk_vm.register_vm_config('espresso-jvm', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp' , 'elau' ] + tools, _suite, env_file='jvm') +mx_sdk_vm.register_vm_config('espresso-jvm-ce', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp' , 'svm', 'svmnfi' , 'tflm', 'elau', 'lg', 'bespresso', 'sjavavm', 'spolyglot'] + tools, _suite, env_file='jvm-ce') +mx_sdk_vm.register_vm_config('espresso-jvm-ee', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp', 'cmpee', 'svm', 'svmnfi', 'svmee', 'tflm', 'elau', 'lg', 'bespresso', 'sjavavm', 'spolyglot'] + tools, _suite, env_file='jvm-ee') +mx_sdk_vm.register_vm_config('espresso-native-ce', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp' , 'svm', 'svmnfi' , 'tflm' , 'spolyglot'] + tools, _suite, env_file='native-ce') +mx_sdk_vm.register_vm_config('espresso-native-ee', ['java', 'ejvm', 'libpoly', 'nfi-libffi', 'nfi', 'sdk', 'tfl', 'cmp', 'cmpee', 'svm', 'svmnfi', 'svmee', 'tflm' , 'spolyglot'] + tools, _suite, env_file='native-ee') diff --git a/vm/mx.vm/ce-aarch64-complete b/vm/mx.vm/ce-aarch64-complete index fe8a55999fbd..8bc0d2d32afa 100644 --- a/vm/mx.vm/ce-aarch64-complete +++ b/vm/mx.vm/ce-aarch64-complete @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/espresso,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,/wasm,truffleruby COMPONENTS=cmp,cov,dap,ejvm,gu,gvm,gwa,icu4j,ins,insight,insightheap,java,js,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,ni,nic,nil,njs,poly,polynative,pro,rby,rbyl,rgx,sdk,svm,svml,svmnfi,tfl,tflm,vvm -NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang++,graalvm-native-ld,gu,lib:jsvm,lib:espresso,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lli,native-image,lib:rubyvm,wasm +NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang++,graalvm-native-ld,gu,lib:jsvm,lib:javavm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lli,native-image,lib:rubyvm,wasm DISABLE_INSTALLABLES=False diff --git a/vm/mx.vm/ce-complete b/vm/mx.vm/ce-complete index a8a5ed381a33..e55b459eec18 100644 --- a/vm/mx.vm/ce-complete +++ b/vm/mx.vm/ce-complete @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/espresso,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,/wasm,fastr,graalpython,truffleruby COMPONENTS=cmp,cov,dap,ellvm,ejvm,gu,gvm,gwa,icu4j,ins,insight,insightheap,java,js,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,nfi,ni,nic,nil,njs,poly,polynative,pro,pyn,pynl,R,rby,rbyl,rgx,sdk,svm,svml,svmnfi,tfl,tflm,vvm -NATIVE_IMAGES=graalpython,graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang++,graalvm-native-ld,gu,lib:jsvm,lib:espresso,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lli,native-image,lib:rubyvm,wasm +NATIVE_IMAGES=graalpython,graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang++,graalvm-native-ld,gu,lib:jsvm,lib:javavm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lli,native-image,lib:rubyvm,wasm DISABLE_INSTALLABLES=false diff --git a/vm/mx.vm/ce-darwin-complete b/vm/mx.vm/ce-darwin-complete index dd679739b9d1..3ed3ccfa61f6 100644 --- a/vm/mx.vm/ce-darwin-complete +++ b/vm/mx.vm/ce-darwin-complete @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/espresso,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,/wasm,fastr,graalpython,truffleruby COMPONENTS=cmp,cov,dap,ejvm,gu,gvm,gwa,icu4j,ins,insight,insightheap,java,js,lg,llp,llrc,llrl,llrn,lsp,nfi,ni,nic,nil,njs,poly,polynative,pro,pyn,pynl,R,rby,rbyl,rgx,sdk,svm,svml,svmnfi,tfl,tflm,vvm -NATIVE_IMAGES=graalpython,graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang++,graalvm-native-ld,gu,lib:jsvm,lib:espresso,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lli,native-image,lib:rubyvm,wasm +NATIVE_IMAGES=graalpython,graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang++,graalvm-native-ld,gu,lib:jsvm,lib:javavm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lli,native-image,lib:rubyvm,wasm DISABLE_INSTALLABLES=false diff --git a/vm/mx.vm/ce-win-complete b/vm/mx.vm/ce-win-complete index 7dbd7c10bd92..21b0b238318d 100644 --- a/vm/mx.vm/ce-win-complete +++ b/vm/mx.vm/ce-win-complete @@ -1,4 +1,4 @@ DYNAMIC_IMPORTS=/compiler,/espresso,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/tools,/truffle,/wasm COMPONENTS=cmp,cov,dap,ejvm,gu,gvm,gwa,icu4j,ins,insight,insightheap,java,js,lg,lsp,nfi-libffi,ni,nic,nil,njs,poly,polynative,pro,rgx,sdk,svm,svmnfi,tfl,tflm,vvm -NATIVE_IMAGES=gu,lib:jsvm,lib:espresso,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image,wasm +NATIVE_IMAGES=gu,lib:jsvm,lib:javavm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image,wasm DISABLE_INSTALLABLES=False diff --git a/vm/mx.vm/mx_vm.py b/vm/mx.vm/mx_vm.py index 4c3e79a2996d..d7082f2c0007 100644 --- a/vm/mx.vm/mx_vm.py +++ b/vm/mx.vm/mx_vm.py @@ -167,7 +167,7 @@ mx_sdk_vm.register_vm_config('toolchain-only', ['sdk', 'tfl', 'tflm', 'nfi-libffi', 'nfi', 'cmp', 'svm', 'svmnfi', 'llp', 'llrc', 'llrn'], _suite) mx_sdk_vm.register_vm_config('libgraal-bash', ['bgraalvm-native-clang', 'bgraalvm-native-clang++', 'bgraalvm-native-ld', 'bgraalvm-native-binutil', 'bgu', 'cmp', 'gu', 'gvm', 'lg', 'nfi-libffi', 'nfi', 'poly', 'polynative', 'sdk', 'svm', 'svmnfi', 'svml', 'tfl', 'tflm', 'bpolyglot'], _suite, env_file=False) mx_sdk_vm.register_vm_config('toolchain-only-bash', ['bgraalvm-native-clang', 'bgraalvm-native-clang++', 'bgraalvm-native-ld', 'bgraalvm-native-binutil', 'tfl', 'tflm', 'gu', 'svm', 'svmnfi', 'gvm', 'polynative', 'llp', 'nfi-libffi', 'nfi', 'svml', 'bgu', 'sdk', 'llrc', 'llrn', 'cmp'], _suite, env_file=False) -mx_sdk_vm.register_vm_config('ce', ['bgraalvm-native-binutil', 'bgraalvm-native-clang', 'bgraalvm-native-clang++', 'bgraalvm-native-ld', 'java', 'libpoly', 'sespresso', 'spolyglot', 'ejvm', 'sjsvm', 'blli', 'bnative-image', 'srubyvm', 'pynl', 'bgraalpython', 'pyn', 'bwasm', 'cmp', 'gwa', 'icu4j', 'js', 'lg', 'llp', 'nfi-libffi', 'nfi', 'ni', 'nil', 'pbm', 'pmh', 'pbi', 'rby', 'rbyl', 'rgx', 'sdk', 'llrc', 'llrn', 'llrl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmnfi', 'tfl', 'tflm'], _suite, env_file='polybench-ce') +mx_sdk_vm.register_vm_config('ce', ['bgraalvm-native-binutil', 'bgraalvm-native-clang', 'bgraalvm-native-clang++', 'bgraalvm-native-ld', 'java', 'libpoly', 'sjavavm', 'spolyglot', 'ejvm', 'sjsvm', 'blli', 'bnative-image', 'srubyvm', 'pynl', 'bgraalpython', 'pyn', 'bwasm', 'cmp', 'gwa', 'icu4j', 'js', 'lg', 'llp', 'nfi-libffi', 'nfi', 'ni', 'nil', 'pbm', 'pmh', 'pbi', 'rby', 'rbyl', 'rgx', 'sdk', 'llrc', 'llrn', 'llrl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmnfi', 'tfl', 'tflm'], _suite, env_file='polybench-ce') mx_sdk_vm.register_vm_config('ce', ['pbm', 'pmh', 'pbi', 'ni', 'icu4j', 'js', 'lg', 'nfi-libffi', 'nfi', 'tfl', 'svm', 'nil', 'rgx', 'sdk', 'cmp', 'tflm', 'svmnfi', 'bnative-image', 'sjsvm', 'snative-image-agent', 'snative-image-diagnostics-agent'], _suite, env_file='polybench-nfi-ce') mx_sdk_vm.register_vm_config('ce', ['bgraalvm-native-binutil', 'bgraalvm-native-clang', 'bgraalvm-native-clang++', 'bgraalvm-native-ld', 'blli', 'bnative-image', 'cmp', 'lg', 'llrc', 'llrl', 'llrn', 'nfi-libffi', 'nfi', 'ni', 'nil', 'pbm', 'pbi', 'sdk', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmnfi', 'tfl', 'tflm'], _suite, env_file='polybench-sulong-ce') From af676278959b2531946937c0aaa23061e12ffb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=C2=B2=20Peterssen?= Date: Wed, 23 Feb 2022 00:15:17 +0100 Subject: [PATCH 3/5] Fix libjavavm_dynamic.h header consistency. --- .../include/libjavavm_dynamic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/espresso/src/com.oracle.truffle.espresso.mokapot/include/libjavavm_dynamic.h b/espresso/src/com.oracle.truffle.espresso.mokapot/include/libjavavm_dynamic.h index d86a18b168cf..42290addfd35 100644 --- a/espresso/src/com.oracle.truffle.espresso.mokapot/include/libjavavm_dynamic.h +++ b/espresso/src/com.oracle.truffle.espresso.mokapot/include/libjavavm_dynamic.h @@ -20,8 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -#ifndef __LIBESPRESSO_H -#define __LIBESPRESSO_H +#ifndef __LIBJAVAVM_H +#define __LIBJAVAVM_H #include From 61766546e4ba858a8ab6c2da43d4eac4a576909b Mon Sep 17 00:00:00 2001 From: Matthias Neugschwandtner Date: Wed, 23 Feb 2022 11:00:30 +0100 Subject: [PATCH 4/5] Use LanguageLibraryConfig for Espresso libjavavm --- espresso/mx.espresso/mx_espresso.py | 11 +++++------ sdk/mx.sdk/mx_sdk_vm_impl.py | 14 ++++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/espresso/mx.espresso/mx_espresso.py b/espresso/mx.espresso/mx_espresso.py index 9b644cfd5cd3..1c214dad05dc 100644 --- a/espresso/mx.espresso/mx_espresso.py +++ b/espresso/mx.espresso/mx_espresso.py @@ -165,18 +165,17 @@ def _espresso_gate_runner(args, tasks): lib_javavm_cp = '${GRAALVM_HOME}/lib/graalvm/lib-javavm.jar' -espresso_library_config = mx_sdk_vm.LibraryConfig( - destination='lib/', +espresso_library_config = mx_sdk_vm.LanguageLibraryConfig( + language='java', jar_distributions=['espresso:LIB_JAVAVM'], build_args=[ - '--language:java', - '--tool:all', - '-H:+EnableSignalAPI', + '-H:-JNIExportSymbols', '-R:+EnableSignalHandling', '-R:+InstallSegfaultHandler', '--features=com.oracle.truffle.espresso.ref.FinalizationFeature', + '--initialize-at-run-time=org.graalvm.launcher.AbstractLanguageLauncher', ], - home_finder=True, + main_class="com.oracle.truffle.espresso.launcher.EspressoLauncher", ) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( diff --git a/sdk/mx.sdk/mx_sdk_vm_impl.py b/sdk/mx.sdk/mx_sdk_vm_impl.py index 0e8538c6c644..d43b3985e4c1 100644 --- a/sdk/mx.sdk/mx_sdk_vm_impl.py +++ b/sdk/mx.sdk/mx_sdk_vm_impl.py @@ -712,7 +712,7 @@ def _find_escaping_links(root_dir): _add(layout, _svm_library_dest, _source_type + ':' + _library_project_name, _component) if not isinstance(_library_config, mx_sdk.LanguageLibraryConfig): _add(layout, _svm_library_home, _source_type + ':' + _library_project_name + '/*.h', _component) - if not stage1 and isinstance(_library_config, mx_sdk.LanguageLibraryConfig): + if not stage1 and isinstance(_library_config, mx_sdk.LanguageLibraryConfig) and _library_config.launchers: _add(layout, _component_base, 'dependency:{}/polyglot.config'.format(PolyglotConfig.project_name(_library_config)), _component) # add native launchers for language libraries for _executable in _library_config.launchers: @@ -1290,6 +1290,12 @@ def contents(self): '-Dorg.graalvm.launcher.relative.home=' + relpath(graalvm_image_destination, graalvm_home), ] + if isinstance(image_config, mx_sdk.LauncherConfig) or (isinstance(image_config, mx_sdk.LanguageLibraryConfig) and image_config.launchers): + build_args += [ + '--install-exit-handlers', + '-H:+AllowVMInspection' + ] + if isinstance(image_config, (mx_sdk.LauncherConfig, mx_sdk.LanguageLibraryConfig)): if image_config.is_sdk_launcher: launcher_classpath = NativePropertiesBuildTask.get_launcher_classpath(graalvm_dist, graalvm_home, image_config, self.subject.component, exclude_implicit=True) @@ -1297,10 +1303,6 @@ def contents(self): if isinstance(image_config, mx_sdk.LauncherConfig): build_args += ['-H:-ParseRuntimeOptions'] - build_args += [ - '--install-exit-handlers', - '-H:+AllowVMInspection' - ] if has_component('svmee', stage1=True): build_args += [ '-R:-UsePerfData' @@ -2774,7 +2776,7 @@ def mx_register_dynamic_suite_constituents(register_project, register_distributi assert with_svm register_project(GraalVmNativeProperties(component, library_config)) needs_stage1 = True # library configs need a stage1 even when they are skipped - if isinstance(library_config, mx_sdk.LanguageLibraryConfig): + if isinstance(library_config, mx_sdk.LanguageLibraryConfig) and library_config.launchers: launcher_project = NativeLibraryLauncherProject(component, library_config) register_project(launcher_project) polyglot_config_project = PolyglotConfig(component, library_config) From 832c4da082d9f83b71dffcb8e554559e599103ff Mon Sep 17 00:00:00 2001 From: Matthias Neugschwandtner Date: Thu, 24 Feb 2022 12:11:43 +0100 Subject: [PATCH 5/5] Do not include EspressoLauncher in libespresso --- espresso/mx.espresso/mx_espresso.py | 2 -- sdk/mx.sdk/mx_sdk_vm.py | 4 +++- sdk/mx.sdk/mx_sdk_vm_impl.py | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/espresso/mx.espresso/mx_espresso.py b/espresso/mx.espresso/mx_espresso.py index 1c214dad05dc..946045065294 100644 --- a/espresso/mx.espresso/mx_espresso.py +++ b/espresso/mx.espresso/mx_espresso.py @@ -173,9 +173,7 @@ def _espresso_gate_runner(args, tasks): '-R:+EnableSignalHandling', '-R:+InstallSegfaultHandler', '--features=com.oracle.truffle.espresso.ref.FinalizationFeature', - '--initialize-at-run-time=org.graalvm.launcher.AbstractLanguageLauncher', ], - main_class="com.oracle.truffle.espresso.launcher.EspressoLauncher", ) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( diff --git a/sdk/mx.sdk/mx_sdk_vm.py b/sdk/mx.sdk/mx_sdk_vm.py index 5ee64e0c7396..5f7ed11acf2b 100644 --- a/sdk/mx.sdk/mx_sdk_vm.py +++ b/sdk/mx.sdk/mx_sdk_vm.py @@ -206,13 +206,15 @@ def __init__(self, destination, jar_distributions, build_args, jvm_library=False class LanguageLibraryConfig(LibraryConfig): - def __init__(self, jar_distributions, main_class, build_args, language, is_sdk_launcher=True, launchers=None, option_vars=None, **kwargs): + def __init__(self, jar_distributions, build_args, language, main_class=None, is_sdk_launcher=True, launchers=None, option_vars=None, **kwargs): """ :param str language :param str main_class """ kwargs.pop('destination', None) super(LanguageLibraryConfig, self).__init__('lib/', jar_distributions, build_args, home_finder=True, **kwargs) + if not launchers: + assert not main_class self.is_sdk_launcher = is_sdk_launcher self.main_class = main_class self.language = language diff --git a/sdk/mx.sdk/mx_sdk_vm_impl.py b/sdk/mx.sdk/mx_sdk_vm_impl.py index d43b3985e4c1..41c32ec8243e 100644 --- a/sdk/mx.sdk/mx_sdk_vm_impl.py +++ b/sdk/mx.sdk/mx_sdk_vm_impl.py @@ -1276,10 +1276,9 @@ def contents(self): build_args += ['--language:' + image_config.language, '--tool:all'] if isinstance(image_config, mx_sdk.LanguageLibraryConfig): - build_args += [ - '-Dorg.graalvm.launcher.class=' + image_config.main_class, - '-H:+EnableSignalAPI', - ] + build_args += ['-H:+EnableSignalAPI'] + if image_config.main_class: + build_args += ['-Dorg.graalvm.launcher.class=' + image_config.main_class] source_type = 'skip' if isinstance(image_config, mx_sdk.LibraryConfig) and _skip_libraries(image_config) else 'dependency' graalvm_image_destination = graalvm_dist.find_single_source_location(source_type + ':' + project_name_f(image_config)) @@ -1293,7 +1292,7 @@ def contents(self): if isinstance(image_config, mx_sdk.LauncherConfig) or (isinstance(image_config, mx_sdk.LanguageLibraryConfig) and image_config.launchers): build_args += [ '--install-exit-handlers', - '-H:+AllowVMInspection' + '-H:+AllowVMInspection', ] if isinstance(image_config, (mx_sdk.LauncherConfig, mx_sdk.LanguageLibraryConfig)):