Skip to content

Commit

Permalink
Merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaroslav Tulach committed Sep 25, 2024
2 parents 3e1f2b4 + 0b7ced2 commit f7c4e7d
Show file tree
Hide file tree
Showing 168 changed files with 3,339 additions and 1,956 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ permissions:
jobs:
build-graalvm-linux:
name: /${{ matrix.env.PRIMARY }} ${{ matrix.env.GATE_TAGS }} JDK${{ matrix.env.JDK_VERSION }}
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os || 'ubuntu-20.04' }}
timeout-minutes: 60
strategy:
fail-fast: false
Expand Down Expand Up @@ -120,7 +120,8 @@ jobs:
GATE_TAGS: "build,helloworld,native_unittests"
PRIMARY: "substratevm"
PIP_PACKAGES: "jsonschema==4.6.1"
- env:
- os: ubuntu-24.04
env:
JDK_VERSION: "latest"
GATE_TAGS: "build,debuginfotest"
PRIMARY: "substratevm"
Expand Down
21 changes: 21 additions & 0 deletions CENSUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The project's census with roles as defined in (CONTRIBUTING.md)[CONTRIBUTING.md).

### Project Leads
* Developer Advocate Lead
* [Alina Yurenko](https://github.com/alina-yur)
* Security Group Lead
* [Matthias Neugschwandtner](https://github.com/matneu)
* Project Lead
* [Thomas Wuerthinger](https://github.com/thomaswue)

### Technical Area Leads
* Compiler
* [Doug Simon](https://github.com/dougxc)
* Native Image
* [Christian Wimmer](https://github.com/christianwimmer)
* Truffle
* [Christian Humer](https://github.com/chumer)
* Espresso
* [Alfonso Peterssen](https://github.com/mukel)

### Committers
50 changes: 50 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,57 @@
# For Contributors

GraalVM welcomes contributors to the core platform and projects that extend that
platform. There have been significant contributions from both industry
and academia so far and we thank you for considering to contribute your changes!

### How to Contribute

- Learn [how to become a GraalVM contributor](https://www.graalvm.org/community/contributors/).
- Check individual README.md and CONTRIBUTING.md files in the subprojects to learn how to build and import them into your IDE (for example, [the compiler README.md](compiler/README.md))
- Subscribe and post to [graalvm-dev@oss.oracle.com](https://oss.oracle.com/mailman/listinfo/graalvm-dev) for questions related to working with the sources or extending the GraalVM ecosystem by creating new languages, tools, or embeddings.

### Contributor Roles

There are different roles for contributors of the project. Find a list of current contributors in [CENSUS.md](CENSUS.md).

* Committer
* Has Signed the [Oracle Contributor Agreement](https://oca.opensource.oracle.com/), which is a prerequisite for contributing to the project
* At least one pull request authored by the individual has been merged

* Code Owner
* Source code directories contain an OWNERS.toml metadata file to define one or more Code Owners.
* If there is no such file, the property of the parent directory is inherited.
* A change to the source code must be approved by at least one of the Code Owners.
* Large modifications should be discussed with the Technical Area Lead for architectural design before a pull request is created.

* Technical Area Lead
* Code Owner with primary responsibility for architecture and design of a specific area
* Has the ability to veto changes in his area on technical grounds

* Security Lead
* Organizes the vulnerability group for sharing security patches
* Reviews pull requests for aspects relevant for security
* Primary point of contact in case of discussing a potential security vulnerability

* Developer Advocacy Lead
* Manages interactions within the GraalVM Community
* Runs the Advisory Board
* Primary point of contact for enquiries related to the GraalVM community or community support

* Project Lead
* Defines an overall technical direction
* Mediates disputes over code ownership
* Appoints the Security Lead, Developer Advocacy Lead, and Technical Area Leads
* Appointed by Oracle

### Backports

For versions of GraalVM with ongoing community maintenance and backport support, a Lead Maintainer is chosen among the project contributors. That lead maintainer is responsible for managing the corresponding community backport repository. See [here](https://github.com/oracle/graal/issues/8935) an example of a call for a lead maintainer.

### Advisory Board

Apart from source code contributors to the project, there is also a role for advisory board members that discuss project matters and direction as well as drive awareness and adoption of GraalVM technology. Find a description of the advisory board and its current members [here](https://www.graalvm.org/community/advisory-board/).

### Security

Entities interested in sharing reports of vulnerabilities and collaborate on security fixes should contact the Security Lead.
2 changes: 2 additions & 0 deletions ci/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ local common_json = import "../common.json";
} + {
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: 21 }
for name in ["oraclejdk21"] + variants("labsjdk-ce-21") + variants("labsjdk-ee-21")
} + {
'oraclejdk23': jdk_base + common_json.jdks["oraclejdk23"] + { jdk_version:: 23 },
} + {
[name]: jdk_base + common_json.jdks[name] + { jdk_version:: parse_labsjdk_version(self), jdk_name:: "jdk-latest"}
for name in ["oraclejdk-latest"] + variants("labsjdk-ce-latest") + variants("labsjdk-ee-latest")
Expand Down
20 changes: 11 additions & 9 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
],

"mx_version": "7.29.6",
"mx_version": "7.31.0",

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
"galahad-jdk": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+14-1507", "platformspecific": true, "extrabundles": ["static-libs"]},
"galahad-jdk": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+15-1637", "platformspecific": true, "extrabundles": ["static-libs"]},

"oraclejdk11": {"name": "jpg-jdk", "version": "11.0.11", "build_id": "jdk-11.0.11+9", "platformspecific": true, "extrabundles": ["static-libs"] },

Expand Down Expand Up @@ -45,13 +45,15 @@
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21.0.2+13-jvmci-23.1-b33-sulong", "platformspecific": true },
"graalvm-ee-21": {"name": "graalvm-java21", "version": "23.1.3", "platformspecific": true },

"oraclejdk-latest": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+14", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24+14-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24+14-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24+14-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24+14-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24+14-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24+14-jvmci-b01-sulong", "platformspecific": true }
"oraclejdk23": {"name": "jpg-jdk", "version": "23", "build_id": "jdk-23+37", "platformspecific": true, "extrabundles": ["static-libs"]},

"oraclejdk-latest": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+16", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24+16-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24+16-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24+16-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24+16-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24+16-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24+16-jvmci-b01-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import static jdk.graal.compiler.core.common.GraalOptions.OptAssumptions;
import static org.junit.Assert.assertNotNull;

import org.junit.Test;

import jdk.graal.compiler.code.CompilationResult;
import jdk.graal.compiler.core.GraalCompiler;
import jdk.graal.compiler.core.target.Backend;
Expand All @@ -41,12 +43,10 @@
import jdk.graal.compiler.phases.tiers.HighTierContext;
import jdk.graal.compiler.phases.tiers.Suites;
import jdk.graal.compiler.phases.util.Providers;
import jdk.vm.ci.meta.ProfilingInfo;
import org.junit.Test;

import jdk.vm.ci.code.site.Call;
import jdk.vm.ci.code.site.Infopoint;
import jdk.vm.ci.code.site.InfopointReason;
import jdk.vm.ci.meta.ProfilingInfo;
import jdk.vm.ci.meta.ResolvedJavaMethod;

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

import java.util.Optional;

import org.junit.Assert;
import org.junit.Test;

import jdk.graal.compiler.debug.DebugContext;
import jdk.graal.compiler.debug.GraalError;
import jdk.graal.compiler.nodes.GraphState;
import jdk.graal.compiler.nodes.StructuredGraph;
import jdk.graal.compiler.nodes.StructuredGraph.AllowAssumptions;
import jdk.graal.compiler.nodes.extended.MembarNode;
import jdk.graal.compiler.nodes.extended.PublishWritesNode;
import jdk.graal.compiler.nodes.util.GraphUtil;
import jdk.graal.compiler.phases.BasePhase;
import jdk.graal.compiler.phases.VerifyPhase;
import jdk.graal.compiler.phases.common.InitMemoryVerificationPhase;
import jdk.graal.compiler.phases.tiers.MidTierContext;
import jdk.graal.compiler.phases.tiers.Suites;

/**
* Tests that {@link InitMemoryVerificationPhase} actually verifies the properties it aims to.
*/
public class InitMemoryVerificationTest extends GraalCompilerTest {

@SuppressWarnings("unused")
private static class TestClass {
private final int field;

TestClass(int field) {
this.field = field;
}
}

public static Object allocate(int val) {
return new TestClass(val + 2);
}

@SuppressWarnings("try")
private StructuredGraph getMidTierGraph(String snippet, Suites suites) {
StructuredGraph g = parseEager(snippet, AllowAssumptions.NO, getInitialOptions());
suites.getHighTier().apply(g, getDefaultHighTierContext());
suites.getMidTier().apply(g, getDefaultMidTierContext());
return g;
}

@Test
public void testVerificationPasses() {
StructuredGraph g = getMidTierGraph("allocate", createSuites(getInitialOptions()));
assertInGraph(g, PublishWritesNode.class, MembarNode.class);
new InitMemoryVerificationPhase().apply(g, getDefaultLowTierContext());
}

@Test
@SuppressWarnings("try")
public void testVerificationFailsWithoutPublish() {
Suites s = createSuites(getInitialOptions());
s.getMidTier().appendPhase(new BasePhase<>() {

@Override
public Optional<NotApplicable> notApplicableTo(GraphState graphState) {
return ALWAYS_APPLICABLE;
}

@Override
protected void run(StructuredGraph graph, MidTierContext context) {
for (PublishWritesNode publish : graph.getNodes().filter(PublishWritesNode.class)) {
publish.replaceAtUsages(publish.allocation());
GraphUtil.removeFixedWithUnusedInputs(publish);
}
}
});

StructuredGraph g = getMidTierGraph("allocate", s);
assertNotInGraph(g, PublishWritesNode.class);
try (DebugContext.Scope scope = getDebugContext().disable()) {
new InitMemoryVerificationPhase().apply(g, getDefaultLowTierContext());
throw new GraalError("Should fail init memory verification");
} catch (VerifyPhase.VerificationError e) {
Assert.assertTrue(e.getMessage().contains("unpublished allocations"));
}
}

@Test
@SuppressWarnings("try")
public void testVerificationFailsWithoutMembar() {
Suites s = createSuites(getInitialOptions());
s.getMidTier().appendPhase(new BasePhase<>() {
@Override
public Optional<NotApplicable> notApplicableTo(GraphState graphState) {
return ALWAYS_APPLICABLE;
}

@Override
protected void run(StructuredGraph graph, MidTierContext context) {
for (MembarNode memBar : graph.getNodes().filter(MembarNode.class)) {
GraphUtil.removeFixedWithUnusedInputs(memBar);
}
}
});

StructuredGraph g = getMidTierGraph("allocate", s);
assertNotInGraph(g, GraphUtil.class);
try (DebugContext.Scope scope = getDebugContext().disable()) {
new InitMemoryVerificationPhase().apply(g, getDefaultLowTierContext());
throw new GraalError("Should fail init memory verification");
} catch (VerifyPhase.VerificationError e) {
Assert.assertTrue(e.getMessage().contains("writes to init memory not guarded by an init barrier"));
}
}
}
Loading

0 comments on commit f7c4e7d

Please sign in to comment.