diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotSignature.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 9e5e83ca2259
children 3c0a889a176b
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotSignature.java	Mon Dec 27 20:35:47 2010 +0100
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotSignature.java	Tue Dec 28 18:33:26 2010 +0100
@@ -116,11 +116,7 @@
         }
         RiType type = argumentTypes[index];
         if (type == null) {
-            long accessor = 0;
-            if (accessingClass instanceof HotSpotTypeResolved) {
-                accessor = (Long) ((HotSpotTypeResolved) accessingClass).getVmId();
-            }
-            type = Compiler.getVMEntries().RiSignature_lookupType(arguments.get(index), accessor);
+            type = Compiler.getVMEntries().RiSignature_lookupType(arguments.get(index), (HotSpotTypeResolved) accessingClass);
             argumentTypes[index] = type;
         }
         return type;
@@ -139,11 +135,7 @@
     @Override
     public RiType returnType(RiType accessingClass) {
         if (returnTypeCache == null) {
-            long accessor = 0;
-            if (accessingClass instanceof HotSpotTypeResolved) {
-                accessor = (Long) ((HotSpotTypeResolved) accessingClass).getVmId();
-            }
-            returnTypeCache = Compiler.getVMEntries().RiSignature_lookupType(returnType, accessor);
+            returnTypeCache = Compiler.getVMEntries().RiSignature_lookupType(returnType, (HotSpotTypeResolved) accessingClass);
         }
         return returnTypeCache;
     }