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 * Gets a speculation log that can be used when compiling this method to make new speculations
468 * and query previously failed speculations. The implementation may return a new
469 * {@link SpeculationLog} object each time this method is called so its the caller's
470 * responsibility to ensure the same speculation log is used throughout a compilation.
471 */
472 SpeculationLog getSpeculationLog();
473 }
|
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 * Gets a speculation log that can be used when compiling this method to make new speculations
468 * and query previously failed speculations. The implementation may return a new
469 * {@link SpeculationLog} object each time this method is called so its the caller's
470 * responsibility to ensure the same speculation log is used throughout a compilation.
471 */
472 SpeculationLog getSpeculationLog();
473 }
|