-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
168 changed files
with
3,339 additions
and
1,956 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 136 additions & 0 deletions
136
.../jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/InitMemoryVerificationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")); | ||
} | ||
} | ||
} |
Oops, something went wrong.