Mercurial > hg > graal-jvmci-8
diff jvmci/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java @ 22784:0ab4d816a7f0
Always check the type of CallingConvention.Type
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Fri, 22 Jan 2016 14:05:49 -0800 |
parents | d63506bb5237 |
children | ac649db7fec4 |
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java Thu Jan 21 13:53:26 2016 -0800 +++ b/jvmci/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java Fri Jan 22 14:05:49 2016 -0800 @@ -91,6 +91,7 @@ return allocatable.clone(); } + @Override public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { ArrayList<Register> list = new ArrayList<>(); for (Register reg : registers) { @@ -176,6 +177,7 @@ return callerSaved; } + @Override public Register[] getCalleeSaveRegisters() { return null; } @@ -192,15 +194,18 @@ @Override public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; if (type == HotSpotCallingConventionType.NativeCall) { - return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, (HotSpotCallingConventionType) type, target); + return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } // On x64, parameter locations are the same whether viewed // from the caller or callee perspective - return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, (HotSpotCallingConventionType) type, target); + return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } + @Override public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; switch (kind) { case Boolean: case Byte: @@ -209,7 +214,7 @@ case Int: case Long: case Object: - return type == HotSpotCallingConventionType.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; + return hotspotType == HotSpotCallingConventionType.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; case Float: case Double: return xmmParameterRegisters;