diff jvmci/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java @ 22783:d63506bb5237

Make CallingConvention.Type extensible; remove unused stackOnly parameter
author Christian Wimmer <christian.wimmer@oracle.com>
date Thu, 21 Jan 2016 13:53:26 -0800
parents 577a4a8caa72
children 0ab4d816a7f0
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java	Wed Jan 20 13:56:34 2016 -0800
+++ b/jvmci/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java	Thu Jan 21 13:53:26 2016 -0800
@@ -62,6 +62,7 @@
 import jdk.vm.ci.code.StackSlot;
 import jdk.vm.ci.code.TargetDescription;
 import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.hotspot.HotSpotCallingConventionType;
 import jdk.vm.ci.hotspot.HotSpotVMConfig;
 import jdk.vm.ci.meta.AllocatableValue;
 import jdk.vm.ci.meta.JavaKind;
@@ -191,13 +192,13 @@
     }
 
     @Override
-    public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) {
-        if (type == Type.NativeCall) {
-            return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly);
+    public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target) {
+        if (type == HotSpotCallingConventionType.NativeCall) {
+            return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, (HotSpotCallingConventionType) type, target);
         }
         // On x64, parameter locations are the same whether viewed
         // from the caller or callee perspective
-        return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly);
+        return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, (HotSpotCallingConventionType) type, target);
     }
 
     public Register[] getCallingConventionRegisters(Type type, JavaKind kind) {
@@ -209,7 +210,7 @@
             case Int:
             case Long:
             case Object:
-                return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters;
+                return type == HotSpotCallingConventionType.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters;
             case Float:
             case Double:
                 return simdParameterRegisters;
@@ -218,7 +219,7 @@
         }
     }
 
-    private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) {
+    private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, HotSpotCallingConventionType type, TargetDescription target) {
         AllocatableValue[] locations = new AllocatableValue[parameterTypes.length];
 
         int currentGeneral = 0;
@@ -236,14 +237,14 @@
                 case Int:
                 case Long:
                 case Object:
-                    if (!stackOnly && currentGeneral < generalParameterRegisters.length) {
+                    if (currentGeneral < generalParameterRegisters.length) {
                         Register register = generalParameterRegisters[currentGeneral++];
                         locations[i] = register.asValue(target.getLIRKind(kind));
                     }
                     break;
                 case Float:
                 case Double:
-                    if (!stackOnly && currentSIMD < simdParameterRegisters.length) {
+                    if (currentSIMD < simdParameterRegisters.length) {
                         Register register = simdParameterRegisters[currentSIMD++];
                         locations[i] = register.asValue(target.getLIRKind(kind));
                     }