Mercurial > hg > truffle
comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java @ 1423:760213a60e8b
* rewrite of the code installation
* partial support for safepoints
* macro-based CiTargetMethod interface
* code stub support
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Mon, 16 Aug 2010 18:59:36 -0700 |
parents | 3483ec571caf |
children | efba53f86c4f |
comparison
equal
deleted
inserted
replaced
1422:3483ec571caf | 1423:760213a60e8b |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. | 2 * Copyright (c) 2009-2010 Sun Microsystems, Inc. All rights reserved. |
3 * | 3 * |
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is | 4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is |
5 * described in this document. In particular, and without limitation, these intellectual property rights may include one | 5 * described in this document. In particular, and without limitation, these intellectual property rights may include one |
6 * or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent | 6 * or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent |
7 * applications in the U.S. and in other countries. | 7 * applications in the U.S. and in other countries. |
39 import com.sun.max.asm.dis.DisassembledObject; | 39 import com.sun.max.asm.dis.DisassembledObject; |
40 import com.sun.max.asm.dis.Disassembler; | 40 import com.sun.max.asm.dis.Disassembler; |
41 import com.sun.max.asm.dis.DisassemblyPrinter; | 41 import com.sun.max.asm.dis.DisassemblyPrinter; |
42 | 42 |
43 /** | 43 /** |
44 * | 44 * CRI runtime implementation for the HotSpot VM. |
45 * @author Thomas Wuerthinger | 45 * |
46 * | 46 * @author Thomas Wuerthinger, Lukas Stadler |
47 * CRI runtime implementation for the HotSpot VM. | |
48 * | |
49 */ | 47 */ |
50 public class HotSpotRuntime implements RiRuntime { | 48 public class HotSpotRuntime implements RiRuntime { |
51 | 49 |
52 private final HotSpotVMConfig config; | 50 private final HotSpotVMConfig config; |
53 | 51 |
116 return "{safepoint}"; | 114 return "{safepoint}"; |
117 } | 115 } |
118 } | 116 } |
119 for (DataPatch site : targetMethod.dataReferences) { | 117 for (DataPatch site : targetMethod.dataReferences) { |
120 if (site.pcOffset == pcOffset) { | 118 if (site.pcOffset == pcOffset) { |
121 return "{" + site.data + "}"; | 119 return "{" + site.constant + "}"; |
122 } | 120 } |
123 } | 121 } |
124 return null; | 122 return null; |
125 } | 123 } |
126 | 124 |
143 return "No disassembler available"; | 141 return "No disassembler available"; |
144 } | 142 } |
145 | 143 |
146 @Override | 144 @Override |
147 public RiConstantPool getConstantPool(RiMethod method) { | 145 public RiConstantPool getConstantPool(RiMethod method) { |
148 return new HotSpotConstantPool(((HotSpotType) method.holder()).klass); | 146 return ((HotSpotTypeResolved) method.holder()).constantPool(); |
149 } | 147 } |
150 | 148 |
151 @Override | 149 @Override |
152 public RiOsrFrame getOsrFrame(RiMethod method, int bci) { | 150 public RiOsrFrame getOsrFrame(RiMethod method, int bci) { |
153 // TODO Auto-generated method stub | 151 // TODO Auto-generated method stub |
154 return null; | 152 return null; |
155 } | 153 } |
156 | 154 |
157 @Override | 155 @Override |
158 public RiType getRiType(Class< ? > javaClass) { | 156 public RiType getRiType(Class<?> javaClass) { |
159 // TODO Auto-generated method stub | 157 // TODO Auto-generated method stub |
160 return null; | 158 return null; |
161 } | 159 } |
162 | 160 |
163 @Override | 161 @Override |
183 // TODO Auto-generated method stub | 181 // TODO Auto-generated method stub |
184 return false; | 182 return false; |
185 } | 183 } |
186 | 184 |
187 @Override | 185 @Override |
188 public Object registerTargetMethod(CiTargetMethod targetMethod, String name) { | 186 public Object registerGlobalStub(CiTargetMethod targetMethod, String name) { |
189 // TODO Auto-generated method stub | 187 return HotSpotTargetMethod.installStub(targetMethod, name); |
190 return null; | |
191 } | 188 } |
192 | 189 |
193 @Override | 190 @Override |
194 public int sizeofBasicObjectLock() { | 191 public int sizeofBasicObjectLock() { |
195 // TODO Auto-generated method stub | 192 // TODO Auto-generated method stub |
207 // TODO Auto-generated method stub | 204 // TODO Auto-generated method stub |
208 return null; | 205 return null; |
209 } | 206 } |
210 | 207 |
211 @Override | 208 @Override |
212 public RiMethod getRiMethod(Constructor< ? > javaConstructor) { | 209 public RiMethod getRiMethod(Constructor<?> javaConstructor) { |
213 // TODO Auto-generated method stub | 210 // TODO Auto-generated method stub |
214 return null; | 211 return null; |
215 } | 212 } |
216 | 213 |
217 @Override | 214 @Override |