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
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ public final class CGlobalDataImpl<T extends PointerBase> extends CGlobalData<T>
* The name of the symbol to create for this data (or null to create no symbol), or if the other
* fields are null, the name of the symbol to be referenced by this instance.
*/
@Platforms(Platform.HOSTED_ONLY.class) //
public final String symbolName;

@Platforms(Platform.HOSTED_ONLY.class) //
public final Supplier<byte[]> bytesSupplier;
@Platforms(Platform.HOSTED_ONLY.class) //
public final IntSupplier sizeSupplier;
public final boolean nonConstant;

Expand Down Expand Up @@ -79,9 +82,4 @@ private CGlobalDataImpl(String symbolName, Supplier<byte[]> bytesSupplier, IntSu
this.sizeSupplier = sizeSupplier;
this.nonConstant = nonConstant;
}

@Override
public String toString() {
return "CGlobalData[symbol=" + symbolName + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.util.function.Supplier;

import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platform.HOSTED_ONLY;
import org.graalvm.nativeimage.Platforms;
import org.graalvm.word.Pointer;
Expand Down Expand Up @@ -53,6 +54,7 @@ public final class CGlobalDataInfo {
/** Cache until writing the image in case the {@link Supplier} is costly or has side-effects. */
@Platforms(HOSTED_ONLY.class) private byte[] bytes;

@Platforms(Platform.HOSTED_ONLY.class)
public CGlobalDataInfo(CGlobalDataImpl<?> data) {
assert data != null;
this.data = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ private DynamicHub createHub(AnalysisType type) {
String simpleBinaryName = stringTable.deduplicate(getSimpleBinaryName(javaClass), true);

Class<?> nestHost = javaClass.getNestHost();
VMError.guarantee(platformSupported(nestHost), "The NestHost %s for %s is not available in this platform.", nestHost, javaClass);

boolean isHidden = javaClass.isHidden();
boolean isRecord = javaClass.isRecord();
boolean assertionStatus = RuntimeAssertionsSupport.singleton().desiredAssertionStatus(javaClass);
Expand Down