Mercurial > hg > truffle
comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java @ 1433:efba53f86c4f
various fixes and enhancements
* correct refmap->oopmap conversion (register numbering, stack slot numbering)
* fixes for inlining (correct scoping in exception handler lookup, NPE in scope conversion)
* support for "jump to runtime stub" (patching code needs to be aware of jmp instruction)
* provide more information about methods (to allow inlining: has_balanced_monitors, etc.)
* fixes to signature type lookup
* isSubTypeOf: correct handling of array classes
* RiType: componentType/arrayOf
* prologue: inline cache check, icmiss stub
* klass state check (resolved but not initialized) in newinstance
* card table write barriers
* c1x classes are optional (to allow running c1 without them)
* correct for stored frame pointer in calling conventions (methods with arguments on stack)
* getType(Class<?>) for some basic types, used for optimizations and folding
* RiMethod/RiType: throw exception instead of silent failure on unsupported operations
* RiType: resolved/unresolved array type support
* refactoring: new on-demand template generation mechanism
* optimizations: template specialization for no_null_check, given length, etc.
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Thu, 16 Sep 2010 19:42:20 -0700 |
parents | abc670a709dc |
children | 9e5e83ca2259 |
comparison
equal
deleted
inserted
replaced
1432:b61a43cd1255 | 1433:efba53f86c4f |
---|---|
26 * @author Thomas Wuerthinger, Lukas Stadler | 26 * @author Thomas Wuerthinger, Lukas Stadler |
27 */ | 27 */ |
28 public class HotSpotTypeUnresolved implements HotSpotType { | 28 public class HotSpotTypeUnresolved implements HotSpotType { |
29 | 29 |
30 public final String name; | 30 public final String name; |
31 public final int dimensions; | |
31 private final long accessingClassVmId; | 32 private final long accessingClassVmId; |
32 | 33 |
33 /** | 34 /** |
34 * Creates a new unresolved type for a specified type descriptor. | 35 * Creates a new unresolved type for a specified type descriptor. |
35 */ | 36 */ |
36 public HotSpotTypeUnresolved(String name, long accessingClassVmId) { | 37 public HotSpotTypeUnresolved(String name, long accessingClassVmId) { |
37 this.name = name; | 38 this.name = name; |
39 this.dimensions = 0; | |
40 this.accessingClassVmId = accessingClassVmId; | |
41 } | |
42 | |
43 public HotSpotTypeUnresolved(String name, int dimensions, long accessingClassVmId) { | |
44 this.name = name; | |
45 this.dimensions = dimensions; | |
38 this.accessingClassVmId = accessingClassVmId; | 46 this.accessingClassVmId = accessingClassVmId; |
39 } | 47 } |
40 | 48 |
41 @Override | 49 @Override |
42 public String name() { | 50 public String name() { |
51 StringBuilder str = new StringBuilder(); | |
52 for (int i = 0; i < dimensions; i++) { | |
53 str.append('['); | |
54 } | |
55 str.append('L').append(name).append(';'); | |
56 return str.toString(); | |
57 } | |
58 | |
59 @Override | |
60 public String simpleName() { | |
43 return name; | 61 return name; |
44 } | 62 } |
45 | 63 |
46 @Override | 64 @Override |
47 public Class<?> javaClass() { | 65 public Class<?> javaClass() { |
68 throw unresolved("isInterface()"); | 86 throw unresolved("isInterface()"); |
69 } | 87 } |
70 | 88 |
71 @Override | 89 @Override |
72 public boolean isArrayClass() { | 90 public boolean isArrayClass() { |
73 throw unresolved("isArrayClass()"); | 91 return dimensions > 0; |
74 } | 92 } |
75 | 93 |
76 @Override | 94 @Override |
77 public boolean isInstanceClass() { | 95 public boolean isInstanceClass() { |
78 throw unresolved("isInstanceClass()"); | 96 throw unresolved("isInstanceClass()"); |
114 throw unresolved("exactType()"); | 132 throw unresolved("exactType()"); |
115 } | 133 } |
116 | 134 |
117 @Override | 135 @Override |
118 public RiType arrayOf() { | 136 public RiType arrayOf() { |
119 // TODO: Implement | 137 return new HotSpotTypeUnresolved(name, dimensions + 1, accessingClassVmId); |
120 throw new UnsupportedOperationException(); | |
121 } | 138 } |
122 | 139 |
123 @Override | 140 @Override |
124 public RiMethod resolveMethodImpl(RiMethod method) { | 141 public RiMethod resolveMethodImpl(RiMethod method) { |
125 throw unresolved("resolveMethodImpl()"); | 142 throw unresolved("resolveMethodImpl()"); |
126 } | 143 } |
127 | 144 |
128 @Override | 145 @Override |
129 public CiKind kind() { | 146 public CiKind kind() { |
130 // TODO: Check if this is correct. | |
131 return CiKind.Object; | 147 return CiKind.Object; |
132 } | 148 } |
133 | 149 |
134 private CiUnresolvedException unresolved(String operation) { | 150 private CiUnresolvedException unresolved(String operation) { |
135 throw new CiUnresolvedException(operation + " not defined for unresolved class " + name); | 151 throw new CiUnresolvedException(operation + " not defined for unresolved class " + name); |