--- old/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java 2019-03-28 11:24:25.000000000 -0700 +++ new/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java 2019-03-28 11:24:24.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,6 @@ import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Array; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.Type; @@ -39,7 +38,8 @@ /** * Returns the bytecode of this method, if the method has code. The returned byte array does not * contain breakpoints or non-Java bytecodes. This may return null if the - * {@link #getDeclaringClass() holder} is not {@link ResolvedJavaType#isLinked() linked}. + * {@linkplain #getDeclaringClass() declaring class} is not + * {@linkplain ResolvedJavaType#isLinked() linked}. * * The contained constant pool indices may not be the ones found in the original class file but * they can be used with the JVMCI API (e.g. methods in {@link ConstantPool}). @@ -439,13 +439,15 @@ } /** - * Checks whether the method has bytecodes associated with it. Methods without bytecodes are - * either abstract or native methods. + * Checks whether the method has bytecodes associated with it. Note that even if this method + * returns {@code true}, {@link #getCode} can return {@code null} if + * {@linkplain #getDeclaringClass() declaring class} is not + * {@linkplain ResolvedJavaType#isLinked() linked}. * - * @return whether the definition of this method is Java bytecodes + * @return {@code this.getCodeSize() != 0} */ default boolean hasBytecodes() { - return isConcrete() && !isNative(); + return getCodeSize() != 0; } /** @@ -464,16 +466,11 @@ return getDeclaringClass().isJavaLangObject() && getName().equals(""); } - SpeculationLog getSpeculationLog(); - /** - * - * @param object - * @param args - * @throws InvocationTargetException - * @throws IllegalAccessException + * Gets a speculation log that can be used when compiling this method to make new speculations + * and query previously failed speculations. The implementation may return a new + * {@link SpeculationLog} object each time this method is called so its the caller's + * responsibility to ensure the same speculation log is used throughout a compilation. */ - default JavaConstant invoke(JavaConstant object, JavaConstant... args) throws InvocationTargetException, IllegalAccessException { - throw new InternalError("unimplemented"); - } + SpeculationLog getSpeculationLog(); }