Skip to content

Commit c1ea29f

Browse files
committed
[GR-31170] Add some AArch64 Windows and Darwin features.
PullRequest: graal/9986
2 parents e59968c + 0c24d67 commit c1ea29f

File tree

8 files changed

+257
-97
lines changed

8 files changed

+257
-97
lines changed

sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This changelog summarizes major changes between GraalVM SDK versions. The main focus is on APIs exported by GraalVM SDK.
44

55
## Version 22.0.0
6+
* (GR-31170) Native Image API: Added `WINDOWS_AARCH64` Platform.
67
* (GR-33657) Native Image API: Added `CEntryPoint#include` attribute which can be used to controll if the entry point should be automatically added to the shared library.
78
* (GR-22699)(EE-only) Added the ability to spawn a native-image isolate for a each `Engine` or `Context` by calling `Context.Builder.option("engine.SpawnIsolate", "true")`. This enables heap isolation between the host and guest applications. Using isolates improves security, startup and warmup time of polyglot languages. In this mode, calls between host and guest are more costly as they need to cross a native boundary. It is recommended to use the `HostAccess.SCOPED` policy with this mode to avoid strong cyclic references between host and guest. This mode is experimental in this release and only supported for a limited set of languages.
89

sdk/src/org.graalvm.nativeimage/snapshot.sigtest

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ innr public final static IOS_AARCH64
226226
innr public final static IOS_AMD64
227227
innr public final static LINUX_AARCH64
228228
innr public final static WINDOWS_AMD64
229+
innr public final static WINDOWS_AARCH64
229230
innr public static LINUX_AMD64
230231
meth public java.lang.String getArchitecture()
231232
meth public java.lang.String getOS()
@@ -327,6 +328,13 @@ intf org.graalvm.nativeimage.Platform$AMD64
327328
intf org.graalvm.nativeimage.Platform$WINDOWS
328329
supr java.lang.Object
329330

331+
CLSS public final static org.graalvm.nativeimage.Platform$WINDOWS_AARCH64
332+
outer org.graalvm.nativeimage.Platform
333+
cons public init()
334+
intf org.graalvm.nativeimage.Platform$AARCH64
335+
intf org.graalvm.nativeimage.Platform$WINDOWS
336+
supr java.lang.Object
337+
330338
CLSS public abstract interface !annotation org.graalvm.nativeimage.Platforms
331339
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
332340
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, CONSTRUCTOR, FIELD, PACKAGE])

sdk/src/org.graalvm.nativeimage/src/META-INF/services/org.graalvm.nativeimage.Platform

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ org.graalvm.nativeimage.Platform$DARWIN_AARCH64
66
org.graalvm.nativeimage.Platform$IOS_AMD64
77
org.graalvm.nativeimage.Platform$IOS_AARCH64
88
org.graalvm.nativeimage.Platform$WINDOWS_AMD64
9+
org.graalvm.nativeimage.Platform$WINDOWS_AARCH64

sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/Platform.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,23 @@ public WINDOWS_AMD64() {
369369

370370
}
371371

372+
/**
373+
* Supported leaf platform: Windows on AArch 64-bit.
374+
*
375+
* @since 22.0
376+
*/
377+
final class WINDOWS_AARCH64 implements WINDOWS, AARCH64 {
378+
379+
/**
380+
* Instantiates a marker instance of this platform.
381+
*
382+
* @since 22.0
383+
*/
384+
public WINDOWS_AARCH64() {
385+
}
386+
387+
}
388+
372389
/**
373390
* Marker for elements (types, methods, or fields) that are only visible during native image
374391
* generation and cannot be used at run time, regardless of the actual platform.

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/ObjectFile.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ public enum RelocationKind {
274274
PC_RELATIVE_2,
275275
PC_RELATIVE_4,
276276
PC_RELATIVE_8,
277+
/**
278+
* AArch64-specific relocation types.
279+
*/
277280
AARCH64_R_MOVW_UABS_G0,
278281
AARCH64_R_MOVW_UABS_G0_NC,
279282
AARCH64_R_MOVW_UABS_G1,
@@ -345,6 +348,14 @@ public static int getRelocationSize(RelocationKind kind) {
345348
case PC_RELATIVE_4:
346349
case SECREL_4:
347350
return 4;
351+
case AARCH64_R_AARCH64_ADR_PREL_PG_HI21:
352+
case AARCH64_R_AARCH64_LDST64_ABS_LO12_NC:
353+
case AARCH64_R_AARCH64_LDST32_ABS_LO12_NC:
354+
case AARCH64_R_AARCH64_LDST16_ABS_LO12_NC:
355+
case AARCH64_R_AARCH64_LDST8_ABS_LO12_NC:
356+
case AARCH64_R_AARCH64_ADD_ABS_LO12_NC:
357+
// AArch64 instructions are 4 bytes
358+
return 4;
348359
case DIRECT_8:
349360
case PC_RELATIVE_8:
350361
return 8;

0 commit comments

Comments
 (0)