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 6, 2023
2 parents 56588ba + a695404 commit f2cf7ef
Show file tree
Hide file tree
Showing 180 changed files with 1,070 additions and 495 deletions.
1 change: 1 addition & 0 deletions java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ def extra_image_build_argument(self, benchmark, args):
'-H:+AllowFoldMethods',
'-H:-UseServiceLoaderFeature',
'-H:+AllowDeprecatedBuilderClassesOnImageClasspath', # needs to be removed once GR-41746 is fixed
'-H:+DisableSubstitutionReturnTypeCheck', # remove once Quarkus fixed their substitutions (GR-48152)
]) + super(BaseQuarkusBenchmarkSuite, self).extra_image_build_argument(benchmark, args)


Expand Down
25 changes: 25 additions & 0 deletions sdk/mx.sdk/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,19 @@ class UniversalDetector {
"javac.lint.overrides": 'none',
"jacoco": "exclude",
},
"org.graalvm.maven.downloader" : {
"subDir" : "src",
"sourceDirs" : ["src"],
"javaCompliance" : "17+",
"license" : "UPL",
"dependencies": [
"sdk:NATIVEIMAGE",
],
"requires": [
"java.logging",
"java.xml",
],
},
},
"licenses" : {
"UPL" : {
Expand Down Expand Up @@ -755,6 +768,18 @@ class UniversalDetector {
},
},

"MAVEN_DOWNLOADER": {
"defaultBuild": False,
"mainClass": "org.graalvm.maven.downloader.Main",
"dependencies": [
"org.graalvm.maven.downloader",
],
"distDependencies": [
"sdk:NATIVEIMAGE",
],
"maven": False,
},

"SDK_TEST" : {
"subDir" : "src",
"dependencies" : [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,41 @@
* Copyright (c) 2023, 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.
* The Universal Permissive License (UPL), Version 1.0
*
* 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).
* Subject to the condition set forth below, permission is hereby granted to any
* person obtaining a copy of this software, associated documentation and/or
* data (collectively the "Software"), free of charge and under any and all
* copyright rights in the Software, and any and all patent rights owned or
* freely licensable by each licensor hereunder covering either (i) the
* unmodified Software as contributed to or provided by such licensor, or (ii)
* the Larger Works (as defined below), to deal in both
*
* 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.
* (a) the Software, and
*
* 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.
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
* one is included with the Software each a "Larger Work" to which the Software
* is contributed by such licensors),
*
* without restriction, including without limitation the rights to copy, create
* derivative works of, display, perform, and distribute the Software and make,
* use, sell, offer for sale, import, export, have made, and have sold the
* Software and the Larger Work(s), and to sublicense the foregoing rights on
* either these or other terms.
*
* This license is subject to the following condition:
*
* The above copyright notice and either this complete permission notice or at a
* minimum a reference to the UPL must be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.maven.downloader;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,41 @@
* Copyright (c) 2023, 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.
* The Universal Permissive License (UPL), Version 1.0
*
* 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).
* Subject to the condition set forth below, permission is hereby granted to any
* person obtaining a copy of this software, associated documentation and/or
* data (collectively the "Software"), free of charge and under any and all
* copyright rights in the Software, and any and all patent rights owned or
* freely licensable by each licensor hereunder covering either (i) the
* unmodified Software as contributed to or provided by such licensor, or (ii)
* the Larger Works (as defined below), to deal in both
*
* 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.
* (a) the Software, and
*
* 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.
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
* one is included with the Software each a "Larger Work" to which the Software
* is contributed by such licensors),
*
* without restriction, including without limitation the rights to copy, create
* derivative works of, display, perform, and distribute the Software and make,
* use, sell, offer for sale, import, export, have made, and have sold the
* Software and the Larger Work(s), and to sublicense the foregoing rights on
* either these or other terms.
*
* This license is subject to the following condition:
*
* The above copyright notice and either this complete permission notice or at a
* minimum a reference to the UPL must be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.maven.downloader;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,41 @@
* Copyright (c) 2023, 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.
* The Universal Permissive License (UPL), Version 1.0
*
* 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).
* Subject to the condition set forth below, permission is hereby granted to any
* person obtaining a copy of this software, associated documentation and/or
* data (collectively the "Software"), free of charge and under any and all
* copyright rights in the Software, and any and all patent rights owned or
* freely licensable by each licensor hereunder covering either (i) the
* unmodified Software as contributed to or provided by such licensor, or (ii)
* the Larger Works (as defined below), to deal in both
*
* 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.
* (a) the Software, and
*
* 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.
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
* one is included with the Software each a "Larger Work" to which the Software
* is contributed by such licensors),
*
* without restriction, including without limitation the rights to copy, create
* derivative works of, display, perform, and distribute the Software and make,
* use, sell, offer for sale, import, export, have made, and have sold the
* Software and the Larger Work(s), and to sublicense the foregoing rights on
* either these or other terms.
*
* This license is subject to the following condition:
*
* The above copyright notice and either this complete permission notice or at a
* minimum a reference to the UPL must be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.graalvm.maven.downloader;

Expand Down
6 changes: 6 additions & 0 deletions sdk/src/org.graalvm.nativeimage/snapshot.sigtest
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ innr public abstract interface static AfterImageWriteAccess
innr public abstract interface static AfterRegistrationAccess
innr public abstract interface static BeforeAnalysisAccess
innr public abstract interface static BeforeCompilationAccess
innr public abstract interface static BeforeHeapLayoutAccess
innr public abstract interface static BeforeImageWriteAccess
innr public abstract interface static BeforeUniverseBuildingAccess
innr public abstract interface static CompilationAccess
Expand All @@ -963,6 +964,7 @@ meth public void afterImageWrite(org.graalvm.nativeimage.hosted.Feature$AfterIma
meth public void afterRegistration(org.graalvm.nativeimage.hosted.Feature$AfterRegistrationAccess)
meth public void beforeAnalysis(org.graalvm.nativeimage.hosted.Feature$BeforeAnalysisAccess)
meth public void beforeCompilation(org.graalvm.nativeimage.hosted.Feature$BeforeCompilationAccess)
meth public void beforeHeapLayout(org.graalvm.nativeimage.hosted.Feature$BeforeHeapLayoutAccess)
meth public void beforeImageWrite(org.graalvm.nativeimage.hosted.Feature$BeforeImageWriteAccess)
meth public void beforeUniverseBuilding(org.graalvm.nativeimage.hosted.Feature$BeforeUniverseBuildingAccess)
meth public void cleanup()
Expand Down Expand Up @@ -1008,6 +1010,10 @@ CLSS public abstract interface static org.graalvm.nativeimage.hosted.Feature$Bef
outer org.graalvm.nativeimage.hosted.Feature
intf org.graalvm.nativeimage.hosted.Feature$CompilationAccess

CLSS public abstract interface static org.graalvm.nativeimage.hosted.Feature$BeforeHeapLayoutAccess
outer org.graalvm.nativeimage.hosted.Feature
intf org.graalvm.nativeimage.hosted.Feature$CompilationAccess

CLSS public abstract interface static org.graalvm.nativeimage.hosted.Feature$BeforeImageWriteAccess
outer org.graalvm.nativeimage.hosted.Feature
intf org.graalvm.nativeimage.hosted.Feature$FeatureAccess
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* The Universal Permissive License (UPL), Version 1.0
Expand Down Expand Up @@ -452,6 +452,15 @@ interface BeforeCompilationAccess extends CompilationAccess {
interface AfterCompilationAccess extends CompilationAccess {
}

/**
* Access methods available for {@link Feature#beforeHeapLayout}.
*
* @since 23.2
*/
@Platforms(Platform.HOSTED_ONLY.class)
interface BeforeHeapLayoutAccess extends CompilationAccess {
}

/**
* Access methods available for {@link Feature#afterHeapLayout}.
*
Expand Down Expand Up @@ -607,6 +616,16 @@ default void beforeCompilation(BeforeCompilationAccess access) {
default void afterCompilation(AfterCompilationAccess access) {
}

/**
* Handler for initializations before the native image heap and code layout.
*
* @param access The supported operations that the feature can perform at this time
*
* @since 23.2
*/
default void beforeHeapLayout(BeforeHeapLayoutAccess access) {
}

/**
* Handler for initializations after the native image heap and code layout. Objects and methods
* have their offsets assigned. At this point, no additional objects must be added to the native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,26 @@
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;

import com.oracle.svm.core.BuildPhaseProvider.ReadyForCompilation;
import com.oracle.svm.core.SubstrateOptions;
import com.oracle.svm.core.heap.UnknownPrimitiveField;

public final class KnownOffsets {
@UnknownPrimitiveField(availability = ReadyForCompilation.class) //
private int vtableBaseOffset;
@UnknownPrimitiveField(availability = ReadyForCompilation.class) //
private int vtableEntrySize;
@UnknownPrimitiveField(availability = ReadyForCompilation.class) //
private int typeIDSlotsOffset;
@UnknownPrimitiveField(availability = ReadyForCompilation.class) //
private int componentHubOffset;
@UnknownPrimitiveField(availability = ReadyForCompilation.class) //
private int javaFrameAnchorLastSPOffset;
@UnknownPrimitiveField(availability = ReadyForCompilation.class) //
private int javaFrameAnchorLastIPOffset;
@UnknownPrimitiveField(availability = ReadyForCompilation.class) //
private int vmThreadStatusOffset;
@UnknownPrimitiveField(availability = ReadyForCompilation.class) //
private int imageCodeInfoCodeStartOffset;

@Fold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
import org.graalvm.nativeimage.AnnotationAccess;
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
import org.graalvm.nativeimage.hosted.Feature;
import org.graalvm.nativeimage.hosted.Feature.BeforeHeapLayoutAccess;

import com.oracle.svm.core.SubstrateTargetDescription;
import com.oracle.svm.core.config.ConfigurationValues;
Expand Down Expand Up @@ -163,7 +163,7 @@ public SubstrateReplacements(Providers providers, SnippetReflectionProvider snip
}

@Platforms(Platform.HOSTED_ONLY.class)
public void registerImmutableObjects(Feature.CompilationAccess access) {
public void registerImmutableObjects(BeforeHeapLayoutAccess access) {
access.registerAsImmutable(this);
access.registerAsImmutable(snippetEncoding);
access.registerAsImmutable(snippetObjects);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,12 @@ public int getClassAccessFlags() {
}

@Substitute
private Object getComponentType() {
private DynamicHub getComponentType() {
return componentType;
}

@Substitute
private Object getSuperclass() {
private DynamicHub getSuperclass() {
return superHub;
}

Expand Down Expand Up @@ -791,18 +791,18 @@ private boolean isEnum() {
* We do not do the check "this.getModifiers() & ENUM) != 0" because we do not have the full
* modifier bits.
*/
return this.getSuperclass() == java.lang.Enum.class;
return toClass(getSuperclass()) == java.lang.Enum.class;
}

@KeepOriginal
private native Enum<?>[] getEnumConstants();
private native Object[] getEnumConstants();

@Substitute
public Enum<?>[] getEnumConstantsShared() {
public Object[] getEnumConstantsShared() {
if (enumConstantsReference instanceof LazyFinalReference) {
return (Enum<?>[]) ((LazyFinalReference<?>) enumConstantsReference).get();
return (Object[]) ((LazyFinalReference<?>) enumConstantsReference).get();
}
return (Enum<?>[]) enumConstantsReference;
return (Object[]) enumConstantsReference;
}

@KeepOriginal
Expand Down Expand Up @@ -962,7 +962,7 @@ public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass)
T[] result = getDeclaredAnnotationsByType(annotationClass);

if (result.length == 0 && AnnotationAccess.isAnnotationPresent(annotationClass, Inherited.class)) {
DynamicHub superClass = (DynamicHub) this.getSuperclass();
DynamicHub superClass = this.getSuperclass();
if (superClass != null) {
/* Determine if the annotation is associated with the superclass. */
result = superClass.getAnnotationsByType(annotationClass);
Expand Down Expand Up @@ -1378,7 +1378,7 @@ String computePackageName() {
String pn = null;
DynamicHub me = this;
while (me.hubIsArray()) {
me = (DynamicHub) me.getComponentType();
me = me.getComponentType();
}
if (me.isPrimitive()) {
pn = "java.lang";
Expand Down
Loading

0 comments on commit f2cf7ef

Please sign in to comment.