Skip to content

Commit 7962ea8

Browse files
Automatic merge of master into galahad
2 parents d866cb3 + 7a98162 commit 7962ea8

File tree

8 files changed

+42
-77
lines changed

8 files changed

+42
-77
lines changed

.github/workflows/micronaut.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
# SOFTWARE.
4040
#
41-
name: Nightly Micronaut Tests
41+
name: Weekly Micronaut Tests
4242

4343
on:
4444
push:
@@ -48,7 +48,7 @@ on:
4848
paths:
4949
- '.github/workflows/micronaut.yml'
5050
schedule:
51-
- cron: '0 2 * * *'
51+
- cron: '0 2 * * 1'
5252
workflow_dispatch:
5353

5454
env:

.github/workflows/quarkus.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
# SOFTWARE.
4040
#
41-
name: Nightly Quarkus Tests
41+
name: Weekly Quarkus Tests
4242

4343
on:
4444
push:
@@ -48,7 +48,7 @@ on:
4848
paths:
4949
- '.github/workflows/quarkus.yml'
5050
schedule:
51-
- cron: '0 3 * * *'
51+
- cron: '0 3 * * 1'
5252
workflow_dispatch:
5353

5454
env:

.github/workflows/spring.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
# SOFTWARE.
4040
#
41-
name: Nightly Spring Tests
41+
name: Weekly Spring Tests
4242

4343
on:
4444
push:
@@ -48,7 +48,7 @@ on:
4848
paths:
4949
- '.github/workflows/spring.yml'
5050
schedule:
51-
- cron: '0 4 * * *'
51+
- cron: '0 4 * * 1'
5252
workflow_dispatch:
5353

5454
env:

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHub.java

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
import static com.oracle.svm.core.code.RuntimeMetadataDecoderImpl.ALL_RECORD_COMPONENTS_FLAG;
4141
import static com.oracle.svm.core.code.RuntimeMetadataDecoderImpl.ALL_SIGNERS_FLAG;
4242
import static com.oracle.svm.core.code.RuntimeMetadataDecoderImpl.CLASS_ACCESS_FLAGS_MASK;
43-
import static com.oracle.svm.core.graal.meta.DynamicHubOffsets.writeObject;
44-
import static com.oracle.svm.core.graal.meta.DynamicHubOffsets.writeInt;
43+
import static com.oracle.svm.core.graal.meta.DynamicHubOffsets.writeByte;
4544
import static com.oracle.svm.core.graal.meta.DynamicHubOffsets.writeChar;
45+
import static com.oracle.svm.core.graal.meta.DynamicHubOffsets.writeInt;
46+
import static com.oracle.svm.core.graal.meta.DynamicHubOffsets.writeObject;
4647
import static com.oracle.svm.core.graal.meta.DynamicHubOffsets.writeShort;
47-
import static com.oracle.svm.core.graal.meta.DynamicHubOffsets.writeByte;
4848
import static com.oracle.svm.core.reflect.RuntimeMetadataDecoder.NO_DATA;
4949

5050
import java.io.InputStream;
@@ -184,7 +184,7 @@ public final class DynamicHub implements AnnotatedElement, java.lang.reflect.Typ
184184
* The returned category does not necessarily match the {@link LayoutEncoding}, see
185185
* {@link Hybrid} objects for more details.
186186
*/
187-
private final int hubType;
187+
private final byte hubType;
188188

189189
/**
190190
* Used to quickly determine if this class is a subclass of {@link Reference}.
@@ -239,17 +239,20 @@ public final class DynamicHub implements AnnotatedElement, java.lang.reflect.Typ
239239
// region open-world only fields
240240

241241
/**
242-
* This stores the depth of the type in the inheritance hierarchy. If the type is an interface
243-
* then the typeIDDepth is -1.
242+
* This stores the depth of the type in the inheritance hierarchy. If the type is an interface,
243+
* then the value is negative.
244+
*
245+
* Could be adapted so that {@link #getNumClassTypes()} can compute its value from this field,
246+
* at the cost of increased size of type checks in code.
244247
*/
245248
@UnknownPrimitiveField(availability = AfterHostedUniverse.class)//
246-
private int typeIDDepth;
249+
private short typeIDDepth;
247250

248251
@UnknownPrimitiveField(availability = AfterHostedUniverse.class)//
249-
private int numClassTypes;
252+
private short numClassTypes;
250253

251254
@UnknownPrimitiveField(availability = AfterHostedUniverse.class)//
252-
private int numInterfaceTypes;
255+
private short numInterfaceTypes;
253256

254257
/**
255258
* Array containing this type's type check id information. During a type check, these slots are
@@ -452,7 +455,7 @@ public final class DynamicHub implements AnnotatedElement, java.lang.reflect.Typ
452455
private ReflectionMetadata reflectionMetadata;
453456

454457
@Platforms(Platform.HOSTED_ONLY.class)
455-
public DynamicHub(Class<?> hostedJavaClass, String name, int hubType, ReferenceType referenceType, DynamicHub superType,
458+
public DynamicHub(Class<?> hostedJavaClass, String name, byte hubType, ReferenceType referenceType, DynamicHub superType,
456459
DynamicHub componentHub, String sourceFileName, int modifiers, short flags, ClassLoader classLoader,
457460
Class<?> nestHost, String simpleBinaryName, Object declaringClass, String signature, int layerId) {
458461
this.hostedJavaClass = hostedJavaClass;
@@ -500,7 +503,7 @@ public static DynamicHub allocate(String name, DynamicHub superHub, DynamicHub c
500503

501504
ReferenceType referenceType = ReferenceType.computeReferenceType(DynamicHub.toClass(superHub));
502505
// GR-59683: HubType.OBJECT_ARRAY?
503-
int hubTybe = referenceType == ReferenceType.None ? HubType.INSTANCE : HubType.REFERENCE_INSTANCE;
506+
byte hubType = (byte) ((referenceType == ReferenceType.None) ? HubType.INSTANCE : HubType.REFERENCE_INSTANCE);
504507

505508
DynamicHubCompanion companion = new DynamicHubCompanion(classLoader);
506509
/* Always allow unsafe allocation for classes that were loaded at run-time. */
@@ -517,9 +520,9 @@ public static DynamicHub allocate(String name, DynamicHub superHub, DynamicHub c
517520

518521
// GR-59687: Determine typecheck related infos
519522
int typeID = 0;
520-
int typeIDDepth = 0;
521-
int numClassTypes = 2;
522-
int numInterfacesTypes = 0;
523+
short typeIDDepth = 0;
524+
short numClassTypes = 2;
525+
short numInterfacesTypes = 0;
523526
int[] openTypeWorldTypeCheckSlots = new int[numClassTypes + (numInterfacesTypes * 2)];
524527

525528
byte additionalFlags = NumUtil.safeToUByte(makeFlag(IS_INSTANTIATED_BIT, true));
@@ -552,17 +555,17 @@ public static DynamicHub allocate(String name, DynamicHub superHub, DynamicHub c
552555
DynamicHubOffsets dynamicHubOffsets = DynamicHubOffsets.singleton();
553556
/* Write fields in defining order. */
554557
writeObject(hub, dynamicHubOffsets.getNameOffset(), name);
555-
writeInt(hub, dynamicHubOffsets.getHubTypeOffset(), hubTybe);
558+
writeByte(hub, dynamicHubOffsets.getHubTypeOffset(), hubType);
556559
writeByte(hub, dynamicHubOffsets.getReferenceTypeOffset(), referenceType.getValue());
557560

558561
writeInt(hub, dynamicHubOffsets.getLayoutEncodingOffset(), layoutEncoding);
559562
writeInt(hub, dynamicHubOffsets.getTypeIDOffset(), typeID);
560563
// skip typeCheckStart, typeCheckRange, typeCheckSlot and
561564
// closedTypeWorldTypeCheckSlots (closed-world only)
562-
writeInt(hub, dynamicHubOffsets.getTypeIDDepthOffset(), typeIDDepth);
563-
writeInt(hub, dynamicHubOffsets.getNumClassTypesOffset(), numClassTypes);
565+
writeShort(hub, dynamicHubOffsets.getTypeIDDepthOffset(), typeIDDepth);
566+
writeShort(hub, dynamicHubOffsets.getNumClassTypesOffset(), numClassTypes);
564567

565-
writeInt(hub, dynamicHubOffsets.getNumInterfaceTypesOffset(), numInterfacesTypes);
568+
writeShort(hub, dynamicHubOffsets.getNumInterfaceTypesOffset(), numInterfacesTypes);
566569
writeObject(hub, dynamicHubOffsets.getOpenTypeWorldTypeCheckSlotsOffset(), openTypeWorldTypeCheckSlots);
567570

568571
writeChar(hub, dynamicHubOffsets.getMonitorOffsetOffset(), monitorOffset);
@@ -677,9 +680,9 @@ public void setOpenTypeWorldData(CFunctionPointer[] vtable, int typeID,
677680
assert this.vtable == null : "Initialization must be called only once";
678681

679682
this.typeID = typeID;
680-
this.typeIDDepth = typeCheckDepth;
681-
this.numClassTypes = numClassTypes;
682-
this.numInterfaceTypes = numInterfaceTypes;
683+
this.typeIDDepth = NumUtil.safeToShortAE(typeCheckDepth);
684+
this.numClassTypes = NumUtil.safeToShortAE(numClassTypes);
685+
this.numInterfaceTypes = NumUtil.safeToShortAE(numInterfaceTypes);
683686
this.openTypeWorldTypeCheckSlots = typeCheckSlots;
684687
this.vtable = vtable;
685688
}

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SVMHost.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ public ClassInitializationSupport getClassInitializationSupport() {
610610
return classInitializationSupport;
611611
}
612612

613-
private static int computeHubType(AnalysisType type) {
613+
private static byte computeHubType(AnalysisType type) {
614614
if (type.isArray()) {
615615
if (type.getComponentType().isPrimitive() || type.getComponentType().isWordType()) {
616616
return HubType.PRIMITIVE_ARRAY;

wasm/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This changelog summarizes major changes to the WebAssembly engine implemented in
55
## Version 24.2.0
66

77
* Updated developer metadata of Maven artifacts.
8+
* Deprecated the `--wasm.AsyncParsingBinarySize` and `--wasm.AsyncParsingStackSize` options. These options no longer have any effect and will be removed in a future release.
89

910
## Version 24.1.0
1011

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/WasmInstantiator.java

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -50,8 +50,6 @@
5050
import org.graalvm.collections.MapCursor;
5151
import org.graalvm.wasm.constants.BytecodeBitEncoding;
5252
import org.graalvm.wasm.constants.SegmentMode;
53-
import org.graalvm.wasm.exception.Failure;
54-
import org.graalvm.wasm.exception.WasmException;
5553
import org.graalvm.wasm.memory.WasmMemory;
5654
import org.graalvm.wasm.memory.WasmMemoryFactory;
5755
import org.graalvm.wasm.nodes.WasmCallStubNode;
@@ -74,22 +72,6 @@
7472
* Creates wasm instances by converting parser nodes into Truffle nodes.
7573
*/
7674
public class WasmInstantiator {
77-
private static final int MIN_DEFAULT_STACK_SIZE = 1_000_000;
78-
private static final int MAX_DEFAULT_ASYNC_STACK_SIZE = 10_000_000;
79-
80-
private static final class ParsingExceptionHandler implements Thread.UncaughtExceptionHandler {
81-
private Throwable parsingException = null;
82-
83-
@Override
84-
public void uncaughtException(Thread t, Throwable e) {
85-
this.parsingException = e;
86-
}
87-
88-
public Throwable parsingException() {
89-
return parsingException;
90-
}
91-
}
92-
9375
private final WasmLanguage language;
9476

9577
@TruffleBoundary
@@ -101,30 +83,7 @@ public WasmInstantiator(WasmLanguage language) {
10183
public WasmInstance createInstance(WasmContext context, WasmModule module, TruffleContext truffleContext) {
10284
WasmInstance instance = new WasmInstance(context, module, truffleContext);
10385
instance.createLinkActions();
104-
int binarySize = instance.module().bytecodeLength();
105-
final int asyncParsingBinarySize = WasmOptions.AsyncParsingBinarySize.getValue(context.environment().getOptions());
106-
if (binarySize < asyncParsingBinarySize || !context.environment().isCreateThreadAllowed()) {
107-
instantiateCodeEntries(context, instance);
108-
} else {
109-
final Runnable parsing = () -> instantiateCodeEntries(context, instance);
110-
final String name = "wasm-parsing-thread(" + instance.name() + ")";
111-
final int requestedSize = WasmOptions.AsyncParsingStackSize.getValue(context.environment().getOptions()) * 1000;
112-
final int defaultSize = Math.max(MIN_DEFAULT_STACK_SIZE, Math.min(2 * binarySize, MAX_DEFAULT_ASYNC_STACK_SIZE));
113-
final int stackSize = requestedSize != 0 ? requestedSize : defaultSize;
114-
final Thread parsingThread = context.environment().newTruffleThreadBuilder(parsing).stackSize(stackSize).build();
115-
parsingThread.setName(name);
116-
final ParsingExceptionHandler handler = new ParsingExceptionHandler();
117-
parsingThread.setUncaughtExceptionHandler(handler);
118-
parsingThread.start();
119-
try {
120-
parsingThread.join();
121-
if (handler.parsingException() != null) {
122-
throw WasmException.create(Failure.UNSPECIFIED_INVALID, "Asynchronous parsing failed.");
123-
}
124-
} catch (InterruptedException e) {
125-
throw WasmException.create(Failure.UNSPECIFIED_INVALID, "Asynchronous parsing interrupted.");
126-
}
127-
}
86+
instantiateCodeEntries(context, instance);
12887
return instance;
12988
}
13089

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/WasmOptions.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -51,10 +51,12 @@ public class WasmOptions {
5151
@Option(help = "A comma-separated list of builtin modules to use.", category = OptionCategory.USER, stability = OptionStability.STABLE, usageSyntax = "[<linkingName>:]<builtinModuleName>,[<linkingName>:]<builtinModuleName>,...")//
5252
public static final OptionKey<String> Builtins = new OptionKey<>("");
5353

54-
@Option(help = "The minimal binary size for which to use async parsing. If threads are not supported, async parsing will not be used.", category = OptionCategory.USER, stability = OptionStability.STABLE, usageSyntax = "[0, inf)")//
54+
@Option(help = "The minimal binary size for which to use async parsing. If threads are not supported, async parsing will not be used.", category = OptionCategory.USER, stability = OptionStability.STABLE, usageSyntax = "[0, inf)", //
55+
deprecated = true, deprecationMessage = "Option no longer has any effect and can be safely omitted.")//
5556
public static final OptionKey<Integer> AsyncParsingBinarySize = new OptionKey<>(100_000);
5657

57-
@Option(help = "The stack size in kilobytes to use during async parsing, or zero to use defaults.", category = OptionCategory.USER, stability = OptionStability.STABLE, usageSyntax = "[0, inf)")//
58+
@Option(help = "The stack size in kilobytes to use during async parsing, or zero to use defaults.", category = OptionCategory.USER, stability = OptionStability.STABLE, usageSyntax = "[0, inf)", //
59+
deprecated = true, deprecationMessage = "Option no longer has any effect and can be safely omitted.")//
5860
public static final OptionKey<Integer> AsyncParsingStackSize = new OptionKey<>(0);
5961

6062
@Option(help = "A comma-separated list of pre-opened Wasi directories.", category = OptionCategory.USER, stability = OptionStability.STABLE, usageSyntax = "[<virtualDir>::]<hostDir>,[<virtualDir>::]<hostDir>,...")//

0 commit comments

Comments
 (0)