Mercurial > hg > truffle
diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java @ 1440:4d1d3bd140f9
Updated for changes in CRI.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 01 Nov 2010 23:50:37 +0100 |
parents | d0c8d3a2a7e8 |
children | 9196a2b32950 |
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java Fri Oct 29 18:14:17 2010 +0200 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java Mon Nov 01 23:50:37 2010 +0100 @@ -24,15 +24,11 @@ import java.util.*; -import com.sun.c1x.target.amd64.AMD64; -import com.sun.c1x.util.Util; -import com.sun.cri.ci.CiCallingConvention; -import com.sun.cri.ci.CiKind; -import com.sun.cri.ci.CiRegister; -import com.sun.cri.ci.CiStackSlot; -import com.sun.cri.ci.CiTarget; -import com.sun.cri.ci.CiValue; -import com.sun.cri.ci.CiRegister.*; +import com.sun.c1x.target.amd64.*; +import com.sun.c1x.util.*; +import com.sun.cri.ci.*; +import com.sun.cri.ci.CiCallingConvention.Type; +import com.sun.cri.ci.CiRegister.RegisterFlag; import com.sun.cri.ri.*; /** @@ -69,6 +65,7 @@ private final CiRegister[] generalParameterRegisters; private final CiRegister[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7}; + private final CiRegister[] allParameterRegisters; public HotSpotRegisterConfig(HotSpotVMConfig config) { if (config.windowsOs) { @@ -77,6 +74,8 @@ generalParameterRegisters = new CiRegister[] {rsi, rdx, rcx, r8, r9, rdi}; } attributesMap = RiRegisterAttributes.createMap(this, AMD64.allRegisters); + allParameterRegisters = Arrays.copyOf(generalParameterRegisters, generalParameterRegisters.length + xmmParameterRegisters.length); + System.arraycopy(xmmParameterRegisters, 0, allParameterRegisters, generalParameterRegisters.length, xmmParameterRegisters.length); } @Override @@ -97,8 +96,15 @@ } @Override - public CiCallingConvention getJavaCallingConvention(CiKind[] parameters, boolean outgoing, CiTarget target) { - return callingConvention(parameters, outgoing, target); + public CiCallingConvention getCallingConvention(Type type, CiKind[] parameters, boolean outgoing, CiTarget target) { + if (type == Type.Native) { + throw new UnsupportedOperationException(); + } + return callingConvention(parameters, type == Type.Runtime ? true : outgoing, target); + } + + public CiRegister[] getCallingConventionRegisters(Type type) { + return allParameterRegisters; } private CiCallingConvention callingConvention(CiKind[] types, boolean outgoing, CiTarget target) { @@ -147,11 +153,6 @@ } @Override - public CiCallingConvention getNativeCallingConvention(CiKind[] parameters, boolean outgoing, CiTarget target) { - throw new UnsupportedOperationException(); - } - - @Override public CiRegister getReturnRegister(CiKind kind) { switch (kind) { case Boolean: @@ -175,11 +176,6 @@ } @Override - public CiCallingConvention getRuntimeCallingConvention(CiKind[] parameters, CiTarget target) { - return callingConvention(parameters, true, target); - } - - @Override public CiRegister getScratchRegister() { return r10; }