diff 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
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java	Wed Sep 01 17:13:38 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java	Thu Sep 16 19:42:20 2010 -0700
@@ -28,6 +28,7 @@
 public class HotSpotTypeUnresolved implements HotSpotType {
 
     public final String name;
+    public final int dimensions;
     private final long accessingClassVmId;
 
     /**
@@ -35,11 +36,28 @@
      */
     public HotSpotTypeUnresolved(String name, long accessingClassVmId) {
         this.name = name;
+        this.dimensions = 0;
+        this.accessingClassVmId = accessingClassVmId;
+    }
+
+    public HotSpotTypeUnresolved(String name, int dimensions, long accessingClassVmId) {
+        this.name = name;
+        this.dimensions = dimensions;
         this.accessingClassVmId = accessingClassVmId;
     }
 
     @Override
     public String name() {
+        StringBuilder str = new StringBuilder();
+        for (int i = 0; i < dimensions; i++) {
+            str.append('[');
+        }
+        str.append('L').append(name).append(';');
+        return str.toString();
+    }
+
+    @Override
+    public String simpleName() {
         return name;
     }
 
@@ -70,7 +88,7 @@
 
     @Override
     public boolean isArrayClass() {
-        throw unresolved("isArrayClass()");
+        return dimensions > 0;
     }
 
     @Override
@@ -116,8 +134,7 @@
 
     @Override
     public RiType arrayOf() {
-        // TODO: Implement
-        throw new UnsupportedOperationException();
+        return new HotSpotTypeUnresolved(name, dimensions + 1, accessingClassVmId);
     }
 
     @Override
@@ -127,7 +144,6 @@
 
     @Override
     public CiKind kind() {
-        // TODO: Check if this is correct.
         return CiKind.Object;
     }