# HG changeset patch # User Gilles Duboscq # Date 1368183334 -7200 # Node ID ff4e8218d3dda4f78afe4ebdffb253b6d679e147 # Parent dac93aca017b2c35402d5402824050197c3bd937 Remove hasVtableEntry, use isInVirtualMethodTable instead diff -r dac93aca017b -r ff4e8218d3dd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Fri May 10 13:18:51 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Fri May 10 12:55:34 2013 +0200 @@ -35,6 +35,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.ProfilingInfo.TriState; import com.oracle.graal.bytecode.*; +import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.debug.*; import com.oracle.graal.phases.*; @@ -382,20 +383,20 @@ } /** - * Returns the offset of this method into the v-table. If the holder is not initialized, returns - * -1. If it is initialized the method must have a v-table entry has indicated by - * {@link #hasVtableEntry()}. + * Returns the offset of this method into the v-table. The method must have a v-table entry has + * indicated by {@link #isInVirtualMethodTable()}, otherwise an exception is thrown. * * @return the offset of this method into the v-table */ public int vtableEntryOffset() { - if (!holder.isInitialized()) { - return -1; + if (!isInVirtualMethodTable() || !holder.isInitialized()) { + throw new GraalInternalError("%s does not have a vtable entry", this); } return graalRuntime().getCompilerToVM().getVtableEntryOffset(metaspaceMethod); } - public boolean hasVtableEntry() { + @Override + public boolean isInVirtualMethodTable() { return graalRuntime().getCompilerToVM().hasVtableEntry(metaspaceMethod); } @@ -460,9 +461,4 @@ throw new IllegalArgumentException(ex); } } - - @Override - public boolean isInVirtualMethodTable() { - return hasVtableEntry(); - } } diff -r dac93aca017b -r ff4e8218d3dd graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Fri May 10 13:18:51 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Fri May 10 12:55:34 2013 +0200 @@ -772,7 +772,7 @@ HotSpotResolvedJavaMethod hsMethod = (HotSpotResolvedJavaMethod) callTarget.targetMethod(); if (!hsMethod.getDeclaringClass().isInterface()) { - if (hsMethod.hasVtableEntry()) { + if (hsMethod.isInVirtualMethodTable()) { int vtableEntryOffset = hsMethod.vtableEntryOffset(); assert vtableEntryOffset > 0; ReadNode hub = this.createReadHub(tool, graph, wordKind, receiver); @@ -1048,7 +1048,7 @@ private static ReadNode createReadVirtualMethod(StructuredGraph graph, Kind wordKind, ValueNode hub, ResolvedJavaMethod method) { HotSpotResolvedJavaMethod hsMethod = (HotSpotResolvedJavaMethod) method; assert !hsMethod.getDeclaringClass().isInterface(); - assert hsMethod.hasVtableEntry(); + assert hsMethod.isInVirtualMethodTable(); int vtableEntryOffset = hsMethod.vtableEntryOffset(); assert vtableEntryOffset > 0;