diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java @ 1941:79d04223b8a5

Added caching for resolved types and resolved fields. This is crucial, because the local load elimination will lead to wrong results, if field equality (of two RiField objects with the same object and the same RiType) is not given. The caching makes sure that the default equals implementation is sufficient.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Tue, 28 Dec 2010 18:33:26 +0100
parents 2fe369533fed
children 177398c6147d
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java	Mon Dec 27 20:35:47 2010 +0100
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java	Tue Dec 28 18:33:26 2010 +0100
@@ -32,12 +32,11 @@
 
     public final String name;
     public final int dimensions;
-    private final long accessingClassVmId;
 
     /**
      * Creates a new unresolved type for a specified type descriptor.
      */
-    public HotSpotTypeUnresolved(String name, long accessingClassVmId) {
+    public HotSpotTypeUnresolved(String name) {
         assert name.length() > 0 : "name cannot be empty";
 
         int dimensions = 0;
@@ -54,14 +53,12 @@
 
         this.name = name;
         this.dimensions = dimensions;
-        this.accessingClassVmId = accessingClassVmId;
     }
 
-    public HotSpotTypeUnresolved(String name, int dimensions, long accessingClassVmId) {
+    public HotSpotTypeUnresolved(String name, int dimensions) {
         assert dimensions >= 0;
         this.name = name;
         this.dimensions = dimensions;
-        this.accessingClassVmId = accessingClassVmId;
     }
 
     @Override
@@ -142,7 +139,7 @@
     @Override
     public RiType componentType() {
         assert isArrayClass() : "no array class" + name();
-        return new HotSpotTypeUnresolved(name, dimensions - 1, accessingClassVmId);
+        return new HotSpotTypeUnresolved(name, dimensions - 1);
     }
 
     @Override
@@ -152,7 +149,7 @@
 
     @Override
     public RiType arrayOf() {
-        return new HotSpotTypeUnresolved(name, dimensions + 1, accessingClassVmId);
+        return new HotSpotTypeUnresolved(name, dimensions + 1);
     }
 
     @Override