Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gluon-bot committed Sep 5, 2023
2 parents b7a18ad + f6ba25b commit 56588ba
Show file tree
Hide file tree
Showing 85 changed files with 922 additions and 906 deletions.
16 changes: 11 additions & 5 deletions ci/ci_common/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ common + common.frequencies + {

# Add a guard to `build` that prevents it from running in the gate
# for a PR that only touches *.md files, the docs, are config files for GitHub
add_excludes_guard(build):: build + {
guard+: {
excludes+: ["**.md", "<graal>/**.md", "<graal>/docs/**", "<graal>/.devcontainer/**", "<graal>/.github/**", "<graal>/vm/ce-release-artifacts.json"]
}
},
#
# To avoid skipping the deployment of some artifacts, only `gate` jobs and
# post-merges that do not have the `deploy` target are considered.
add_excludes_guard(build):: build
+ (
if (std.length(std.find('gate', build.targets)) > 0 || std.length(std.find('deploy', build.targets)) == 0) then {
guard+: {
excludes+: ["**.md", "<graal>/**.md", "<graal>/docs/**", "<graal>/.devcontainer/**", "<graal>/.github/**", "<graal>/vm/ce-release-artifacts.json"]
}
} else {}
),

// Heap settings
// *************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Oracle GraalVM container images are published in two OCR repositories: **jdk** a
Both repositories provide container images for AMD64 and AArch64 processor architectures, with a choice of Oracle Linux versions 7, 8, or 9.

Oracle GraalVM is installed in `/usr/lib64/graalvm/graalvm-java<$FeatureVersion>` where `<$FeatureVersion>` is `17`, `20`, etc.
For instance, Oracle GraalVM for JDK 17 is installed in `/usr/lib64/graalvm/graalvm-java17`. All binaries, including `java`, `javac`, `native-image`, and other binaries are available as global commands via the `alternatives` command.
For instance, Oracle GraalVM for JDK 17 is installed in `/usr/lib64/graalvm/graalvm-java17`.
All binaries, including `java`, `javac`, `native-image`, and other binaries are available as global commands via the `alternatives` command.

## Tags

Expand All @@ -36,10 +37,10 @@ The following tags are listed from the most-specific tag (at the top) to the lea
The most-specific tag is unique and always points to the same image, while the less-specific tags point to newer image variants over time.

```
17.0.8-ol9-20230725
17.0.8-ol9
17.0.8
17-ol9
17.0.8-ol9-20230904
17.0.8-ol9
17.0.8
17-ol9
17
```

Expand Down Expand Up @@ -78,7 +79,7 @@ The most-specific tag is unique and always points to the same image, while the l
3. To verify, start the container and enter the Bash session:

```bash
docker run -it --rm container-registry.oracle.com/graalvm/native-image:17 bash
docker run -it --rm --entrypoint /bin/bash container-registry.oracle.com/graalvm/native-image:17
```

To check the version of Oracle GraalVM and its installed location, run the `env` command from the Bash prompt:
Expand Down
36 changes: 24 additions & 12 deletions espresso/ci/ci_common/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ local benchmark_suites = ['dacapo', 'renaissance', 'scala-dacapo'];
dailyBench: {targets+: ['bench', 'daily'], notify_groups:: ['espresso']},
daily: {targets+: ['daily'], notify_groups:: ['espresso']},
weekly: {targets+: ['weekly'], notify_groups:: ['espresso']},
monthly: {targets+: ['monthly'], notify_groups:: ['espresso']},
weeklyBench: {targets+: ['bench', 'weekly'], notify_groups:: ['espresso']},
onDemand: {targets+: ['on-demand']},
onDemandBench: {targets+: ['bench', 'on-demand']},
Expand All @@ -79,21 +80,32 @@ local benchmark_suites = ['dacapo', 'renaissance', 'scala-dacapo'];
windows_21: graal_common.labsjdk21 + self.windows + devkits["windows-jdk21"],

// precise targets and capabilities
jdk21_gate_linux : self.gate + self.linux_amd64_21,
jdk21_gate_darwin : self.gate + self.darwin_amd64_21,
jdk21_gate_windows : self.gate + self.windows_21,
jdk21_gate_linux_amd64 : self.gate + self.linux_amd64_21,
jdk21_gate_linux_aarch64 : self.gate + self.linux_aarch64_21,
jdk21_gate_darwin_amd64 : self.gate + self.darwin_amd64_21,
jdk21_gate_darwin_aarch64 : self.gate + self.darwin_aarch64_21,
jdk21_gate_windows_amd64 : self.gate + self.windows_21,
jdk21_bench_linux : self.bench + self.linux_amd64_21 + self.x52,
jdk21_bench_darwin : self.bench + self.darwin_amd64_21,
jdk21_bench_windows : self.bench + self.windows_21,
jdk21_daily_linux : self.daily + self.linux_amd64_21,
jdk21_daily_darwin : self.daily + self.darwin_amd64_21,
jdk21_daily_windows : self.daily + self.windows_21,
jdk21_daily_linux_amd64 : self.daily + self.linux_amd64_21,
jdk21_daily_linux_aarch64 : self.daily + self.linux_aarch64_21,
jdk21_daily_darwin_amd64 : self.daily + self.darwin_amd64_21,
jdk21_daily_darwin_aarch64 : self.daily + self.darwin_aarch64_21,
jdk21_daily_windows_amd64 : self.daily + self.windows_21,
jdk21_daily_bench_linux : self.dailyBench + self.linux_amd64_21 + self.x52,
jdk21_daily_bench_darwin : self.dailyBench + self.darwin_amd64_21,
jdk21_daily_bench_windows : self.dailyBench + self.windows_21,
jdk21_weekly_linux : self.weekly + self.linux_amd64_21,
jdk21_weekly_darwin : self.weekly + self.darwin_amd64_21,
jdk21_weekly_windows : self.weekly + self.windows_21,
jdk21_weekly_linux_amd64 : self.weekly + self.linux_amd64_21,
jdk21_weekly_linux_aarch64 : self.weekly + self.linux_aarch64_21,
jdk21_weekly_darwin_amd64 : self.weekly + self.darwin_amd64_21,
jdk21_weekly_darwin_aarch64 : self.weekly + self.darwin_aarch64_21,
jdk21_weekly_windows_amd64 : self.weekly + self.windows_21,
jdk21_monthly_linux_amd64 : self.monthly + self.linux_amd64_21,
jdk21_monthly_linux_aarch64 : self.monthly + self.linux_aarch64_21,
jdk21_monthly_darwin_amd64 : self.monthly + self.darwin_amd64_21,
jdk21_monthly_darwin_aarch64 : self.monthly + self.darwin_aarch64_21,
jdk21_monthly_windows_amd64 : self.monthly + self.windows_21,
jdk21_weekly_bench_linux : self.weeklyBench + self.linux_amd64_21 + self.x52,
jdk21_weekly_bench_darwin : self.weeklyBench + self.darwin_amd64_21,
jdk21_weekly_bench_windows : self.weeklyBench + self.windows_21,
Expand Down Expand Up @@ -122,10 +134,10 @@ local benchmark_suites = ['dacapo', 'renaissance', 'scala-dacapo'];
// shared functions
_mx(env, args): ['mx', '--env', env] + args,

build_espresso(env, debug=false): {
build_espresso(env, debug=false, extra_mx_args=[]): {
run+: [
['mx', 'sversions'],
that._mx(env, (if debug then ['--debug-images'] else []) + ['build']),
that._mx(env, (if debug then ['--debug-images'] else []) + extra_mx_args + ['build']),
],
},

Expand Down Expand Up @@ -238,6 +250,6 @@ local benchmark_suites = ['dacapo', 'renaissance', 'scala-dacapo'];

builds: [
// Gates
that.jdk21_gate_linux + that.eclipse + that.jdt + that.espresso_gate(allow_warnings=false, tags='style,fullbuild', timelimit='35:00', name='gate-espresso-style-jdk21-linux-amd64'),
that.jdk21_gate_linux_amd64 + that.eclipse + that.jdt + that.espresso_gate(allow_warnings=false, tags='style,fullbuild', timelimit='35:00', name='gate-espresso-style-jdk21-linux-amd64'),
],
}
4 changes: 0 additions & 4 deletions espresso/mx.espresso/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@
"platformDependent": True,
"use_jdk_headers": True,
"buildDependencies": [
"truffle:TRUFFLE_NFI_NATIVE",
"com.oracle.truffle.espresso.mokapot",
],
"os_arch": {
Expand Down Expand Up @@ -269,9 +268,6 @@
"deliverable": "jvm",
"platformDependent": True,
"use_jdk_headers": True,
"buildDependencies": [
"truffle:TRUFFLE_NFI_NATIVE",
],
"os_arch": {
"darwin": {
"<others>": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#ifndef _JVMTI_ENV_H
#define _JVMTI_ENV_H

#include <trufflenfi.h>
#include <jni.h>

#include <stddef.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#ifndef _MANAGEMENT_H
#define _MANAGEMENT_H

#include <trufflenfi.h>
#include <jni.h>

JNIEXPORT void* JNICALL initializeManagementContext(void* (*fetch_by_name)(const char *), const int version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@

#include "libjavavm_dynamic.h"

#include <trufflenfi.h>
#include <stddef.h>
#include <stdint.h>
#include <errno.h>

struct MokapotNativeInterface_;
struct MokapotEnv_;
Expand Down Expand Up @@ -1040,4 +1038,9 @@ typedef struct LibJavaVMIsolate {
jboolean is_sun_standard_launcher; // -Dsun.java.launcher=SUN_STANDARD
} LibJavaVMIsolate;

// see DowncallLinker::capture_state and CapturableState
#define CAPTURABLE_STATE_GET_LAST_ERROR (1 << 0)
#define CAPTURABLE_STATE_WSA_GET_LAST_ERROR (1 << 1)
#define CAPTURABLE_STATE_ERRNO (1 << 2)

#endif // _MOKAPOT_H
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ SUNWprivate_1.1 {
mokapotAttachThread;
mokapotGetRTLD_DEFAULT;
mokapotGetProcessHandle;
mokapotCaptureState;
getPackageAt;

# Espresso management native API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "jvmti_env.h"
#include "structs.h"

#include <trufflenfi.h>
#include <jni.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "management.h"
#include "jmm_common.h"

#include <trufflenfi.h>
#include <jni.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "management.h"
#include "jmm1.h"

#include <trufflenfi.h>
#include <jni.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "management.h"
#include "jmm2.h"

#include <trufflenfi.h>
#include <jni.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "management.h"
#include "jmm3.h"

#include <trufflenfi.h>
#include <jni.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "management.h"
#include "jmm4.h"

#include <trufflenfi.h>
#include <jni.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
25 changes: 24 additions & 1 deletion espresso/src/com.oracle.truffle.espresso.mokapot/src/mokapot.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@
* questions.
*/
#define _JNI_IMPLEMENTATION_
#if defined(_WIN32)
#include <winsock2.h>
#include <windows.h>
#endif

#include "mokapot.h"

#include <trufflenfi.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>


OS_THREAD_LOCAL MokapotEnv* tls_moka_env = NULL;

Expand All @@ -46,6 +52,23 @@ JNIEXPORT OS_DL_HANDLE JNICALL mokapotGetProcessHandle() {
return os_get_ProcessHandle();
}

JNIEXPORT void mokapotCaptureState(int32_t* addr, jint mask) {
// see DowncallLinker::capture_state
#if defined(_WIN32)
if (mask & CAPTURABLE_STATE_GET_LAST_ERROR) {
*addr = GetLastError();
}
addr++;
if (mask & CAPTURABLE_STATE_WSA_GET_LAST_ERROR) {
*addr = WSAGetLastError();
}
addr++;
#endif
if (mask & CAPTURABLE_STATE_ERRNO) {
*addr = errno;
}
}

#define JNI_INVOKE_INTERFACE_METHODS(V) \
V(DestroyJavaVM) \
V(AttachCurrentThread) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "jvmti.h"
#include "structs.h"

#include <trufflenfi.h>
#include <jni.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#define _NESPRESSO_H

#include <jni.h>
#include <trufflenfi.h>

struct Varargs {
const struct VarargsInterface* functions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <mokapot.h>
#include <jni.h>
#include <trufflenfi.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ public static void ensureInitialized() {
public static final Symbol<Name> HIDDEN_THREAD_BLOCKED_COUNT = StaticSymbols.putName("0HIDDEN_THREAD_BLOCKED_COUNT");
public static final Symbol<Name> HIDDEN_THREAD_WAITED_COUNT = StaticSymbols.putName("0HIDDEN_THREAD_WAITED_COUNT");
public static final Symbol<Name> HIDDEN_THREAD_DEPTH_FIRST_NUMBER = StaticSymbols.putName("0HIDDEN_THREAD_DEPTH_FIRST_NUMBER");
public static final Symbol<Name> HIDDEN_THREAD_SCOPED_VALUE_CACHE = StaticSymbols.putName("0HIDDEN_THREAD_SCOPED_VALUE_CACHE");

// Class
public static final Symbol<Name> HIDDEN_MIRROR_KLASS = StaticSymbols.putName("0HIDDEN_MIRROR_KLASS");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,24 @@ public interface NativeSignature {
*/
int getParameterCount();

/**
* Number of varargs parameters.
*/
int getVarArgsParameterCount();

/**
* Returns the i-th (0-based) parameter type, guaranteed to be != {@link NativeType#VOID void}.
*
* @throws IndexOutOfBoundsException if the index is negative or >= {@link #getParameterCount()}
* + {@link #getVarArgsParameterCount()}.
*/
NativeType parameterTypeAt(int index);

static NativeSignature create(NativeType returnType, NativeType... parameterTypes) {
return new NativeSignatureImpl(returnType, parameterTypes);
}

static NativeSignature createVarArg(NativeType returnType, NativeType[] parameterTypes, NativeType[] varArgsParameterTypes) {
return new NativeSignatureImpl(returnType, parameterTypes, varArgsParameterTypes);
}
}
Loading

0 comments on commit 56588ba

Please sign in to comment.