443 * @see #getCodeSize()
444 * @return {@code getCodeSize() > 0}
445 */
446 default boolean hasBytecodes() {
447 return getCodeSize() > 0;
448 }
449
450 /**
451 * Checks whether the method has a receiver parameter - i.e., whether it is not static.
452 *
453 * @return whether the method has a receiver parameter
454 */
455 default boolean hasReceiver() {
456 return !isStatic();
457 }
458
459 /**
460 * Determines if this method is {@link java.lang.Object#Object()}.
461 */
462 default boolean isJavaLangObjectInit() {
463 return getDeclaringClass().isJavaLangObject() && getName().equals("<init>");
464 }
465
466 /**
467 * Returns true if this method has a
468 * {@code jdk.internal.misc.ScopedMemoryAccess.Scoped} annotation.
469 *
470 * @return true if Scoped annotation present, false otherwise.
471 */
472 default boolean isScoped() {
473 throw new UnsupportedOperationException();
474 }
475
476 /**
477 * Gets a speculation log that can be used when compiling this method to make new speculations
478 * and query previously failed speculations. The implementation may return a new
479 * {@link SpeculationLog} object each time this method is called so its the caller's
480 * responsibility to ensure the same speculation log is used throughout a compilation.
481 */
482 SpeculationLog getSpeculationLog();
483 }
|
443 * @see #getCodeSize()
444 * @return {@code getCodeSize() > 0}
445 */
446 default boolean hasBytecodes() {
447 return getCodeSize() > 0;
448 }
449
450 /**
451 * Checks whether the method has a receiver parameter - i.e., whether it is not static.
452 *
453 * @return whether the method has a receiver parameter
454 */
455 default boolean hasReceiver() {
456 return !isStatic();
457 }
458
459 /**
460 * Determines if this method is {@link java.lang.Object#Object()}.
461 */
462 default boolean isJavaLangObjectInit() {
463 return getDeclaringClass().isJavaLangObject() && (getName().equals("<init>") || getName().equals("<vnew>"));
464 }
465
466 /**
467 * Returns true if this method has a
468 * {@code jdk.internal.misc.ScopedMemoryAccess.Scoped} annotation.
469 *
470 * @return true if Scoped annotation present, false otherwise.
471 */
472 default boolean isScoped() {
473 throw new UnsupportedOperationException();
474 }
475
476 /**
477 * Gets a speculation log that can be used when compiling this method to make new speculations
478 * and query previously failed speculations. The implementation may return a new
479 * {@link SpeculationLog} object each time this method is called so its the caller's
480 * responsibility to ensure the same speculation log is used throughout a compilation.
481 */
482 SpeculationLog getSpeculationLog();
483 }
|