Mercurial > hg > graal-jvmci-8
diff jvmci/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.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 | 5ba5ff0fda9e |
children | 0ab4d816a7f0 |
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java Wed Jan 20 13:56:34 2016 -0800 +++ b/jvmci/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java Thu Jan 21 13:53:26 2016 -0800 @@ -22,9 +22,6 @@ */ package jdk.vm.ci.hotspot.sparc; -import static jdk.vm.ci.code.CallingConvention.Type.JavaCall; -import static jdk.vm.ci.code.CallingConvention.Type.JavaCallee; -import static jdk.vm.ci.code.CallingConvention.Type.NativeCall; import static jdk.vm.ci.meta.JavaKind.Void; import static jdk.vm.ci.meta.Value.ILLEGAL; import static jdk.vm.ci.sparc.SPARC.REGISTER_SAFE_AREA_SIZE; @@ -81,6 +78,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; @@ -200,12 +198,12 @@ } @Override - public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { - if (type == JavaCall || type == NativeCall) { - return callingConvention(cpuCallerParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target) { + if (type == HotSpotCallingConventionType.JavaCall || type == HotSpotCallingConventionType.NativeCall) { + return callingConvention(cpuCallerParameterRegisters, returnType, parameterTypes, (HotSpotCallingConventionType) type, target); } - if (type == JavaCallee) { - return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + if (type == HotSpotCallingConventionType.JavaCallee) { + return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, (HotSpotCallingConventionType) type, target); } throw JVMCIError.shouldNotReachHere(); } @@ -219,7 +217,7 @@ case Int: case Long: case Object: - return type == Type.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters; + return type == HotSpotCallingConventionType.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters; case Double: case Float: return fpuFloatParameterRegisters; @@ -228,7 +226,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; @@ -246,13 +244,13 @@ 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 Double: - if (!stackOnly && currentFloating < fpuFloatParameterRegisters.length) { + if (currentFloating < fpuFloatParameterRegisters.length) { if (currentFloating % 2 != 0) { // Make register number even to be a double reg currentFloating++; @@ -263,7 +261,7 @@ } break; case Float: - if (!stackOnly && currentFloating < fpuFloatParameterRegisters.length) { + if (currentFloating < fpuFloatParameterRegisters.length) { Register register = fpuFloatParameterRegisters[currentFloating++]; locations[i] = register.asValue(target.getLIRKind(kind)); } @@ -287,7 +285,7 @@ AllocatableValue returnLocation = returnKind == Void ? ILLEGAL : getReturnRegister(returnKind, type).asValue(target.getLIRKind(returnKind.getStackKind())); int outArgSpillArea; - if (type == NativeCall && addNativeRegisterArgumentSlots) { + if (type == HotSpotCallingConventionType.NativeCall && addNativeRegisterArgumentSlots) { // Space for native callee which may spill our outgoing arguments outArgSpillArea = Math.min(locations.length, generalParameterRegisters.length) * target.wordSize; } else { @@ -302,7 +300,7 @@ @Override public Register getReturnRegister(JavaKind kind) { - return getReturnRegister(kind, JavaCallee); + return getReturnRegister(kind, HotSpotCallingConventionType.JavaCallee); } private static Register getReturnRegister(JavaKind kind, Type type) { @@ -314,7 +312,7 @@ case Int: case Long: case Object: - return type == JavaCallee ? i0 : o0; + return type == HotSpotCallingConventionType.JavaCallee ? i0 : o0; case Float: return f0; case Double: