changeset 16426:775660e1acbc

changed return type of Local.getType() to JavaType
author Doug Simon <doug.simon@oracle.com>
date Tue, 08 Jul 2014 21:29:13 +0200
parents 8eec87d7bfc4
children 84a14e69fa8b
files graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Local.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/LocalImpl.java
diffstat 2 files changed, 7 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Local.java	Tue Jul 08 21:23:22 2014 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Local.java	Tue Jul 08 21:29:13 2014 +0200
@@ -32,5 +32,5 @@
 
     String getName();
 
-    ResolvedJavaType getType();
+    JavaType getType();
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/LocalImpl.java	Tue Jul 08 21:23:22 2014 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/LocalImpl.java	Tue Jul 08 21:29:13 2014 +0200
@@ -33,19 +33,14 @@
     private final int startBci;
     private final int endBci;
     private final int slot;
-    private final ResolvedJavaType resolvedType;
+    private final JavaType type;
 
     public LocalImpl(String name, String type, HotSpotResolvedObjectType holder, int startBci, int endBci, int slot) {
         this.name = name;
         this.startBci = startBci;
         this.endBci = endBci;
         this.slot = slot;
-        JavaType t = runtime().lookupType(type, holder, true);
-        if (t instanceof ResolvedJavaType) {
-            this.resolvedType = (ResolvedJavaType) runtime().lookupType(type, holder, false);
-        } else {
-            throw new AssertionError(t.getClass() + " is not a ResolvedJavaType");
-        }
+        this.type = runtime().lookupType(type, holder, false);
     }
 
     @Override
@@ -64,8 +59,8 @@
     }
 
     @Override
-    public ResolvedJavaType getType() {
-        return resolvedType;
+    public JavaType getType() {
+        return type;
     }
 
     @Override
@@ -79,7 +74,7 @@
             return false;
         }
         LocalImpl that = (LocalImpl) obj;
-        return this.name.equals(that.name) && this.startBci == that.startBci && this.endBci == that.endBci && this.slot == that.slot && this.resolvedType.equals(that.resolvedType);
+        return this.name.equals(that.name) && this.startBci == that.startBci && this.endBci == that.endBci && this.slot == that.slot && this.type.equals(that.type);
     }
 
     @Override
@@ -89,6 +84,6 @@
 
     @Override
     public String toString() {
-        return "LocalImpl<name=" + name + ", resolvedType=" + resolvedType + ", startBci=" + startBci + ", endBci=" + endBci + ", slot=" + slot + ">";
+        return "LocalImpl<name=" + name + ", resolvedType=" + type + ", startBci=" + startBci + ", endBci=" + endBci + ", slot=" + slot + ">";
     }
 }