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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/ci/ci_common/benchmark-suites.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@

barista_template(suite_version=null, suite_name="barista", max_jdk_version=null, cmd_app_prefix=["hwloc-bind --cpubind node:0.core:0-3.pu:0 --membind node:0"], non_prefix_barista_args=[]):: cc.compiler_benchmark + {
suite:: suite_name,
local barista_version = "v0.4.7",
local barista_version = "v0.4.8",
local suite_version_args = if suite_version != null then ["--bench-suite-version=" + suite_version] else [],
local prefix_barista_arg = if std.length(cmd_app_prefix) > 0 then [std.format("--cmd-app-prefix=%s", std.join(" ", cmd_app_prefix))] else [],
local all_barista_args = prefix_barista_arg + non_prefix_barista_args,
local barista_args_with_separator = if std.length(all_barista_args) > 0 then ["--"] + all_barista_args else [],
downloads+: {
"WRK": { "name": "wrk", "version": "a211dd5", platformspecific: true},
"WRK2": { "name": "wrk2", "version": "2.1", platformspecific: true},
"BARISTA_BENCHMARKS": { "name": "barista", "version": "0.4.7"}
"BARISTA_BENCHMARKS": { "name": "barista", "version": "0.4.8"}
},
packages+: {
maven: "==3.8.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ public static String digest(byte[] bytes, int offset, int length) {
* new byte array.
*/
public static byte[] digestAsByteArray(byte[] bytes, int offset, int length) {
LongLong hash = MurmurHash3_x64_128(bytes, offset, length, HASH_SEED);
return longLongToByteArray(MurmurHash3_x64_128(bytes, offset, length, HASH_SEED));
}

private static byte[] longLongToByteArray(LongLong hash) {
byte[] array = new byte[DIGEST_SIZE];
encodeBase62(hash.l1, array, 0);
encodeBase62(hash.l2, array, BASE62_DIGITS_PER_LONG);
Expand Down Expand Up @@ -281,4 +283,20 @@ private static long fmix64(long input) {

return k;
}

public static final class DigestBuilder {
private LongLong digest;

public DigestBuilder() {
digest = new LongLong(0L, 0L);
}

public void update(byte[] input) {
digest = MurmurHash3_x64_128(input, 0, input.length, digest.l1 ^ digest.l2);
}

public byte[] digest() {
return longLongToByteArray(digest);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ Args = --layer-create=@layer-create.args
The `layer-create.args` file-path is relative to the directory that contains the `native-image.properties` file and might look like this:
```
base-layer.nil
# ignore this classpath/modulepath entry during layer compatibility checks
digest-ignore
module=java.base
# micronaut and dependencies
package=io.micronaut.*
Expand All @@ -129,6 +131,13 @@ package=org.reactivestreams.*
Each line corresponds to one entry in the list of comma-separated entries that can usually be found in a regular `--layer-create` argument.
Lines starting with `#` are ignored and can therefore be used to provide comments in such an option argument file.

Note the use of the `digest-ignore` suboption in the `layer-create.args` example file above.
This suboption _only takes effect_ when the `--layer-create` option is specified _within a file_, and is ignored if provided via the command line.
When defining `--layer-create` in a file, always include this suboption (see [compatibility rules](#compatibility-rules)).

Avoid placing other class or resource files in the same classpath/modulepath entry as the file(s) defining `--layer-create`.
These files would be excluded from compatibility checks, potentially leading to subtle, difficult-to-debug issues.

### Option `--layer-use` consumes a shared layer, and can extend it or create a final executable:

```
Expand Down Expand Up @@ -195,16 +204,31 @@ native-image --module-path target/AwesomeLib-1.0-SNAPSHOT.jar --shared

### Compatibility rules

Currently, layer build compatibility checking is very limited and is only performed for the image builder arguments.
Layer build compatibility checks are performed to ensure the consistency of _image builder arguments_ and _classpath/modulepath entries_.
These will be covered in the following subsections.

#### Image builder arguments compatibility

The list below gives a few examples of checks that are already implemented.

- Module system options `--add-exports`, `--add-opens`, `--add-reads` that were passed in the previous image build also need to be passed in the current image build.
Note that additional module system options not found in the previous image build are allowed to be used in the current image build.
- Builder options of the form `-H:NeverInline=<pattern>` follow the same logic as the module system options above.
- If debug option `-g` was passed in the previous image build it must also be passed in the current image build at the same position.
- Other options like `-H:EntryPointNamePrefix=...`, `-H:APIFunctionPrefix=...`, ... follow the same logic as the `-g` option.
- Environment variables provided using `-E` to the previous image build must be passed to the current image build, with their values remaining unchanged. Additional environment variables may be supplied to the current build if needed.

#### Classpath & modulepath compatibility

The classpath/modulepath entries used in the previous image layer build must also be included in the current image layer build.
These entries must retain the same content. If any of the shared entries are modified (.e.g, updated jar files), the previous image layer must be rebuilt with the updated versions.

For example, assume the previous layer build used the classpath: `/path/to/foo.jar:/path/to/bar.jar`.
Then the current layer build must include both `/path/to/foo.jar` and `/path/to/bar.jar`, possibly alongside additional entries: `path/to/foo.jar:/path/to/bar.jar:/path/to/extra.jar`.
Additionally, the contents of `foo.jar` and `bar.jar` should remain unchanged between the two builds.

The number of checks is subject to change and will be further improved in the future.
**Exception**: Classpath or modulepath entries that include a `native-image.properties` file specifying the `--layer-create` option with the `digest-ignore` suboption are exempt from this rule.
These entries should be _excluded_ from subsequent layer builds.

### Limitations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.net.URL;
import java.net.URLConnection;
import java.nio.ByteBuffer;
import java.nio.file.FileSystem;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -181,6 +182,13 @@ protected URLConnection openConnection(URL url) throws IOException {
final class Target_jdk_internal_jrtfs_JrtFileSystemProvider_JRTDisabled {
}

@TargetClass(className = "jdk.internal.jrtfs.JrtFileSystemProvider", onlyWith = JRTEnabled.class)
final class Target_jdk_internal_jrtfs_JrtFileSystemProvider_BuildTime {
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset)//
@Alias//
volatile FileSystem theFileSystem;
}

// endregion Disable jimage/jrtfs

@TargetClass(className = "jdk.internal.jimage.BasicImageReader")
Expand Down
Loading
Loading