src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java
equal
deleted
inserted
replaced
239 return getAllModifiers() & jvmMethodModifiers(); |
239 return getAllModifiers() & jvmMethodModifiers(); |
240 } |
240 } |
241 |
241 |
242 @Override |
242 @Override |
243 public boolean canBeStaticallyBound() { |
243 public boolean canBeStaticallyBound() { |
244 return (isFinal() || isPrivate() || isStatic() || holder.isLeaf()) && isConcrete(); |
244 return (isFinal() || isPrivate() || isStatic() || holder.isLeaf() || isConstructor()) && isConcrete(); |
245 } |
245 } |
246 |
246 |
247 @Override |
247 @Override |
248 public byte[] getCode() { |
248 public byte[] getCode() { |
249 if (getCodeSize() == 0) { |
249 if (getCodeSize() == 0) { |
404 return compilerToVM().getStackTraceElement(this, bci); |
404 return compilerToVM().getStackTraceElement(this, bci); |
405 } |
405 } |
406 |
406 |
407 @Override |
407 @Override |
408 public ResolvedJavaMethod uniqueConcreteMethod(HotSpotResolvedObjectType receiver) { |
408 public ResolvedJavaMethod uniqueConcreteMethod(HotSpotResolvedObjectType receiver) { |
|
409 assert !canBeStaticallyBound() : this; |
|
410 |
409 if (receiver.isInterface()) { |
411 if (receiver.isInterface()) { |
410 // Cannot trust interfaces. Because of: |
412 // Cannot trust interfaces. Because of: |
411 // interface I { void foo(); } |
413 // interface I { void foo(); } |
412 // class A { public void foo() {} } |
414 // class A { public void foo() {} } |
413 // class B extends A implements I { } |
415 // class B extends A implements I { } |
415 // class D extends B { } |
417 // class D extends B { } |
416 // Would lead to identify C.foo() as the unique concrete method for I.foo() without |
418 // Would lead to identify C.foo() as the unique concrete method for I.foo() without |
417 // seeing A.foo(). |
419 // seeing A.foo(). |
418 return null; |
420 return null; |
419 } |
421 } |
|
422 assert !receiver.isLinked() || isInVirtualMethodTable(receiver); |
420 if (this.isDefault()) { |
423 if (this.isDefault()) { |
421 // CHA for default methods doesn't work and may crash the VM |
424 // CHA for default methods doesn't work and may crash the VM |
422 return null; |
425 return null; |
423 } |
426 } |
424 return compilerToVM().findUniqueConcreteMethod(((HotSpotResolvedObjectTypeImpl) receiver), this); |
427 return compilerToVM().findUniqueConcreteMethod(((HotSpotResolvedObjectTypeImpl) receiver), this); |