Mercurial > hg > graal-jvmci-8
diff jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @ 23997:9a740aa0d87b
use raw method name symbol for isConstructor and isClassInitializer
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Sat, 04 Feb 2017 15:24:10 +0100 |
parents | 11f0412408cd |
children | b01354ea98ec |
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java Fri Feb 03 21:08:05 2017 +0100 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java Sat Feb 04 15:24:10 2017 +0100 @@ -337,12 +337,24 @@ @Override public boolean isClassInitializer() { - return isStatic() && "<clinit>".equals(getName()); + if (isStatic()) { + final int nameIndex = UNSAFE.getChar(getConstMethod() + config().constMethodNameIndexOffset); + long nameSymbol = constantPool.getEntryAt(nameIndex); + long clinitSymbol = config().symbolClinit; + return nameSymbol == clinitSymbol; + } + return false; } @Override public boolean isConstructor() { - return !isStatic() && "<init>".equals(getName()); + if (!isStatic()) { + final int nameIndex = UNSAFE.getChar(getConstMethod() + config().constMethodNameIndexOffset); + long nameSymbol = constantPool.getEntryAt(nameIndex); + long initSymbol = config().symbolInit; + return nameSymbol == initSymbol; + } + return false; } @Override @@ -524,9 +536,6 @@ } public boolean isDefault() { - if (isConstructor()) { - return false; - } // Copied from java.lang.Method.isDefault() int mask = Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC; return ((getModifiers() & mask) == Modifier.PUBLIC) && getDeclaringClass().isInterface();