comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java @ 1448:9196a2b32950

Modified C++ to reflect changes in calling convention CRI code.
author Doug Simon <doug.simon@oracle.com>
date Tue, 09 Nov 2010 17:40:15 +0100
parents 4d1d3bd140f9
children 43a93774d24f
comparison
equal deleted inserted replaced
1447:1afbc44ee576 1448:9196a2b32950
94 public CiRegister getRegister(int index) { 94 public CiRegister getRegister(int index) {
95 throw new UnsupportedOperationException(); 95 throw new UnsupportedOperationException();
96 } 96 }
97 97
98 @Override 98 @Override
99 public CiCallingConvention getCallingConvention(Type type, CiKind[] parameters, boolean outgoing, CiTarget target) { 99 public CiCallingConvention getCallingConvention(Type type, CiKind[] parameters, CiTarget target) {
100 if (type == Type.Native) { 100 if (type == Type.NativeCall) {
101 throw new UnsupportedOperationException(); 101 throw new UnsupportedOperationException();
102 } 102 }
103 return callingConvention(parameters, type == Type.Runtime ? true : outgoing, target); 103 return callingConvention(parameters, type, target);
104 } 104 }
105 105
106 public CiRegister[] getCallingConventionRegisters(Type type) { 106 public CiRegister[] getCallingConventionRegisters(Type type) {
107 return allParameterRegisters; 107 return allParameterRegisters;
108 } 108 }
109 109
110 private CiCallingConvention callingConvention(CiKind[] types, boolean outgoing, CiTarget target) { 110 private CiCallingConvention callingConvention(CiKind[] types, Type type, CiTarget target) {
111 CiValue[] locations = new CiValue[types.length]; 111 CiValue[] locations = new CiValue[types.length];
112 112
113 int currentGeneral = 0; 113 int currentGeneral = 0;
114 int currentXMM = 0; 114 int currentXMM = 0;
115 int currentStackIndex = 0; 115 int currentStackIndex = 0;
142 throw Util.shouldNotReachHere(); 142 throw Util.shouldNotReachHere();
143 } 143 }
144 144
145 if (locations[i] == null) { 145 if (locations[i] == null) {
146 // we need to adjust for the frame pointer stored on the stack, which shifts incoming arguments by one slot 146 // we need to adjust for the frame pointer stored on the stack, which shifts incoming arguments by one slot
147 locations[i] = CiStackSlot.get(kind.stackKind(), currentStackIndex + (outgoing ? 0 : 1), !outgoing); 147 locations[i] = CiStackSlot.get(kind.stackKind(), currentStackIndex + (type.out ? 0 : 1), !type.out);
148 currentStackIndex += target.spillSlots(kind); 148 currentStackIndex += target.spillSlots(kind);
149 } 149 }
150 } 150 }
151 151
152 return new CiCallingConvention(locations, currentStackIndex * target.spillSlotSize); 152 return new CiCallingConvention(locations, currentStackIndex * target.spillSlotSize);